Home > Store > Software Development & Management

larger cover

Add To My Wish List

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

  • By David Astels
  • Published Jul 2, 2003 by Prentice Hall. Part of the Coad Series series.
    • 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

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

  • Description
  • Extras
  • Reviews
  • Sample Content

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!

Customer Reviews

55 of 60 people found the following review helpful
2.0 out of 5 stars Falls short of its goal, April 17, 2004
By A Customer
This review is from: Test-Driven Development: A Practical Guide: A Practical Guide (Paperback)
This book is about Test-Driven Development (TDD). Its purpose is to help you write better code (by having more tests) and give you a head start with existing tools to achieve this.

The book falls short of these goals: The explanations about writing tests are short on advice and are sometimes misleading. The presentation of the tools is long, with little useful facts.

The book is organized into four parts: Background on TDD, refactoring and programming by intention; A look at JUnit and related tools used to write and run tests; A lengthy example of TDD; An overview of other tools in the xUnit family. The book is targeted at a Java audience but programmers using other languages should have little difficulties understanding the code.

I have a major problem with the background section. The author repeatedly claims that TDD provides exhaustive test coverage and ensures that you can refactor your code with confidence. Any error will be caught by the tests. This is foolish. First,... Read more

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


16 of 17 people found the following review helpful
5.0 out of 5 stars Great work covering TDD from the ground up to adv. topics, May 12, 2004
By 
dkroot (Washington, DC USA) - See all my reviews
This review is from: Test-Driven Development: A Practical Guide: A Practical Guide (Paperback)
(Disclaimer: I worked with the author on one large project).
Dave Astels' book is a comprehensive work covering TDD from the ground up to advanced topics. While most of the book examples use Java and JUnit, it does cover unit testing frameworks in several other languages as well. I've read two books on the topic (the other one is Kent Beck's "TDD By Example") and I liked Dave's book better. The basics of TDD can be explained in 10 minutes however when it is applied on practice it gets complicated in at least 3 areas: 1) testing UI 2) testing with database - data setup, isolation, etc. and 3) mocks. Kent's book is more about a philosophy of TDD but it only goes through a very simple "toy" example. Dave's book really helped me to understand mocks and it does cover UI testing in great length. Mocks are an advanced topic, so it does require a good knowledge of Java and OOP. The rest of the book seems to be on intermediate technical level.

The only thing this book is missing, I... Read more

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


15 of 16 people found the following review helpful
4.0 out of 5 stars A practical guide to test-driven development, August 6, 2003
This review is from: Test-Driven Development: A Practical Guide: A Practical Guide (Paperback)
Test-driven development (TDD) is one of the hot topics in the recent "agile revolution". Unfortunately, there aren't too many texts currently available that take an in-depth look at the subject. David Astels jumps into the fray with his new book, "Test-Driven Development: A Practical Guide", in order to help fill that void. Giving a nod to Kent Beck's "Test Driven Development By Example", Astels views his work as a complement to Beck's, focusing on the practical techniques and tools necessary to best make use of TDD.

The book first touches on some topics fundamental to TDD, such as refactoring, programming by intention, and of course the basic theory behind TDD. Appendices further flesh out this material by addressing extreme programming and agile modeling.

Although other members of the xUnit family are looked at, this book is squarely focused on JUnit and Java. As such, the text goes into detail about using JUnit, including the API, and how to go about the task of writing... Read more

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 15 customer reviews...

Online Sample Chapter

Test Driven Development: Programming by Intention

Table of Contents



Foreword.


Preface.

I. BACKGROUND.

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.

II. TOOLS AND TECHNIQUES.

4. JUNIT.

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.

5. JUNITEXTENSIONS.

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.

III. A JAVA PROJECT: TEST-DRIVEN END TO END.

9. THEPROJECT.

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.

IV. XUNIT FAMILY MEMBERS.

21. RUBYUNIT.

22. SUNIT.

23. CPPUNIT.

24. NUNIT.

25. PYUNIT.

26. VBUNIT.

V. APPENDICES.

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.

Bibliography.

Index.

Downloadable Sample Chapter

Untitled Document Download the Sample Chapter related to this title.

 
Add To Cart

Book  $59.99  $47.99

Usually ships in 24 hours.

This book includes free shipping!

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.