Test Driven Development: By Example (Addison-Wesley Signature Series) Reviews



Amazon.com Customer Reviews

Very inspiring - Review written on July 31, 2007
* * * * *
Rating: 5 out of 5
1 customer found this review not to be helpful.
This is the most inpiring and thought-provocing book on programming that I have read for many years. Very well-written, short, fun. Whatever language you are programming in, you will find it useful.
Niels Holst, Aarhus University.
Almost perfect! - Review written on June 10, 2007
* * * *
Rating: 4 out of 5
1 customer found this review helpful, 1 did not.

I really like this book and it helps me a lot when I was developing a prototype of a complex application.

The idea of using tests to force you to think about the APIs is powerfull and the use of Python to implement a xUnit framework is very interesting.

But if you are a experienced developer you will find the first part of the book very boring because Kent uses extremely small steps to develop their example.
Finesse and humor - Review written on May 15, 2007
* * * * *
Rating: 5 out of 5
1 customer found this review not to be helpful.
While I have only read half of this book, what I have read has been extraordinarily useful.

Years ago I attempted TDD with mixed success. It was very interesting and I liked having the enforcement of quality control but found it cumbersome. This book, however, has removed my reservations about TDD. Regardless of how simple the concept of TDD, its practice takes some finesse, which this book helps to provide.

The examples are quite effective at demonstrating where the traps are and how to avoid them. His appendix also includes a very simple example that is a simple explanation to give a taste to someone who is considering the technique.

The examples show not only how to do things correctly but also how to recover when you make a mistake. This practice provides both information about recovery and why certain practices are good, such as only writing new code when there is a single red light and only improving code when all the lights are green.

Finally, the book was very enjoyable. Kent uses a humorous, self-effacing style that illustrates thought processes, both "good" and "bad". It kept me completely engaged for the first eight chapters or so (before life interrupted my enjoyment of the book). It does tend to get more technical after that but I just see that as speaking to all levels of TDD practitioners - beginners to experts.

If you are thinking about using TDD, this book will convince you.
Must read, but with a serious flaw. - Review written on November 06, 2006
* * * *
Rating: 4 out of 5
1 customer found this review helpful.

This is a short, detailed, easy-to-follow introduction to TDD. Nothing on the market is a better first book on the subject. This book will be only your first step on a long journey; you'll probably have to read more, or take some course(s), or work with an experienced TDD practitioner, to apply TDD to read world projects.

But there's a zeroth step Kent Beck could have given a lot more help with. You can't use TDD on a medium-to-large sized project without getting approval from the project's leaders. They might well ask, "Exactly what is the primary benefit from using TDD?" Does it directly increase project velocity (i.e., get the software out the door faster)? Does it improve the quality of software developed with it? This book doesn't answer that question. (It tells you how much TDD supports refactoring, but that leads back to the same question.)

Don't get me wrong. I think TDD is very helpful. I just couldn't convince management of that, based on this book.

Read this, but look elsewhere for justification on using TDD.
Intentionally slow-paced; this is a book on fundamentals - Review written on March 28, 2006
* * * *
Rating: 4 out of 5
8 customers found this review helpful.

Many other reviewers have, with some justification, bemoaned the crunchingly slow pace of this book. Yes, the book moves through its examples slowly. Yes, sometimes Beck's mock humility comes off more than a little snide. It's not perfect on those counts, but please keep in mind that this is a book about a _process_, not a _result_.

The first example takes up almost half the book just to go through a pretty minimal implementation of a multi-currency representation for money. If this were a book about how to implement money representations, it would be a dismal failure. But of course, that's not the point at all -- the point is to use an example that's simple (so as not to be distracting), but just complex enough to produce adequate talking points to drive a discussion about test-driven development (TDD).

TDD is incredibly important, surprisingly late in arriving as a TLA unto itself, and Beck certainly gets points (cf. the review about "90% is just showing up") for producing a good straightforward introduction that's sorely needed. Nobody's going to come away from this book feeling filled to the brim with facts and sophisticated techniques. It's a short book (around 200 pages), and its pace is unhurried. What it does is focus on _fundamentals_.

