New SmartInspect demos

Over the next few weeks we are going to rewrite some of the demo applications we ship with SmartInspect and also add new ones. So far we just had a handful of demo applications for each supported platform (.NET, Java and Delphi) and we feel that users would benefit from additional demos that showcase more of SmartInspect’s capabilities.

I will also document some of the more interesting demo applications here on this blog and I’m going to start with an article about WCF logging and tracing. If you have any suggestions for new SmartInspect demos you would like to see, just let us know. Enjoy!

Posted in Gurock Software, Programming, SmartInspect | Leave a comment

Aspect-oriented logging for .NET with Unity and SmartInspect

This article is part of a series about aspect-oriented logging with SmartInspect, our logging tool for .NET, Java and Delphi. Please see the first article of this series for a complete overview of the available posts.

Michael Baarz recently emailed us as he was a looking for a modern .NET logging tool for his company’s complex telecommunication and PBX software. Michael was about to redesign his company’s flagship product and was planning to use Microsoft’s dependency injection framework Unity.

He told us that he really enjoyed working with SmartInspect and because Unity also supports some aspect oriented programming features, Michael decided to write an unofficial library to integrate SmartInspect with Unity so he could benefit from this useful combination. This posting introduces Michael’s library and will explain how to get started with the extension to integrate and benefit from SmartInspect and Unity.

Unity, a dependency injection container

Unity is Microsoft’s dependency injection container and framework and is part of their Patterns & Practices initiative. If you are new to dependency injection in general, I recommend taking a look at this article by Martin Fowler that explains the basic concepts and benefits. Besides common dependency injection features, Unity also supports aspect oriented programming by allowing you to intercept and wrap method calls.

The big difference between dependency injection (DI) frameworks and classic AOP tools such as PostSharp is that DI frameworks are configured at run-time, whereas PostSharp injects and builds its aspects at compile time. Both approaches have their pros and cons, so it really depends on the circumstances which one you should use (DI frameworks are usually more flexible as you can change the behavior at run-time, whereas ‘classic’ AOP tools support more features and are usually faster).

Using the SmartInspect Unity Interception Extension

Michael’s library to integrate SmartInspect and Unity is called the SmartInspect Unity Interception Extension and can be downloaded from CodePlex. To get started with the library, either check out the source code via Subversion or download one of the releases (there wasn’t a release at the time of this writing yet).

To use the library in your solution, you first need to add a few assembly references to your projects. First of all, you need to reference the Microsoft.Practices.Unity and Microsoft.Practices.Unity.Interception assemblies; these are part of Unity and are automatically installed and registered when you download and install Unity. The next assembly reference you need to add is Gurock.SmartInspect, as this is required to use SmartInspect logging. Last but not least you need to add Michael’s SmartInspect.Extensions.Unity assembly as a reference to your project, either by adding a reference to the compiled DLL or by adding the project to your solution and using a project reference.

Tracing method execution

One of the more useful aspects (no pun intended) of AOP is the capability to easily trace method execution, so this is the first thing I’m going to demonstrate. Unity is a dependency injection framework so we will need to properly register and instantiate all classes we want to intercept for logging. The first thing we need to do is to define the interface for the class we want to instantiate through Unity. Because one of the design goals of DI is that we can easily replace the actual implementation for an interface, using interfaces is mandatory here. For our Hello, World example, I’ve defined an interface and implementation class:

interface IHello
{
	int Count { get; set; }
	void SayHello(string name);
	string SayGoodbye(string name);
	void RaiseException(string name);
}

The actual implementation already makes use of SmartInspect to log various messages:

class Hello : IHello
{
	public int Count { get; set; }

	public void SayHello(string name)
	{
		SiAuto.Main.LogMessage("Hello, {0}.", name);
	}

	public string SayGoodbye(string name)
	{
		string msg = String.Format("Goodbye, {0}.", name);
		SiAuto.Main.LogMessage(msg);
		return msg;
	}

	public void RaiseException(string name)
	{
		SiAuto.Main.LogMessage("Hello, {0}.", name);
		throw new Exception("This is a test exception");
	}
}

Now to intercept and trace the method calls, we first need to make sure that we register and instantiate the interface and implementation with Unity. To do this, we use an instance of UnityContainer and add and configure the Interception extension. Here’s the full Main method of our example program:

static void Main(string[] args)
{
	// Enable SmartInspect logging
	SiAuto.Si.Enabled = true;

	// Create the Unity dependency injection container,
	// register the Interception extension and register our
	// our example class
	IUnityContainer container = new UnityContainer();
	container
		.AddNewExtension<Interception>()
		.RegisterType<IHello, Hello>();

	// Now tell Unity how to intercept IHello method calls
	container.Configure<Interception>()
		.SetInterceptorFor<IHello>(new TransparentProxyInterceptor());

	// Instead of creating our Hello class directly, we ask
	// Unity to resolve the dependency for the IHello interface
	IHello hello = container.Resolve<IHello>();

	// Call The IHello methods and assign property values
	hello.SayHello("World");
	hello.SayGoodbye("World");

	Random r = new Random();
	for (int i = 0; i < 10; i++)
	{
		hello.Count = r.Next(100);
		Thread.Sleep(1000);
	}

	hello.RaiseException("Hello World");
}

Now to actually use the the SmartInspect Unity extension and trace method calls, we just need to add a single attribute to the interface, namely the [SiMethodCall] attribute (which can be found in the SmartInspect.Extensions.Unity namespace):

[SiMethodCall]
interface IHello
{
	// [..]
}

The attributes come with various properties to influence the behavior of the log calls, such as changing the log level, adding name prefixes/suffixes and so on. For a complete list of properties just see the Intellisense help within Visual Studio. Once we launch the example application, we see the following output in the SmartInspect Console (also take a look at the viewer toolbox at the bottom right of the window, it shows the method arguments of the selected log entry):


Log messages and method tracing in the SmartInspect Console

Logging exceptions

Logging occurred exceptions is another useful thing you can automate with AOP. The SmartInspect Unity extension comes with its own attribute to log exceptions, namely the [SiException] attribute. The attribute doesn’t handle the exceptions (it just logs them) so it doesn’t change the behavior of your code. To use the attribute, just specify it for an interface or method like this:

[SiException(LogArgumentsToViewer = true)]
interface IHello
{
	// [..]
}

The resulting log messages in the SmartInspect Console look like this:


Logged exception in the SmartInspect Console

Watching property values

SmartInspect allows you to easily log and watch field and property values. The SmartInspect Unity extension comes with an attribute to automatically log changes of properties as they occur. To benefit from this, simply add the [SiWatch] attribute to the set method of your properties:

interface IHello
{
	int Count { get; [SiWatch]set; }
}

This blog posting is intended to give you an overview of the capabilities the SmartInspect Unity extension library provides, but it cannot explain all the useful options and features that the library comes with. So to get started with the library and learn about all its capabilities, I recommend downloading it and start playing with it.

Please also note that the SmartInspect Unity extension introduced here is not a Gurock Software product and is not official supported by us. To send feedback and to contribute to the project, please take a look at the CodePlex project page. Thanks Michael for writing the library and for contributing to the SmartInspect ecosystem!

Posted in Gurock Software, Programming, SmartInspect | Tagged | Leave a comment

Finding a great product name

“Around a year ago we desperately needed a name for the new test management software we had been working on. We aren’t very good with names. In fact, we used a codename for the project until the very last minute, so that we didn’t have to come up with the product name earlier. Still, even with many months to think about a name, it was difficult to find one that we liked.”

Read more in a guest posting I wrote for the Successful Software blog:
How to find a great software product name

Posted in Business, DelphiFeeds.com | 3 Comments

Announcing SmartInspect 3.3

We are happy to announce the release of SmartInspect 3.3, a new version of our logging tool for .NET, Java and Delphi applications. The new version introduces support for .NET 4.0 and Visual Studio 2010 and also comes with various other improvements.

.NET 4.0 and Visual Studio 2010 support

