Next: Unit Testing with JUnit
Up: Unit Testing 101
Previous: What should I test?
Contents
Index
So here begins the philosophy of ``working backwards'' ...
Shown below is a very practical algorithm to help you understand how you should apply Unit Testing4.1
- Write one test.
- Compile the test. It should fail (because you haven't implemented anything yet).
- Implement just enough to compile. (Refactor first if necessary.)
- Run the test and see it fail.
- Implement just enough to make the test pass.
- Run the test and see it pass.
- Refactor for clarity and "once and only once".
- Repeat from the top.
Next: Unit Testing with JUnit
Up: Unit Testing 101
Previous: What should I test?
Contents
Index