Wednesday, November 01, 2006

Writing tests in development

I recall on a number of previous projects that there was always some confusion around the type of tests that were written in development; that is, unit tests, integration tests, component tests, system tests, etc.. Of interest, then, I recently read this article from IBM developer works (a truly interesting RSS feed for those in Java software engineering).

Basically, it states that tests need to be categorised into:

  1. unit tests: single-class driven tests; isolating a piece of functionality (hopefully only one public interface per class!)
  2. component tests: multiple-class driven tests; often including core pieces of logic and functionality
  3. system tests: end-to-end testing; high-level, arbitrary logic executed; does the application work?
Importantly, it defines that the time taken for each category will increase significantly and therefore there should be multiple build / test loops with their own individual reports. So the unit testing which is used everyday is not corrupted by the component testing (e.g. driven by test defects) or system testing (e.g. driven by releases).

No comments: