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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access