July 12, 2006
Better, Stronger, Faster Integration TestingBetter, Stronger, Faster Integration Tests
Users don't use the software one object at a time. They don't deliberately try to break it. They just want to get their work done. But to do that work, a user typically has long, complex interactions with the software. It's these complex interactions that generate the "off-the-wall" bugs that always seem to catch the programmers off guard. It's common for a programmer to be surprised when he finds out how the user actually uses the software, and it's not uncommon for that use to differ significantly from what the programmer intended. That's why it's important to test the software in a way that gets all of its components interacting together. And that's the goal of this practice for integration testing.
This method of integration testing gets the programmers working together in a way that resembles a scaled-down version of a full test cycle. Before it starts, the team should be relatively confident that they have completed their programming, and that the code is ready to roll. This practice requires roughly a day of work for the entire team. To make sure that it only takes about a day (or two), every single developer should take part in this test. A larger team will expend more effort without needing more calendar time. Note that if the project is very large, it usually makes sense to break it into multiple chunks, and have a separate integration test at the end of each one. (A good rule of thumb for sizing each chunk is that if it seems like the integration tests will take far more than two days to do, then the project should probably be broken down further.)
Table 1 shows the steps involved in running the integration tests.
Table 1: Running a better, stronger, faster integration test.
The test is divided into two stages. The goal of the preparation stage is to create a packet of test cases for each team member. A typical test case includes these sections:
Table 2 is an example of a test case that would exercise one specific behavior in a word processing application. In this example, the programmers intended the word processor's search-and-replace feature to work in such a way that if the original text had been all lowercase, then the replacement text had to be inserted in all lowercase.
Table 2: Example of an integration test case
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|