TDD is all about buyin -- once you "get religion" and become "test-infected" (per Gamma), you've got a solid basis to grow from. It's about habits, and habits can be hard to teach. What's obvious to one person is mysterious to the next. Beck's approach of "sit here with me and listen to my thoughts on a simple, representative problem" is perfectly adequate. It concedes (repeatedly) that some of the steps are obvious, but the pages quickly and one never feels truly bogged down. He's really just teaching a handful of concepts throughout the whole book. You could write the concepts in a single paragraph; that's how much real, critical information is here. But it's _really good information_, and sometimes the key to grasping a fundamentally new (to you) viewpoint or idea is just hearing it rephrased for the 101st time, this time in words your brain is prepared to listen to.

So... it's a quick read, maybe a little pricey on that count. I'd say buy it anyway, and recoup the investment by loaning it to others on your team.

TDD is an incredibly beneficial infection; it's worth exposing yourself to a plainspoken explanation like this. You'll probably know within 50 pages whether you agree.
Great topic, but less filling - Review written on November 18, 2005
*
Rating: 1 out of 5
29 customers found this review helpful, 13 did not.

Non-coders will have problems with this book because Test Driven Development is about the process of development. Specifically, this book expounds, in fine detail, the XP concept of writing tests before the implementation and how to use the results from the tests to drive another XP concept: emergent design.

This book is excellent for any developer who wants to use the concepts of writing tests first along with emergent design and has absolutely no clue where to begin. In my 12-year development career, I have met three people falling into this category. Few competent developers can comprehend emergent design along with test first and not know where to begin.

Read the following sample passage from the book: "This probably sounds a bit like magic. How do we know to think of creating an imposter here? I won't kid you - there is no formula for flashes of design insight. Ward Cunningham came up with the 'trick' a decade ago, and I haven't seen it independently duplicated yet, so it must be a pretty neat trick." While reading the book, I often wished Kent Beck was sitting beside me. I wanted to hit Mr. Beck on the head with my book for each tedious chatty interlude of which, there are several per chapter.

Combined with the noisy chatter is a tediously slow pace. Reading the book, is like standing behind a programmer who is a perfectionist. You admire what they are doing and appreciate its elegance, but you realize this person is going to produce nothing useful anytime soon.
Step by step introduction to Test Driven Development - Review written on September 18, 2005
* * * *
Rating: 4 out of 5
4 customers found this review helpful, 3 did not.

I liked the step by step approach of this book, because it profoundly demonstrates how TDD looks and feels. No endless pages of theories and theorems, but a real-world example end-to-end.
Eye opening - Review written on January 23, 2005
* * * *
Rating: 4 out of 5
5 customers found this review helpful, 1 did not.

I had been curious about test driven development (TDD) for quite a while before I read this book. After reading it and seeing the results in my code and in the overall design of my projects, I was amazed that a set of techniques could improve quality by so much.

TDD development involves a totaly different mind set than traditional coding and requires some personal dicipline until the habits kick in. Thankfully, the author doesn't spend a lot of time convincing the reader how great this "newest fad" is but focuses on using TDD realisticly in your current practices. The results are well worth it.

The text mostly assumes you have access to one of the xUnit testing frameworks but at the end there is a whole section on developing your own testing framework. I was really puzzled at first as to why the author would include this section. The obvious answer is that perhaps there isn't a testing framework in your current development environment. After further thought I realized that TDD is a mindset. For instance I have intermittently used assertions and although TDD focuses on external testing of functons, I could use assertions to test assumptions about parameters passed into functions. Although the assertions wouldn't be as robust as the unit tests they would add to the overall quality. I don' know if I would have made that connection before.

This is one of the more valuable books I have read.
Enjoyable book about an approach that's more than worthwhile - Review written on December 10, 2004
* * * * *
Rating: 5 out of 5
2 customers found this review helpful, 2 did not.

This is a short and fast read. You regret it that the book is already finished.

This is one of the few books where you read about the authors' misconceptions and mistakes - not about the glorious final elegant solution at the end. Usually this is pretty annoying, not with this author (and also not with Martin Fowler). It is pure enjoyment to be taken along the intellectual journeys of writing a program with Kent Beck.

So read it and have fun.
From a Software Tester's Perspective - Review written on April 06, 2004
* * * * *
Rating: 5 out of 5
21 customers found this review helpful, 4 did not.

