Goodreads helps you keep track of books you want to read.
Start by marking “Test Driven Development: By Example” as Want to Read:
Test Driven Development: By Example
Enlarge cover
Rate this book
Clear rating
Open Preview

Test Driven Development: By Example

(A Kent Beck Signature Book)

4.08  ·  Rating details ·  3,513 ratings  ·  163 reviews
Quite simply, test-driven development is meant to eliminate fear in application development. While some fear is healthy (often viewed as a conscience that tells programmers to "be careful!"), the author believes that byproducts of fear include tentative, grumpy, and uncommunicative programmers who are unable to absorb constructive criticism. When programming teams buy into ...more
Paperback, 216 pages
Published November 8th 2002 by Addison-Wesley Professional (first published January 1st 2002)
More Details... Edit Details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about Test Driven Development, please sign up.

Be the first to ask a question about Test Driven Development

Community Reviews

Showing 1-30
Average rating 4.08  · 
Rating details
 ·  3,513 ratings  ·  163 reviews


More filters
 | 
Sort order
Start your review of Test Driven Development: By Example
Francis Fish
Apr 28, 2010 rated it it was amazing
This book has a simple purpose: show in clear and understandable language how to approach TDD. Nothing more or less, and he succeeds very well.

Other reviewers have commented that they were annoyed about how this book didn't cover mocks and stubs and a lot of the other artefacts of testing - that wasn't Beck's purpose, he wanted to show how it's done and then catalogue the patterns needed in order to make it work. While he covered mock and null objects he didn't go into the details because these
...more
Erika RS
May 29, 2012 rated it liked it
This is one of those books that I would have rated more highly a few years ago. TDD is not a particularly complicated concept and, these days, it's not particularly new either. Thus, the explanations I've come across online[1] and the one book I've read on the topic[2] have been quite sufficient exposure, making reading another book on the topic superfluous.

That said, Beck's book was, in my opinion, better than Test-Driven Development: A Practical Guide by David Astels. Astels' book is not bad,
...more
Ulas Tuerkmen
Oct 03, 2018 rated it really liked it
I should have read this book earlier. When the whole TDD thing exploded, the web was, for a while, plastered with blog posts and tutorials on the whys and hows of TDD and unit tests. Everyone agreed that automated testing was a great thing; the opinions differed only on when to write the tests, and what the units under test should be. I thought I had understood and soaked in the main tenets of TDD, and did not need to read this relatively small book.

So, what is TDD? It's a development method whe
...more
Daniel
Mar 09, 2009 rated it it was amazing
Shelves: work
This is a different kind of programming book. It's a relatively fun book to read.

It's a good companion's to Fowler's Refactoring. For some reason, I'll always remember Beck from his 'coding smells' concept - it comes from his grandma saying "if it smells [bad:], change it" or something like that.

It too is non-intuitive at first and goes against a lot of learnings. But, all great concepts start out that way. It essentially tells you to write your tests first and (only then), write the smallest
...more
Alla
Oct 07, 2015 rated it it was amazing
This is a future classic and exactly what you need to refine your test-first development skills. Even if you thought you were doing TDD before reading this book you may have been missing some extremely simple and yet powerful tricks Beck has up his sleeve and is happy to share. Try solving some simple problems TDD as you read it and you will know what to pay attention to as you read on.

On a side note the author shares his cheeky personality as he writes which makes reading even more fun.
Vincent Nguyen
Mar 24, 2017 rated it it was amazing
The book has 3 Parts - You can jump to "Part 3: Patterns for Test Driven Development" to read without reading Part 1 and Part 2.

I read this book with a friend, he and I have few notes that can share for you guys:

- Many people think TDD is a way to test: You write tests first and write code later. I have to say: You're wrong - 100% wrong.

- TDD is a way that can help you improve your performance when working, TDD can help you become a better developer. TDD is for yourself, not for your team or com
...more
Marshall
Feb 25, 2012 rated it really liked it
Such a wonderfully written book on Test-Driven Development (TDD). It walks through several easy-to-follow examples, and then wraps up with a nice discussion of TDD and some of the patterns that show up during this style of development. This book is a breeze to read, and very enlightening. I'm so tired of ugly code that breaks all the time, so I was hoping to be persuaded that TDD really is the best way to "write clean code that works." This book definitely persuaded me.

