Testing Bit by Bit
There's a full example on this in Test First, by Intention. Check that out for some detailed ideas. Here we'll just give you the basics, and we'll assume that you're using a testing framework like xUnit, our favorite testing tool.
OK, you have decided you need a class to hold a collection of completed tax returns. It has to be able to give back a collection of all the returns whose "score" is larger than a user-supplied number, and it has to be able to remove all the returns whose score is less than some other number. It should be able to accept the addition of new forms. This class, of course, will be driven by the tax auditor's GUI that Bill is working on with his partner, and it will use the return scoring capability that ...
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.