At Agile Testing Days in Berlin this week, Mary Poppendieck presented her definition of test-driven development and talked about the right reasons for testing in software projects.
According to Poppendieck, Test-driven development can be summarised as:
- The system should always be able to determine correctness of itself, in detail [from a business and from a technical perspective]
- Test for correctness very frequently, in small batches
- Roll up testing to the next level as early and often as practical [my understanding of this is to automate things discovered by exploratory tests and move tests earlier into the process as much as possible]
- Stop if the tests don't pass. fix the problem immediately
The system should be able to test itself and ideally have no defects, but in reality some defects are still going to escape through the process. Poppendieck said that that “the biggest defect we have now [in software development] is tolerating defects”. She advised treating each failure (defect that escaped) as a learning opportunity. Determining the root cause of the failure and eliminating it so that the defect does not reappear in the future is the way forward.
She also talked about the purpose of testing (as opposed to checking the correctness using known expectations), saying that we teams should be testing to learn, not to find defects. Effective testing is, according to Poppendieck, aimed to seek knowledge. Testing starts with a hypothesis of the results. “If you can’t predict the results of a test, you don’t understand the system.”, said she, giving an example how Boeing engineers test airplane wings. They make a premise when the wing is going to break and how and then they break it, measuring how that matched the expectations.