Growing Object-Oriented Software, Guided by TestsTest-Driven Development (TDD) is now an established technique for delivering better software faster. TDD is based on a simple idea: Write tests for your code before you write the code itself. However, this "simple" idea takes skill and judgment to do well. Now there's a practical guide to TDD that takes you beyond the basic concepts. Drawing on a decade of experience building real-world systems, two TDD pioneers show how to let tests guide your development and “grow” software that is coherent, reliable, and maintainable.
Steve Freeman and Nat Pryce describe the processes they use, the design principles they strive to achieve, and some of the tools that help them get the job done. Through an extended worked example, you’ll learn how TDD works at multiple levels, using tests to drive the features and the object-oriented structure of the code, and using Mock Objects to discover and then describe relationships between objects. Along the way, the book systematically addresses challenges that development teams encounter with TDD—from integrating TDD into your processes to testing your most difficult features. Coverage includes
|
Contents
Maintaining the TestDriven Cycle | |
ObjectOriented Style | |
Achieving ObjectOriented Design | |
Sniping for Multiple Items | |
Teasing Apart Main | |
Filling In the Details | |
Handling Failure | |
Sustainable TestDriven Development | |
Test Readability | |
Constructing Complex Test Data | |
Test Diagnostics | |
Building on ThirdParty Code | |
Commissioning an Auction Sniper | |
The Walking Skeleton | |
Passing the First Test | |
Getting Ready to | |
The Sniper Makes a | |
The Sniper Wins the Auction | |
Towards a Real User Interface | |
Test Flexibility | |
Advanced Topics | |
Unit Testing and Threads | |
Testing Asynchronous Code | |
Writing a Hamcrest Matcher | |