Testing as a design activity
5 stars
Great wisdom from the inventors of mock objects.
358 pages
English language
Published Oct. 21, 2009
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 …
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
Great wisdom from the inventors of mock objects.
A must read for anyone willing to learn and understand how to write concise and maintainable tests, and how to grow a code base in an object oriented fashion. The techniques and principles shown in this book are pure gold: walking skeleton, depth of testing, async code testing, data test builders, mocking, single responsibility, only mock classes you own, hexagonal architecture, etc. If you're still in the fence about the advantages of TDD, this is for you. It displays how quick it is to add new features and make changes with the confidence that you aren't breaking other parts of the system.
However, the only reason I won't rate it a 5 star is that this book study case, which is great if you persevere through its setup and try it out yourself, takes time to understand the techniques they are using. If you try the code it won't compile …
A must read for anyone willing to learn and understand how to write concise and maintainable tests, and how to grow a code base in an object oriented fashion. The techniques and principles shown in this book are pure gold: walking skeleton, depth of testing, async code testing, data test builders, mocking, single responsibility, only mock classes you own, hexagonal architecture, etc. If you're still in the fence about the advantages of TDD, this is for you. It displays how quick it is to add new features and make changes with the confidence that you aren't breaking other parts of the system.
However, the only reason I won't rate it a 5 star is that this book study case, which is great if you persevere through its setup and try it out yourself, takes time to understand the techniques they are using. If you try the code it won't compile sometimes, there will be missing code and setting up the server is tricky (you can checkout my GitHub project which have a README to help you out on this github.com/vrcca/auction-sniper). Nevertheless, I must say that writing it myself helped a lot! It's way easier to understand the project navigating the code through an IDE than a book.
To sum up, this is an amazing book for the beginner and the experienced. It may take some time and TDD experience to swallow it, but it's totally worth it.