Test-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
- Implementing TDD effectively: getting started, and maintaining your momentum throughout the project
- Creating cleaner, more expressive, more sustainable code
- Using tests to stay relentlessly focused on sustaining quality
- Understanding how TDD, Mock Objects, and Object-Oriented Design come together in the context of a real software development project
- Using Mock Objects to guide object-oriented designs
- Succeeding where TDD is difficult: managing complex test data, and testing persistence and concurrency
Summary Mock Objects is an approach to Test-Driven Development that changes the way programmers think about code. It encourages them to think about how objects interact with each other, rather than just how they work in isolation - as the founders of Object Oriented programming intended. Objects should be defined in terms of what they do, not what they are. Using Mock Objects with Test-Driven Development guides developers towards code with clearly focused objects and an emphasis on behavior over data - both features of good Object Oriented programming. This book has been written by two of the originators of the concept, who have developed and refined their understanding over years of practice on real projects. The book describes the basic concepts and shows how they fit into the development cycle. It also addresses the common misunderstandings and pitfalls that they have encountered. Author(s) Expertise Steve Freeman (UK) is a consultant with ThoughtWorks and has been involved in the XP community since before there were books. He has a PhD in Computer Science and degrees in Statistics and Music, and was one of the authors of the first Mock Object paper.Nat Pryce (UK) is an independent consultant with expertise in software design, software development process and practices.
He is also a research fellow at Imperial College. Nat is a developer of the jMock and nMock libraries for testdriven development. Audience This book is intended for people who are directly concerned with the writing of code: developers at various levels, technical leaders, development managers. They are expected to have experience with an OO language such as C# or Java. The CD/DVD/Web Site http://www.mockobjects.com/