I enjoyed reading this book, however I must advise that non-coders will probably have difficulty in staying with it. I don't mean that as a put-down of any kind. It's obvious that the intended audience is the developer who is trying to understand the concept of test-driven development. A tester, however, would learn in this book that test-driven development uses tests that are different in nature and rigor than those commonly thought of as "unit tests."

I think Beck does a good job in explaining test-driven development in a way that is easy to understand. I still have some concerns about the nature of test-driven development, such as the emphasis on function over design. But I think Beck achieved a reasonable goal of presenting by example what test-driven development is all about.

The goal of test-driven development is a reasonable way to achieve "clean code that works - now." As a tester, I think the awareness of test-driven development is a good thing. I also think that this technique must be combined with other methods, such as getting quality requirements, verification and validation, to achieve a final result that meets the users' needs.

Readability - 4
Coverage of topics - 5
Depth of coverage - 5
Credibility - 5
Accuracy - 5
Relevance to software quality - 5
Overall - 5

A decent introduciton - Review written on March 12, 2004
* * *
Rating: 3 out of 5
22 customers found this review helpful, 4 did not.

This Kent Beck title is an introduction to the world of Test-Driven Development (TDD). The book teaches the concepts of TDD by working through two complete sample projects. Along the way, Beck gives the reader valuable insight into the thought process and techniques behind successful test-driven development. When the reader has finished working through these sample projects, he should know enough about TDD to get started working on a TDD project.

The book is divided into three sections. The first two sections are each walkthroughs of the aforementioned sample projects using TDD. The third section is a collection of notes and useful tips to try to get the most out of TDD. If you've ever read anything from Beck, then you should be familiar with his style. If you haven't, Beck is an engaging enough writer, and the text flows smoothly and is fairly pleasant to read.

It would help to be familiar with some member of the xUnit family prior to reading this book. Beck uses Java and JUnit for the first section, but never really goes into discussing the JUnit API. Readers unfamiliar with xUnit may have no idea how to proceed with writing their own tests using one of these frameworks. True the API is simple enough that its functions may be ascertained simply by reading the code, but this is no reason not to provide explanation. The second sample project is an actual implementation of xUnit, so a bit more information may be gleaned here. Beck made the curious decision to use Python as the language of implementation for the second project, although he does provide explanation of the language's fundamentals. Finally, none of the sample projects are really complicated enough to do more than get us going on the path of TDD. There will still be many hurdles to climb when working on a real-world project.

If you are seeking a basic introduction to test-driven development, then you might enjoy this title. If you are a Java developer interested in exploring TDD more in-depth, there are better books out there.

Should you buy it? Yes! - Review written on January 18, 2004
* * * * *
Rating: 5 out of 5
2 customers found this review helpful, 10 did not.

This book does a remarkable job of covering the philosophy behind good unit tests and frequent automated builds. The author is very forward thinking in the ideas presented.

If you want to get up to speed quickly then buy this book.

Good introduction, but light on real-world development - Review written on November 28, 2003
* * * *
Rating: 4 out of 5
21 customers found this review helpful, 1 did not.

If you've never done or are curious about TDD, this is a great book to carefully walk you through learning how and why to do it. After following its practices a bit, I've also found it an indispensible way to write new projects, modules, and code. However, the book doesn't address what happens when:
- The code base is old, and doesn't have any tests or isn't designed testable. It makes it hard to do anything other than introduce integration-level tests and tweak to success.
- You're writing UI code for a serious application. It's straightforward to solve for a dialog framework, but when you're integrating with a major windowing framework that embeds serious functionality (Avalon, in my case), there are a whole set of issues he doesn't talk about.
- Design is part of your deliverable. I don't disagree that you can get pretty reasonble designs out of TDD & refactor. But I *do* disagree that, in practice, you get designs intended to version well, that your company is willing to support for the next decade or more. I've seen the code produced, and it just doesn't happen.

A good introduction, nonetheless. But watch out before you put on the preacher-hat after reading it and doing the exercises -- at least try to do it in part of one large, real-world product.

A Great Experience - Review written on September 13, 2003
* * * * *
Rating: 5 out of 5

This is the most interesting book that I have read. During the first 20 pages, I dispise it. After 20 pages, I get it. After part I, I love it. At part III, I worship it!

