Test-driven Development
- Most famous example: Extreme Programming (XP)
- Programmer and customer agree on a vague set of requirements
- A set of test cases corresponding to the requirements are developed
- If the programmer devises these test cases, the customer must
agree that passing that set of test cases suffices
- The test cases are finished before programming begins!
- Every revision to the software requires re-running all the
test cases!
- Two types of test cases in this context
- Acceptance tests test the program as a whole
- Unit tests test a single class or method, and
are devised by the programmer for the programmer before writing
each class or method
- Benefits
- Completion of project is unambiguously defined
- Development of test cases is not procrastinated
- Drawbacks
- Test cases might not really capture the customer's intuition
properly
- This requires a lot of test cases; automating the testing
is critical (JUnit)
(next)