Thursday, 22 December 2011

Some Testing


Optimism is an occupational hazard of programming. Feedback is the treatment.

Kent Beck

TDD seemed so revolutionary when it test infected Jakarta (and most of the rest of Apache). This test automation proved a notable factor in the later success of Tomcat, Struts, Ant, Maven, Commons (and all the rest).

Tests bridge the gap between the language of the customer and the languages of software. encourages alignment by starting with the customer then working inwards towards code.

Fine-grain unit tests execute fast, exercising a unit in isolation. Loosely coupled, cohesive designs are easier to unit test, so unit testing rewards good object-scale design.

Coarse-grain tests, exercising integrated components execute much more slowly, even with appropriate techniques (for example, switching to an in-memory store). Component-scale integration tests encourage cleaner, more reusable API designs.

The outermost layer exercises assembled applications. Fidelity to customer configuration is essential, and often means filling heavyweight stores with data. Set up and tear down costs are almost always high for enterprise applications.

Reasonable coverage using slow running integration and application layer tests costs. Avoid disrupting development flow: separate integration and application suites, and run them outside this flow. Consider triggering after each . To avoid maintenance issues, integration test selectively, invest in good fixtures and use the language of the customer.

A wide variety of open source tools continue to emerge, with sweet spots spanning the space. So spike.

Tools like and Fitness use the language of the customer, a fine match for outer (application and integration) layers. Mocking frameworks efficiently create test doubles to isolate the unit from its environment, and to efficiently verify behaviour (but not at the same time as state).

Efficient tools for special topics abound, for example web applications, load testing, performance testing, Swing, data access, JavaScript and so on...



Search This Blog