Growing Object-Oriented Software, Guided by Tests

Book description

Foreword by Kent Beck

"The authors of this book have led a revolution in the craft of programming by controlling the environment in which software grows.” --Ward Cunningham

“At last, a book suffused with code that exposes the deep symbiosis between TDD and OOD. This one's a keeper.” --Robert C. Martin

“If you want to be an expert in the state of the art in TDD, you need to understand the ideas in this book.”--Michael Feathers

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

Table of contents

  1. Title Page
  2. Copyright Page
  3. Contents
  4. Praise for Growing Object-Oriented Software, Guided by Tests
  5. Foreword
  6. Preface
  7. Acknowledgments
  8. About the Authors
  9. Part I. Introduction
    1. Chapter 1. What Is the Point of Test-Driven Development?
    2. Chapter 2. Test-Driven Development with Objects
    3. Chapter 3. An Introduction to the Tools
  10. Part II. The Process of Test-Driven Development
    1. Chapter 4. Kick-Starting the Test-Driven Cycle
    2. Chapter 5. Maintaining the Test-Driven Cycle
    3. Chapter 6. Object-Oriented Style
    4. Chapter 7. Achieving Object-Oriented Design
    5. Chapter 8. Building on Third-Party Code
  11. Part III. A Worked Example
    1. Chapter 9. Commissioning an Auction Sniper
    2. Chapter 10. The Walking Skeleton
    3. Chapter 11. Passing the First Test
    4. Chapter 12. Getting Ready to Bid
    5. Chapter 13. The Sniper Makes a Bid
    6. Chapter 14. The Sniper Wins the Auction
    7. Chapter 15. Towards a Real User Interface
    8. Chapter 16. Sniping for Multiple Items
    9. Chapter 17. Teasing Apart Main
    10. Chapter 18. Filling In the Details
    11. Chapter 19. Handling Failure
  12. Part IV. Sustainable Test-Driven Development
    1. Chapter 20. Listening to the Tests
    2. Chapter 21. Test Readability
    3. Chapter 22. Constructing Complex Test Data
    4. Chapter 23. Test Diagnostics
    5. Chapter 24. Test Flexibility
  13. Part V. Advanced Topics
    1. Chapter 25. Testing Persistence
    2. Chapter 26. Unit Testing and Threads
    3. Chapter 27. Testing Asynchronous Code
  14. Afterword. A Brief History of Mock Objects
  15. Appendix A. jMock2 Cheat Sheet
  16. Appendix B. Writing a Hamcrest Matcher
  17. Bibliography
  18. Index

Product information

  • Title: Growing Object-Oriented Software, Guided by Tests
  • Author(s):
  • Release date: October 2009
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780321503626