Wednesday, May 24, 2006

Tying Tests to Requirements

On my current project, we've got a large requirements document, with a lot of numbered requirements. We want to be sure that we've covered all the requirements in our automated test suite. Rather than going through by hand checking off tests against the list, we had the idea of marking each test with its corresponding requirements, in the code.

As we're working with Java 5, it seemed appropriate to do this using Java annotations. We created an annotation that can be applied to test methods, parameterised by the number.

Even better, we were able to use the annotation processing tool to run over our test code, and produce a report of which tests test which requirements, and which requirements are not covered by any of our test cases. When I add a test, I can quickly regenerate the report. I have a feeling this is going to be very useful.





<< Home

This page is powered by Blogger. Isn't yours?