up previous next contents
Next: Best practices Up: JUnit Previous: A sample JUnit session   Contents

Recap

``Whoa ...that went fast ...how about a recap?'' No problem. Here's what we did:

  1. Write one test.
  2. Compile the test. It should fail (because you haven't implemented anything yet).
  3. Implement just enough to compile. (Refactor first if necessary.)
  4. Run the test and see it fail.
  5. Implement just enough to make the test pass.
  6. Run the test and see it pass.
  7. Refactor for clarity and "once and only once".
  8. Repeat from the top.

One of the great things to come out of the recent Extreme Programming movement has been to bring unit testing to the forefront of every developers thought process.


Next: Best practices Up: JUnit Previous: A sample JUnit session   Contents