Home > Store

Test-Driven Development: A Practical Guide: A Practical Guide

Register your product to gain access to bonus material or receive a coupon.

Test-Driven Development: A Practical Guide: A Practical Guide


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2004
  • Dimensions: 7" x 9-1/4"
  • Pages: 592
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-101649-0
  • ISBN-13: 978-0-13-101649-1

Test-Driven Development: A Practical Guide

David R. Astels

Foreword by Ron Jeffries

  • The relentlessly practical TDD guide: real problems, real solutions, real code
  • Includes a start-to-finish project written in Java and using JUnit
  • Introduces TDD frameworks for C++, C#/.NET, Python, VB6, and more
  • For every developer and project manager interested test-driven development

Make Test-Driven Development work for you!

Test-Driven Development: A Practical Guide enables developers to write software that's simpler, leaner, more reliable... just plain better.

Now, there's a TDD guide focused on real projects, real developers, real implementation challenges, and real code.

Renowned agile development expert Dave Astels shows TDD at work in a start-to-finish project written in Java and using the JUnit testing framework. You'll learn how "test first" works, why it works, what obstacles you'll encounter, and how to transform TDD's promise into reality.

  • o Relentlessly practical! Full of downloadable code examples, hands-on exercises, and a fully hyperlinked version of the "resources" appendix
  • o Introduces powerful TDD tools and techniques--including key JUnit extensions, presented by their creators (Scott Ambler, Tim Bacon, Mike Bowler, Mike Clark, Bryan Dollery, James Newkirk, Bob Payne, Kay Pentacost, and Jens Uwe Pipka)
  • o Covers refactoring, "programming by intention," mock objects, and much more
  • o Discusses TDD frameworks for C++, C#/.NET, Python, VB6, Ruby, and Smalltalk
  • o Introduces previously unpublished test-first techniques for GUI software
  • o Contains appendices introducing eXtreme Programming and Agile Modeling
  • o For all programmers and project managers

Read this book if you're ready to write code that's clearer, more robust, and easier to extend & maintain--in short, if you're ready to write better code!

Sample Content

Online Sample Chapter

Test Driven Development: Programming by Intention

Downloadable Sample Chapter

Untitled Document Download the Sample Chapter related to this title.

Table of Contents




1. Test-Driven Development.

What Is Test-Driven Development? Let the Computer Tell You. A Quick Example. Summary.

2. Refactoring.

What Is Refactoring? When to Refactor. How to Refactor. Some Important Refactorings. Refactoring to Patterns. Summary.

3. Programming By Intention.

Names. Simplicity. Warranted Assumptions. How to Program by Intention. “No Comment”. Summary.



Architectural Overview. The Assertions. Writing a TestCase. Running Your Tests. Using setUp() and tearDown(). Using TestSuite. How Does It All Fit Together? Where Do Tests Belong? Tips. Summary.


Standard Extensions. Adding Missing Asserts with MockObjects. Performance and Scalability with JUnitPerf. Daedalos JUnit Extensions. Writing XML-Based Tests with xmlUnit. Gargoyle Software JUnit Extensions.

6. JUNIT-Related Tools.

Jester. NoUnit. Clover. Eclipse. IDEA.

7. MockObjects.

Mock Objects. An Illustrative Example. Uses for Mock Objects. Wouldn't It Be Nice? A Common Example. The MockObjects Framework. MockMaker. EasyMock. Summary.

8. Developing a GUI Test-First.

The Example. The AWT Robot. Brute Force. JFCUnit. Jemmy. Ultra-Thin GUI. Summary.



Overview. User Stories and Tasks.

10. Movie List.

Make a Movie Container. Make a Movie List GUI. Add a Movie in the GUI. Retrospective.

11. Movies Can Be Renamed.

Support Movie Name Editing. Movie Rename GUI. Retrospective.

12. Movies Are Unique.

Movies Are Unique. Error Message on Non-Uniqueness. Retrospective.

13. Ratings.

Add a Single Rating to Movie. Show the Rating in the GUI. Edit the Rating. Retrospective.

14. Categories.

Add a Category. Show the Category in the GUI. Add a Selection of Category. Retrospective.

15. Filter On Category.

Get a Sublist Based on Category. Support an ALL category. Add a Category Selector to the GUI. Handle Changing a Movie's Category. Interface Cleanup. Retrospective.

16. Persistence.

Write to a Flat File. Save-As in GUI. Save in GUI. Read from a Flat File. Load in GUI. Retrospective.

17. Sorting.

Compare Movies. Sort a MovieList. Ask a MovieListEditor for Sorted Lists. Add a Way to Sort to the GUI. Retrospective.

18. Multiple Ratings.

Multiple Ratings. Rating Source. Revised Persistence. Show Multiple Ratings in the GUI. Add a Rating in the GUI. Remove the Single-Rating Field. Retrospective.

19. Reviews.

Add a Review to Ratings. Save Review. Load Review. Display Review. Add a Review. Retrospective.

20. Project Retrospective.

The Design. Test vs Application. Test Quality. Our Use of Mocks. General Comments. Debugging. List of Tests. Summary.


22. SUNIT.
24. NUNIT.


Appendix A: Extreme Programming.

The Agile Revolution. eXtreme Programming. The Four Variables. The Values. The Practices. Summary.

Appendix B: Agilemodeling.

The Myths Surrounding Modeling. An Introduction to Agile Modeling (AM). What Are Agile Models?

Appendix C: Online Resources.

Forums. Information on Agile Processes. Information on Extreme Programming. JUnit-Related Software. JUnit-Related Information. Tools. Other XUnit Family Members. Companies. Miscellaneous.

Appendix D: Answers To Exercises.




Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership