Application Testing

These samples are for testing your code which uses the Turbine framework. We take care not to involve testing Turbine itself, but more how to exercise your application code. If you are looking for unit tests of the Turbine source code itself, this is the incorrect document. These are testing techniques for applications implemented with Turbine. The samples and techniques use various frameworks such as JUnit, HttpUnit, and Cactus. A Reference section is provided with links to more information about the frameworks and techniques used in the sample code.

This document is very much a work in progress as the sample tests are directly taken from our code we are currently developing. Hopefully this document will serve not only as a reference for starting to test your Turbine based applications, but a place to collect and document testing techniques the Turbine application developer may use.

Extreme Programming breaks testing into two parts, Developer Tests, and Customer Tests. This document contains tips for both kinds of tests. Each one is slightly different so some explanation will be helpful. This is a very short, high level description of the test types. More detailed information may be found in the reference section.

Developer Tests are unit tests written by the developers as the production code is written. Another practice of Extreme Programming is Test-First Coding, where the test is written, fails, then the code is written to make it pass. Developer Tests can be thought of as white-box testing. Inspection of the state of the code in the unit under test is important in this type of testing. All Developer Tests must be running at 100%, no failures, at all times. JUnit is the framework used for these tests described here.

Customer Tests are more like black-box tests. They test that the feature ( user story in XP-speak ) is functioning properly. This type of test could also be thought of as end-to-end testing or system testing. If your application has a feature to generate a pdf report, a Customer Test may be: Given inputs x and y, the pdf should look like z. We've generally used HttpUnit to simulate the user-agent accessing our web applications and verify its output.

Customer Testing

  • Sample: HttpUnit test case of a turbine application