Join Books.org — it's free

Programming Methodology, Quality Control & Testing - Programming, General Software Engineering
Test Driven Development: By Example by Kent Beck — book cover

Test Driven Development: By Example

by Kent Beck
Available on Bookshop Write a review

Books.org participates in affiliate programs including Bookshop.org and the Amazon Services LLC Associates Program. We may earn a commission from qualifying purchases made through links on this page, at no additional cost to you.

Log in to track your reading progress.

Overview

Clean code that works--now. This is the seeming contradiction that lies behind much of the pain of programming. Test-driven development replies to this contradiction with a paradox--test the program before you write it.

A new idea? Not at all. Since the dawn of computing, programmers have been specifying the inputs and outputs before programming precisely. Test-driven development takes this age-old idea, mixes it with modern languages and programming environments, and cooks up a tasty stew guaranteed to satisfy your appetite for clean code that works--now.

Developers face complex programming challenges every day, yet they are not always readily prepared to determine the best solution. More often than not, such difficult projects generate a great deal of stress and bad code. To garner the strength and courage needed to surmount seemingly Herculean tasks, programmers should look to test-driven development (TDD), a proven set of techniques that encourage simple designs and test suites that inspire confidence.

By driving development with automated tests and then eliminating duplication, any developer can write reliable, bug-free code no matter what its level of complexity. Moreover, TDD encourages programmers to learn quickly, communicate more clearly, and seek out constructive feedback.

Readers will learn to:

  • Solve complicated tasks, beginning with the simple and proceeding to the more complex.
  • Write automated tests before coding.
  • Grow a design organically by refactoring to add design decisions one at a time.
  • Create tests for more complicated logic, including reflection and exceptions.
  • Use patterns to decide what tests to write.
  • Create tests using xUnit, the architecture at the heart of many programmer-oriented testing tools.

This book follows two TDD projects from start to finish, illustrating techniques programmers can use to easily and dramatically increase the quality of their work. The examples are followed by references to the featured TDD patterns and refactorings. With its emphasis on agile methods and fast development strategies, Test-Driven Development is sure to inspire readers to embrace these under-utilized but powerful techniques.

0321146530B10172002

Synopsis

Presents an approach to writing software that emphasizes automated testing before and during coding. Written for advanced programmers, the book walks through two example projects—multi-currency arithmetic and the xUnit testing framework—and provides patterns for deciding what tests to write and how to write tests using xUnit. The code is written in Java and Python. Annotation c. Book News, Inc., Portland, OR

About the Author, Kent Beck

Kent Beck consistently challenges software engineering dogma, promoting ideas like patterns, test-driven development, and Extreme Programming. Currently affiliated with Three Rivers Institute and Agitar Software, he is the author of many Addison-Wesley titles.

Reviews

There are no reviews yet. Log in to write one.

Editorials

From Barnes & Noble

The Barnes & Noble Review
Every developer wants to write clean code that works -- but somehow, forces always seem to conspire to prevent that. Kent Beck has spent a career on the problem of improving software development: you probably know him best for inventing Extreme Programming (XP).

XP relies heavily on incremental testing. But this often slips up implementers, for whom constant testing represents a radical change. In Test-Driven Development, Beck brings testing to life, showing exactly how to use it to close the gap between decisions and feedback.

“TDD” has only two rules. No. 1: Write new code only if you first have a failing automated test. No. 2: Refactor constantly to eliminate duplication. But these rules have complex and subtle implications. You must “design organically,” making decisions based on whether your code passes its test. You must organize your development environment so this is possible. You must write your own tests: you can’t wait for specialists. And your designs must consist of highly cohesive, loosely coupled components: otherwise, micro-scale testing is simply impossible.

If this still sounds difficult at best, Beck demonstrates TDD through a book-length case study. Its “in-practice” workings will surprise you -- and, we think, convince you. Bill Camarda

Bill Camarda is a consultant, writer, and web/multimedia content developer. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.

Book Details

Published
November 1, 2002
Publisher
Addison-Wesley
Pages
220
Format
Paperback
ISBN
9780321146533

More by Kent Beck

Similar books