Linking your Tests to External References

Often, functional tests are written closely in conjunction with external documents. For example, it is common to build tests to match corresponding items in a requirements specification, or to build tests based on entries in an issue or bug tracking system. Badboy calls such external entities References and offers features to let you define, track and view the associations between tests and external references within Badboy. This allows, you to know, for example, when a test fails, which requirements, bugs or features are impacted by the failing test. Creating or importing references first can also be a very practical way to create tests, as you can then use them to drive which tests you create and ensure complete coverage by checking the mapping of references to tests is complete.

Creating and Deleting References

There are two ways to create References within Badboy: manually or by importing them from another source. Manual creation is performed from the References View which is usually found as a tab in the bottom left corner of the Badboy frame window. You can click the 'New' button to create a new reference, as shown below:

When the button is clicked, Badboy shows a window to let you enter details about the reference:

There are three fields you can specify:
  • Id is a unique identifier for the reference. Usually this will correspond to an identifier from an external system such as a Job Number, Bug ID or similar. However Badboy does not enforce any particular format or constraint on these Ids, so you can use whatever you like here. Making it unique will assist in certain situations, so it is useful, but not mandatory to ensure that no two entries have the same Id.
  • Title / Description is a textual description of the reference. This can be any text you like and once again, Badboy does not enforce any constraint.
  • Type is a category for the reference. This allows you to group similar categories of reference such as all bugs or all requirements. Although Badboy suggest the values 'Requirement' or 'Defect', you can actually enter any category you like (eg: BUG).

References can be deleted simply by selecting them in the References View and then pressing the 'Del' key. This removes the reference and unmaps it from any Tests that are mapped to that reference.

Importing References

Adding references manually to your script can be very tedious and time consuming. To avoid this work Badboy supports features to let you import references from external systems. To support interacting with external systems for managing references, Badboy uses the concept of a 'Reference Provider'. Two reference providers are provided in the stock Badboy install: Microsoft Word (tm) Reference Provider and an Open Office Reference Provider. These two providers both allow you to import headings from word processor documents. So, for example, if you have a .doc file that has all your requirements and they are numbered using Word Headings, Badboy will import them all using the heading numbers from the Word document.

If you want, you can easily write your own reference importer. References can be added using some simple Javascript, allowing you to import references from any source into your script by writing a Javascript routine to read them from the source and add them to Badboy. Here is an example snippet that shows how to add a reference to Badboy using Javascript:

badboy.script.References.add("12345", "BUG", "The web site does not work");

Mapping References to Tests

To benefit from defining or importing References in Badboy you must map them to tests. Any number of References may be mapped to a test and any given Reference may be mapped to any number of tests. Mapping can be performed in two different ways:

  • Select any number of references in the References View and then click with the mouse and drag them into the script tree and drop them on the Test that you would like them to be mapped to.
  • You can also map References to tests by opening the Test properties dialog and selecting references in the drop down box and clicking 'Add'.

Once a reference has been mapped to at least one Test, a tick appears next to it in the Reference View:

Viewing Reference Information

Once you have mapped one or more References to a Test you will see the Reference information displayed in the Summary display for the test:


Badboy Documentation Generated on Thu Dec 31 12:56:46 EST 2009