The surprising thing was h
...more
Baal Of
Aug 28, 2015 rated it really liked it
Shelves: non-fiction
This is a good introduction to test driven development, and this book helped me better understand what TDD really is. In particular the points about breaking things down to small steps, refactoring, and always working quickly to a green bar were very helpful. I did find some weird problems with the python example, which might be due to the fact I decided to go with Python3, and the book used Python2. Specifically, I was working through the examples, and found that when I deliberately went off sc ...more
Marko
Mar 25, 2020 rated it really liked it
The examples provide an easy to understand guide for how to follow this process. Too early to say how it works for me, but it did provide some eye opening ways of looking at things. The main downside was that the short code snippets make it difficult to see how the whole system is looking.
Eduards Sizovs
Sep 08, 2019 rated it it was amazing
There are only two books you need to read to fall in love with TDD – this book and Growing Object-Oriented Software Guided by Tests. Whereas GOOS is more practical and showing how to test-drive real applications, Kent's book makes you – the reader – feel the rhythm of TDD. It's like pairing together with Kent. The book also covers non-technical aspects of TDD, such as developer's happiness and productivity.
Yannick Grenzinger
Jul 20, 2020 rated it it was amazing
Surely one the best way to really discover and understand TDD.

It's mainly 3 main parts : one is a very didactic introduction around a Money domain object, the second one is an impressive how to re-implement xUnit the main tool used to do test in TDD, the third one is a list of TDD pattern (from design pattern to refactoring).

Overall it's a very practical, by example and deep way to discover TDD by one of its best promoter.
Aleksandar Markovski
May 28, 2020 rated it it was amazing
Shelves: it
Perfect book as a guide to start and improve TDD skills and also improve as a software engineer
Paul Keen
Takeoffs:

* Before add new code ask: How could I write small/fast tests for this?
* Tests should not know about function body: The Blackbox strategy.
* Do not overwhelm the test. Each new test should test the new micro behavior.
* Train your TDD by micro-stepped refactorings.

David Workman
This fairly slim tome is overflowing with useful information from the 2 worked examples of real-world problems being solved by the author (Kent Beck, of XP and Smalltalk fame, among other things) using Test Driven Development.

The book starts with TDD being applied to the problem of doing multi-currency conversions with given exchange rates. Kent Beck does a chapter per test and associated refactoring, and this leads to extremely short chapters but where almost the entire chapter is useful infor
...more
John
Feb 04, 2012 rated it it was amazing
I must have read this back when it came out because I remember some of the jokes. This is a fascinating book about TDD, esp. if you read it now, given the maturation of the development model. On p. 199 there is a tantalizing section on "Application" TDD, where in a paragraph Beck anticipates BDD -- and how hard BDD can be if you don't properly rope in stakeholders as collaborators. I don't think we've figured that one out yet.

The book is a weird mix. First there's a section where Beck uses TDD t
...more
Pawel Wujczyk
Aug 05, 2018 rated it did not like it
Shelves: tech
I am very amused how much people loves this book. It describes approach to TDD, but from my perspective (after couple years of development practice) done in completely wrong way. In the first part we are observing how author wrote code and refactor its. With the new requirements he adds functionality. At the beginning he just copy the code, and than refactor. My experience tells: no way. In complicated projects the final result of the application will be application with duplication. Of course a ...more
Eliran Teller
Oct 17, 2013 rated it really liked it
Shelves: programming
Brilliantly done, it's given me a lot to think of in terms of programming.
A bit too abstract in some points (thus the 4 star rating), but i guess a revised version with a bit more examples and less abstraction would get a 5 star rating.
Jamis Buck
Dec 31, 2010 rated it really liked it
I haven't actually read the whole thing, but the first half was pretty amazing. I generally have a hard time with tech books, which is why I probably won't actually finish the book. :)
An Nguyen
Jan 23, 2017 rated it liked it
Good to know Java and Python beforehand as the 2 examples are written in those languages. Decent read.
Justin Smith
Nov 14, 2017 rated it really liked it
Still relevant but first part should be a tutorial video and not in a book.
Louise Douglas
Jul 03, 2018 rated it really liked it
Shelves: paperback
As my first real dive into test driven development, this book was a great introduction into the practices and the habits that are involved. The one thing that I wish I had done when I started reading is actually trying to implement the examples that are in the book, as I think the practical side would have helped the examples sink in a little bit more.

Saying that, I learn really well from books, and I had no trouble following the code examples from one to another and having the changes written i
...more
Karan Taneja
Apr 03, 2020 rated it really liked it
I'm a fan of 'clean code that works' as they say it. Recently, projects became too large to handle just with 'clean code' (it's apparently the title of a book by Robert Martin), so I was looking for ways to add '... that works' to my 'clean code'. Testing was naturally the next step.

I'm happy to say I picked the right book. Kent is an expert programmer (he's also the author of 'Extreme Programming' which I'm going to read soon but should have read before this). His explanations are very clear an
...more
Alberto Romero
Jul 13, 2017 rated it it was amazing
This book totally changed my way of seeing TDD.
Since the very beginning, the book tells you about the benefits of using TDD, and how awesome it is to split big problems into small chunks of tests, and the whole first chapter is an example of how to drive your design entirely by doing testing.
Without a doubt, the money example was awesome, and most of the take outs from each of the chapters are something we really need to write down to remember at the moment of writing tests.