The book start with example that involves teeny, weeny steps of test driven development that made me think this is really for people who don't know how to write test. And I consider myself to be a fully test-infected developer -- well, until I finally understand the idea that Kent is trying to convey here. It shows not only how to create a test case for a class, but also how to use test as the driving tool to assist refactoring for a better cleaner code. Becaus the way of development process is so much different from the normally way (well, depends on what you think is normally, isn't it), Kent carefully makes sure that the user doesn't get ahead of himself or herself. With little jokes here and little comments there, it really feels like being pair-programming with an XP mentor (it does, because I have been pair-programming with an XP mentor), who paitiently explains everything that is going on in his or her mind.

The second part of the book is also very unique. It goes through a process of using TDD to write a unit test framework. It shows, nicely, how to do TDD before the testing framework is in place, thus really tells what is the heart of TDD, and teaches a great lesson that TDD is not just writing test cases, but also a revolutionary development process.

The third part summrized patterns used in TDD, need I say more?

Helpful, Simple and Brief - Review written on September 08, 2003
* * * * *
Rating: 5 out of 5
7 customers found this review helpful, 2 did not.

I bought this book for two reasons: it teaches TDD and it's spine has the thickness of a deck of cards.

I'll bet the XP adage "testEverythingThatCouldPossiblyBreak" is what prevents most programmers from taking up TDD. Who could blame them? If they truly tested all combinations and permutations they would take years to complete coding assignments and never stay employed.

Without being explicit, the author breaks that adage and introduces a practical, simple means for adopting a habit of writing tests first. "Red/Green/Refactor" is the mantra that he shows through the money example, this is the path towards a "Clean Code that Works" objective.

Honestly, I never got to parts II and III. Part I: "The Money Example" helped me clear the hurdles of tedium that you imagine in TDD; it alone is worth the price of the book.

Stops where it gets interesting - Review written on June 13, 2003
* * *
Rating: 3 out of 5
18 customers found this review helpful, 6 did not.

I like the way Kent Beck writes his books. And it's sometimes thrilling to read his strange ideas. Having seen so many projects skip unit testing completely the idea of writing tests first strikes me as very good. Mr Beck presents his ideas very clearly and leads the reader through all subtleties and traps of a small example. That's exactly the point where things become interesting for me: How does the academic idea scale when being faced with Web apps, EJBs, XML/XSLT and so on? Hardly any hints about that which makes me wondering if the approach can be used for real projects.
So simple to do-- write better code - Review written on May 09, 2003
* * * * *
Rating: 5 out of 5
7 customers found this review helpful, 2 did not.

This book has nothing in it that you don't know you should be doing. You know you should test your code. You know that you should make sure changes don't break things. I'll bet that you haven't actually taken the steps to make sure that you do this though.

Kent walks you through a good way to develop code: write the test code as you write the actual code. I've actually put this into practice and it's surprisingly easy to follow the recommendations. As you write a new function, write some code that calls it in a few different ways. When it comes time to give your code to someone else (check in to source control, deliver to customer, use on a bigger project), you have a fair sense that things will work.

Again, you already know that you should test things. This book presents one really great way to do that. It's worth taking a few hours and reading this one. Buy it so that you can re-read it once every year.

Allows you to judge TDD for yourself - Review written on April 17, 2003
* * * * *
Rating: 5 out of 5
9 customers found this review helpful.

Let me say first off that I agree with much that Kent Beck has to say: 1. Testing should be done along with the coding. 2. Use regression tests to be confident of making changes. 3. In many ways testing can be used as documentation since it is much more definitive than specification documents. 4. Testing should be used to have the client sign off on a product. In reading the book I learned the specifics of how tests are designed in TDD. It seems reasonable and I am going to make a conscious effort at designing my tests in the way suggested.

Where I disagree is in the use of the tests to drive software design. In the first part of the book, which I think is the most important part, a very good coding problem is analyzed - it is realistic, limited in scope and far from trivial. I followed along until I reached a point where things stopped making sense. I skipped ahead to see where things were headed and then things became clear.

What is being advocated is a type of bottom up design approach. This may work for some. It may even be that the book faithfully reproduced Beck's reasoning process. It does not work for me. I first have to see the larger picture, what he refers to as the "metaphor." The whole thing would have been much clearer to me if at the beginning I was told that one approach to summing money in different currencies would be to use an array to store the information but that instead the implementation would create a list similar to how things are done in LISP.

