Summary of Testing Steps

Here, in a nutshell, is a sketch of unit testing the XP way:

  1. Create a test class. Name it in such a way as to evoke the class or process you will be testing. If you are testing the Scrutinizer class, call the test class ScrutinizerTestCase.

  2. Code a setup method to create a Scrutinizer object. You may find the need to add example creation methods to the tested class to aid in the setup. Be sure to test this code, as an error in this type of code can be very difficult to debug later.

  3. Write a test. If your new behavior will change the state of the Scrutinizer instance, code an assertion to verify its current state. Then send the message for your new behavior to the Scrutinizer instance. If you don't know the message selector, ...

Get Extreme Programming Installed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.