Something I still kee
...more
Michael Gaudet
Dec 01, 2018 rated it really liked it
Overall this book is exactly what I was expecting: an introduction to test driven development (TDD) with the author working step-by-step through concrete examples. It’s really great to see that in action versus the purely theoretical treatments given in other books.

This book is in three main parts: the first section covers the creation of a chunk of a money-changing application in a C-family language (Java? It’s simple enough that it doesn’t really matter). I found this easy to follow, although
...more
Claus Aranha
Mar 21, 2017 rated it really liked it
Concrete, Clear Intro to TDD for Newbies like me.

I've heard many social media connections raving about TDD before. Tests as documentation, they said, make sure your changes don't break your code, they said. But whenever I had some time to look for information on the topic, I could never find a concise tutorial or description that I could immediately apply to my own working framework. This book filled that hole quite nicely.

The first half of the book is two example cases, one in Java-ish, another
...more
André
Feb 28, 2018 rated it really liked it
Shelves: programming
Reads as a workshop on TDD on several instances.
The book explains TDD step by step very well (it's in the title that it will be explained "By Example").

What I liked most about the book:
- the code examples; how TDD progresses, useful and working code is "extracted" and drives the design
- feels like a mentoring on TDD, not just a description on it but really the author transmits it's passion on TDD and invites you to join them on this way of structuring and thinking the activities of development
...more
Dun Yang
Jul 09, 2018 rated it it was amazing
Having read a Java-specific TDD book and having the chance to try and apply it on small programming exercises, I find that the book showcases some important concepts and principles that one might not necessary be able to pick up from other books and articles. In particular, the following are valuable lessons that are new to me:
1. The rationale behind learning to take small steps in TDD -> it gives you the ability to choose to take smaller steps as and when we need it (solves the mystery behind t
...more
Philippe Fanaro
Feb 07, 2020 rated it really liked it
Very nice introduction to TDD, by none other than its founder.

I think the second, xUnit example deserved some improvements. It's such a self-referential sort of algorithm that it's difficult to wrap your head around it.

Another major criticism I have is with the biggest dilemma people face when doing TDD: where do we stop testing? What exactly do we test? Even though he mentions implicitly several times that we should test for behavior and not implementation, it won't be at all clear to a total b
...more
John Hearn
Oct 07, 2018 rated it really liked it
Shelves: software
Inside-out TDD done properly and with humour.
Two takeaways from this book not found in a lot of other material:
1) A todo list of the stuff you've realised you'll need but haven't got to yet. Great for resisting the urge to start doing the first thing that comes into your mind. Another way of doing this is to apply the outside-in style of TDD where, in a way, your todo list is represented by your acceptance test.
2) Removing duplication (implicit or explicit) between your code and your test as a
...more
Ilya Ivanov
Oct 28, 2018 rated it it was amazing
Great introduction to Test Driven Development (TDD). Kent wrote this book more than 15 years ago, but I think this book is still very relevant and covers lots of useful insights, techniques and patterns in working with TDD.

I've been working with TDD for quite some time and it was always challenging to apply TDD in front-end development. Especially for an existing project without any automated tests at all. Kent gave a bunch of approaches and mindsets on how to think about your craft. Third part
...more
« previous 1 3 4 5 6 next »

Readers also enjoyed

  • Working Effectively with Legacy Code
  • Refactoring: Improving the Design of Existing Code
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • Clean Architecture
  • The Pragmatic Programmer: From Journeyman to Master
  • Patterns of Enterprise Application Architecture
  • Refactoring to Patterns
  • Head First Design Patterns
  • Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers)
  • Agile Software Development, Principles, Patterns, and Practices
  • Building Microservices: Designing Fine-Grained Systems
  • Code Complete
  • Effective Java
  • Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation
  • Clean Agile: Back to Basics
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »

Other books in the series

A Kent Beck Signature Book (7 books)
  • Implementation Patterns
  • ATDD by Example: A Practical Guide to Acceptance Test-Driven Development
  • Growing Object-Oriented Software, Guided by Tests
  • User Stories Applied: For Agile Software Development
  • Implementing Lean Software Development: From Concept to Cash
  • Leading Lean Software Development: Results Are Not the Point

Related Articles

In these strange days of quarantine and isolation, books can be a mode of transport. We may have to stay home and stay still, but through t...
49 likes · 24 comments
“Used Pluggable Adaptor, which we promise not to use again for four months, minimum, because it makes code hard to statically analyze.” 0 likes
“If you're happy slamming some code together that more or less works and you're happy never looking at the result again, TDD is not for you. TDD rests on a charmingly naïve geekoid assumption that if you write better code, you'll be more successful. TDD helps you to pay attention to the right issues at the right time so you can make your designs cleaner, you can refine your designs as you learn.” 0 likes
More quotes…