I urge the reader to judge for him/herself. Like I said this is a good example to go through. I even learned some things about more advanced uses of object oriented programming. As for software design I am going to stick with dataflow diagrams. They are still the best tool that I know of for putting together software, UML notwithstanding.

Fun to read and interactive - Review written on February 14, 2003
* * * *
Rating: 4 out of 5
2 customers found this review helpful.

Test-Driven Development is one of the few technical books that I have gotten a great deal of pleasure out of reading. At times it feels like Kent Beck is right beside you teaching you the concepts in a way that rings true. Beck does not simply present the techniques in a set of dry rules to be followed. You get a feel for how he has learned this method of development, which is a better way for me to learn as well.

The only complaint about the book that I have is that the second larger example on xUnit is disappointing. It comes across as though Beck wanted to play with Python and as he states, the way he learns a new language is to implement xUnit. However, from a reader's perspective, I found the chapter confusing and not very helpful over the first money example. I would really have liked to see a more realistic example dealing with a business application and the issues of test-driving databases and GUIs.

However, the book is a joy to read and is nice and small. I hate 1000 page tech books, and this one is easy to carry. Highly recommended!

Fail, Run, Run Clean - Review written on February 05, 2003
* * * * *
Rating: 5 out of 5
16 customers found this review helpful.

The are a small number of writers who can teach programming skills effectively. Kent Beck is one of them. There are a small set of practices that you can adopt on your own that will have an clearly observable impact on the quality of your results and the quality of your work day. Test Driven Develoment (TDD) is one of them. If you are a software developer, you want to buy, read and study this book.

TDD fits development into a three micro-phase cycle: create a test that embodies your requirement, write code that passes the test, make the code run clean. Each phase has different goals, patterns and pitfalls. Like any good coach, Beck walks you through these in detail. He uses multiple examples: most notably a business model in Java and a unit testing framework in Phython. He follows up with a question and answer section that reviews common patterns in test driven development cycle.

The level of learning involved in doing TDD is profound. The best way to read the book is to do the book. Skills come from doing not reading. I did the examples (in another language) and it made all the difference in what I learned.

A footnote for managers: TDD is the opening wedge for a set of practices known as extreme programming (XP) or agile development. Test driven development is powerful enough to work on its own for the single delevoper. If you want to realize its full value, however, you need to embrace the full set of XP practices for the whole organization.

helpful for cross-platform coding too - Review written on January 06, 2003
* * * * *
Rating: 5 out of 5
16 customers found this review helpful, 4 did not.

It's about time that someone wrote this book. Some programmers have been doing test-driven-development since the earliest days of our profession, and the rest of us have been wondering why it is so hard to development software the "traditional" (non-TDD) way.

Test-driven development (or as I prefer to call it, test-driven-design) helps you figure out the most useful interface to your class-under-test, without getting you into the psychological trap of not "really" wanting to test (and thus prove faulty) your "wonderful" code, because your code doesn't exist yet. The tests help you think about the implementation in small, mostly painless, steps.

TDD also helps you write portable code. By getting portions of the logical parts of your application done first (the "model" of "model-view-controller"), you easily keep the logic code OUT of the GUI code. Typically, programming without test-driven-design makes it too easy to put all your logic into your GUI class. Almost all books on how to use MFC and other GUI class frameworks mix the logic code with view code -- you should read this book so you can be a better programmer.

Poorly written...disappointing - Review written on January 05, 2003
* *
Rating: 2 out of 5
35 customers found this review helpful, 11 did not.

I bought this book with high expectations. I'm a true believer in testing early and often. Basically, I think the techniques have merit, but the presentation was lacking.

I was disappointed with the writing -- all of the little asides that were attempts at humor fell flat and were distracting. The biggest disappointment was that a chapter on how to integrate these techniques into the processes of a project, especially a large project, was ommitted.

At one point, the book states rather flippantly something to the effect that "You'll have to come up with your own argument to convince your boss to let you spend the time writing all these tests." I think that since he's the one promoting these techniques, he should be able to come up with those arguments. Personally, I think the argument is something like this:
- helps produce clean, modular code by forcing the designer to think about interfaces of the objects first. Coming up with good interfaces is half the battle.
- reduces defects tremendously because automated tests are available from the beginning and are used constantly.
- combines aspects of design and testing into the construction phase. So, the argument is that the "added" time spent writing tests saves time in the design and testing phases.

I would have also liked to have seen a section on the dangers of stubbed out code. Since the technique causes you to stub out a lot of methods, as you go through the process and people are fallable, it warrants discussion. Sometimes they forget that some of the code is stubbed. I've seen situations where stubbed out code (ie, return true) provided the correct answer for a surprisingly long time. It wasn't until it got into system testing that some of the less frequently encountered data caused mysterious problems to come up in supposedly working code.

90% is Just Showing Up - Review written on December 09, 2002
* * * *
Rating: 4 out of 5
55 customers found this review helpful, 21 did not.

Everyone who's read about XP has wanted a book like this forever, so a decent performance was bound to be a happy occasion (a hot dog is a feast to a starving man). I would disagree with the last reviewer and say that the first part of the book is the good part, when the author works through his 'money' example. At the end of it, there's a great moment when Beck acknowledges the importance of metaphor, claiming that he'd done the same exercise a number of times, though this time, he had picked a better metaphor and it subsequently went a lot faster. I have to laugh at this. This is a case of obiter dicta (giving away the key to something in passing). But the funny thing is that Beck doesn't notice how important it is. He proceeds to just meander through the rest of the book. Then, the book just goes down the rathole as we feel like we're being treated to a prof who's run through his material and is just waiting for the bell. The section on patterns is abominable, ending with a thing on Singleton that says something like 'Don't use global variables, your programs will be happier,' which is a ridiculous capsulization of an issue that a lot of people have discussed many times before. A Singleton is globally available. It's not a variable. Mail servers are globally available too. Guess we shouldn't use them either.

Let me also say that I am really kind of fed up with Kent Beck's Opi Taylor writing style. It's ok when the focus is on the KISS side of the equation and generally positive, but his snide little sideswipes throughout this book on everything from the open-closed principle to the idea of doing specifications (another searing, strong argument that boils down to the root of the word being the same as for the word speculation (!)) are really laughable. Makes me wanna say, yeah, who needs a spec if all they are doing is the 10 millionth payroll program or a currency converter. Don't look to Kent Beck for big answers, as a matter of fact, by his own half-conscious admission, he's as much in search of them as we are.

So why 4 stars? Per the subject, the Woody Allen principle. Another hysterical part of this book is at the very end he shows a list of things someone else suggested, none of which are covered in the book, as if he had to tell us, at the end, that he knew just how much was missing.

Valuable testing patterns and gainful techniques - Review written on December 01, 2002
* * * *
Rating: 4 out of 5
7 customers found this review helpful.

While the first two parts of the book: "The Money Example" and "The xUnit Example" may seem discontenting for an experienced XP'er, the third part: "Patterns for Test-Driven Development" is amazingly impressive. It brings lot of valuable patterns: Test-Driven Development Patterns, Red Bar Patterns, Testing Patterns, Green Bar Patterns, xUnit Patterns and Design Patterns. Despite the book "Design Patterns" seems to be provisioning, design in test-driven-development requires a slightly different look at design patterns, and Kent Beck has done his best in providing not only the common vocabulary, but a gainful technique not known to be described anywhere else before.

Before the publication of this book, there was a lack of a good manual for xUnit testing framework. The title "Testing Extreme Programming" by Lisa Crispin and Tip House, released a couple of month before this book, didn't fill the gap. This book is the first significant guidebook for xUnit ever released. While the work "Extreme Programming Installed" exposes most valuable testing experience among other XP titles, it didn't focus on xUnit as well.

I would recommend "Design Pattern" and "Refactoring" in addition to this book, assuming that you are aware of the XP manifesto: "Extreme Programming Explained".

Great Introduction to Test Driven Development - Review written on November 25, 2002
* * * *
Rating: 4 out of 5
8 customers found this review helpful, 3 did not.

On multiple projects I've spent a lot of time encouraging, cajoling and sometimes forcing developers on the team to write unit tests for their code. Test Driven Development is an important skill that a lot of developers need to master. It is great to see a book devoted to the topic that provides some good examples on how to do it. In addition to the examples, the test patterns are also very useful. Most of the examples in the book use Java, with the rest in Python. Personally, I would have preferred that the book used Java exclusively. This is a minor complaint however. Overall this is a good book.