Microsoft released Visual Studio 2010 and .NET 4.0 earlier this week. SmartInspect 3.3 now introduces official support for this new version of .NET. To use SmartInspect in .NET 4.0 projects, just add a reference to our updated .NET 2.0 assembly (this assembly is compatible with all .NET versions from 2.0 onwards). We also updated the SmartInspect setup to integrate with the new Visual Studio release. All SmartInspect .NET sample projects also include Visual Studio 2010 project files now.

Display opened log file names

This enhancement has been requested by various SmartInspect users, so we are happy to finally display the opened log file name(s) in the SmartInspect Console. This feature looks easy to implement from the outside, but is a bit tricky as there can be multiple opened log files at once and there is no single way to ‘close’ a log file. SmartInspect will show the currently opened log file in the window’s title bar. If you open multiple log files, the Console will try to display as many log file names as space permits.

New Log Entry ID column

We added a new separate Log Entry ID column to the SmartInspect Console. This column shows a unique serial ID for each log entry, making it easy to find the same log entry in different views. It also comes in handy if you need to point other SmartInspect users to specific log entries in a log file.

TrackMethod & LogEnumerable (.NET only)

We are also introducing a new way to trace methods with SmartInspect’s .NET logging library. While our Delphi logging library had a similar functionality for some time now, TrackMethod now allows you to trace a method with just a single line of code. We use .NET’s dispose mechanism to automatically call LeaveMethod when a method exists. To use TrackMethod, just wrap it into a using statement like this:

class OrderProcessor
{
	public void Process()
	{
		using (SiAuto.Main.TrackMethod(this, "Process"))
		{
			SiAuto.Main.LogMessage("Some message");
		}
	}
}

Using TrackMethod has the same behavior as if you would wrap your methods with try..finally, ensuring that LeaveMethod is called even if an exception is raised.

Additionally, the new LogEnumerable in the SmartInspect .NET logging library makes it easy to log IEnumerable variables.

Getting the new version

Existing customers can download the new SmartInspect release from our customer portal. An updated trial version is available on our website. As usual, you can simply install the new version over your existing installation (there is no need to uninstall the previous version first). For a complete list of changes, please see the online help or our announcement forum.

Posted in DelphiFeeds.com, Gurock Software, SmartInspect | Leave a comment

Open source test management list

One thing that often comes up during discussions with customers about our test management software TestRail is that they appreciate the straightforward pricing structure. To understand this you need to know that most products in this category are so-called enterprise products: very expensive, with complex licensing structures and it’s
impossible to try out the software by just visiting the vendor’s website (“You want to test our product and download a trial? Sure, why not register here and one of our sales representatives will call you shortly!”).

Because many users are fed up with vendors that don’t even list the product prices on their website, they end up looking for open source tools that don’t require them to jump through dozens of hoops to learn more about the software. What a lot of users don’t know is that there are professional test management tools out there that are affordable, have readily-available trial versions and that can be purchased without discussing endless pricing options in conference calls.

open source test management

On the other hand, there are definitely cases where open source test management tools come in handy, be it for testing other free software products, in educational settings or if you have a very tight budget. To make it both easier for users to learn about all the available open source tools and to educate users about our test management tool as a possible alternative, we have created a new micro site in the same spirit as our .NET Logging and Java Logging sites.

So without further ado, welcome to our new Open Source Test Management micro site. We hope this site will be a useful reference to learn more about available open source tools and at the same time also help us get some publicity for our own product. If you have any suggestions about additional tools that should be listed on the site, just let us know! We of course also appreciate links to our new website if you find it useful.

Posted in General | Leave a comment

TestRail 1.2 released

We are happy to announce TestRail 1.2, a new version of our web-based test management tool. The new version comes with various smaller improvements such as the option to invite new users to TestRail and support for PHP 5.3 based environments.

We usually try not to release too many frequent updates of our products, as each new version results in some work for customers to install the new update (luckily, we never had to release a lot of ‘emergency’ bug fixes for our products in the past as we work hard to release solid builds only).

However, we wanted to get some product improvements (especially PHP 5.3 support) out of the door as quickly as possible and didn’t want to wait for the completion of the next major new feature of the TestRail roadmap.

You can check out a complete list of new features, improvements and bug fixes as well as more information on how to install this update in our support forum.

Posted in Gurock Software, TestRail | Leave a comment

Gurock Software gets a German website

Gurock Software is based in Germany, and although the company was founded almost six years ago, we never had a localized website. Our English website always did a great job connecting us with users and prospective customers, but we felt it’s time to expand and offer a separate localized site.

We won’t translate every page and every article available on our site, but we want to make it easier for users of local search engines to find our products. We will start with just a handful of translated pages and might add additional localized sites and pages in the future. So without further ado, welcome to Gurock.de.

Some of the translated pages include: .NET logging (SmartInspect), Testmanagement (TestRail).

Posted in Gurock Software | Leave a comment

Hosted TestRail trial now available

We just published a new feature to our website: a hosted trial version of TestRail. Instead of downloading the TestRail trial and installing it on your own server, you can now also request a hosted trial and we will automatically create a TestRail instance for you on our servers.

While TestRail is quite easy to install, it’s not always easy for customers to get the necessary resources for an installation in their organizations, so we want to help with this.

If you planned to take a look at TestRail but didn’t have the time or the resources to install it yet, make sure to request a hosted trial from our website.

Posted in Gurock Software, TestRail | 2 Comments

Announcing TestRail 1.1

We are happy to announce the release of TestRail 1.1, a new version of our web-based test management software. The new version comes with a complete permission and role system, introduces the new Blocked test status and comes with various other improvements, changes and bug fixes.

Roles and Permissions

TestRails new permission and role system allows you to restrict user permissions, hide projects from users and use fine-grained access control to customize TestRail according to your needs. TestRail’s new version comes with pre-configured standard roles such as Guest, Tester or Lead that you can assign to users. You can also customize the pre-configured roles or add completely new roles to TestRail.


Configuring the permissions of a role

Roles and user access can additionally be overridden on a per-project basis. This is especially useful if you want to assign individual permissions to users per project. But you can also use this functionality to hide projects from users, make entire projects read-only or to invite customers to access their projects in TestRail. The combination of TestRail’s user roles, project access settings and user-specific project access makes TestRail’s roles and permissions extremely flexible.


Changing a project’s access settings

Blocked Status

TestRail 1.1 introduces a new test status, namely Blocked. The Blocked status makes it easier for testers to highlight tests that currently cannot be validated. For example, if a test cannot be completed because the test data is not yet ready or because the tested feature is not included in the tested software build, the Blocked status can be used to highlight this. Once a blocked test is ready to be tested, it is recommended to change the status back to Retest (or directly enter a test result).

Customize overview pages

To make it easier to work with a lot of data (such as milestones, test runs or suites), the new version allows you to select one of three different views for TestRail’s overview pages. The new views display the data in a more compact way:

Getting the new version

Existing customers can download the new version from our customer portal. New users can download TestRail or request a hosted trial of TestRail from our website. To view the complete list of changes for TestRail 1.1, please see our announcement forum. Please refer to TestRail’s Admin Manual on how to upgrade an existing installation.

Posted in Gurock Software, TestRail | Leave a comment

Integrating TestRail with bug trackers

While it’s our goal to make TestRail the best test management tool out there, it’s not a substitute for a good bug tracker. That’s why we recommend using TestRail together with one of the many bug tracking tools available. To make it easier to work with your bug tracker, TestRail contains a feature to link test cases against bugs managed in a third-party application.

Over the past few days I have been gathering all the necessary details (such as URL formats) to link TestRail to some of the most popular bug trackers. Please see the list below on how to integrate TestRail with your existing tools:

If your favorite bug tracker is not listed, you can still integrate it into TestRail pretty easily (you will just need to know the view and add URLs of your tool). We are also working on publishing more integration guides, so please let us know which bug tracker you use.

Update: We have added two additional bug tracker and project management tools to our website, namely Gemini (from CounterSoft) and SourceGear Fortress:

Posted in Gurock Software, TestRail | Leave a comment