BizUnit 4.0 Overview

So it out, but what’s new?

Firstly, the big change is around the approach to defining test steps. Lets recap how that used to work. Originally, authoring of a test was done in XML, the format of which was a combination of the BizUnit test case format, with fragments of XML that conformed to the individual test step – essentially defining how each step should be configured. The XML based approach worked very well in that the XML could be easily modified or even generated. The downside was that each test step defined its own format and whilst all test steps broadly followed the same approach there was nothing enforcing it. The other problem was that sometimes its easier and faster to develop ‘coded test cases’.

BizUnit 3.0 introduced the notion of coded tests, using a custom serialisation technique, whilst it worked I was never completely happy with it and not all steps had the same level of support for coded tests. It also introduced the notion of code UI tests, this feature has been deprecated now however due to the great support that has now been added in VS 2010.

BizUnit 4.0 has adopted XAML as its serialisation format, which means that a test case may be serialised into a XAML file. This gives all the same benefits around the original version of BizUnit whereby modification and variation of test cases is very low cost, and similarly the XML format lends itself to generation techniques nicely. But because it’s XAML it also makes round-tripping between XML (XAML) and coded tests seamless. In other words I can create a new test case in code, save it to XAML, load the XAML and change it in code (or change it in XAML), execute it. I can execute XAML tests or coded tests in the same manner. From my experience using XAML as the serialisation format has the many other benefits

  • Enabling seamless round tripping of XML to code and back
  • Ensuring consistency for all test steps, sub steps, and data loaders
  • Simplifying the ability to import and reuse test cases
  • Simplified model for developing new test steps
  • Automatically generated documentation
  • Lowering the bar for tooling

If I want to work primarily in XAML but I’m not a hard code XAML guy it doesn’t matter in 4.0, I can simply create coded tests where I wish and save them to XAML, I can then copy/paste/edit them as appropriate to create new test cases. This was the technique that we used at Affinus with a pre-release version of BizUnit 4.0 for a large customer web service project that we delivered. For each use case we wrote a coded test, the test case was saved to XAML, and copied/edited to test around the boundaries of that use case. The approach gave us a high level of code coverage, whilst keeping the overhead of developing test cases low.

Some of the other new features in 4.0 include:

  • New base class for test steps – developing test steps is significantly simplified in 4.0 since the test step does not have to do any parsing of XML. Instead iit simply needs to implement the Execute and Validate methods and expose any public properties that it needs for its configuration
  • Similarly, there is a new base class for sub-steps. Previously these were specialised as either ValidationSteps or ContextLoaderSteps. Like test steps, sub-steps simply need to implement Execute and Validate and expose any public properties they require for configuration.
  • Data loaders, this is a new concept in 4.0. Data loaders allow the decoupling of the data that a test step or sub-step requires and the source of that data. Previously test steps would typically specify file locations for their input data, for example a web service step would specify where the location of the request body it was supposed to send could be found on disc. Whilst that works for many scenarios, often the payload needs to be changed, perhaps based on data previously processed by another test step. Data loaders enable this by de-coupling the step from the data source.
  • Importing test cases, again another new feature in 4.0, a test case may import another test case at a specific location.

Whilst not all of the test steps have been ported in 4.0, I’m hoping there are enough of the core steps to get people going, more will follow, but also given how easy it is to write a test step I’m guessing that won’t be an issue for people. Many of the legacy steps have also been included in this release, though all the interfaces and methods associated with the old format have been marked as deprecated.

Advertisements

~ by kevinsmi on March 22, 2011.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: