
Review: “Test-Driven Development” by Kent Beck [The creator of JUnit] - monksy
http://theexceptioncatcher.com/blog/2012/05/review-test-driven-development-by-kent-beck-the-creator-of-junit/#.T73VfNPWfSA.hackernews
======
ollysb
I read a few TDD books before this one but this was the book that really got
me to understand the difference between simply test-first and test-driven
development. The worked example in the first section of the book really
illustrates how to using test-driven to evolve the design of the code that
you're writing. Previously I'd approached TDD as figuring out how I want the
code to work in my head first and then writing a test that would then let me
write that code. Having read this book I now write the tests as a description
of how I want the code to behave without first giving consideration to how the
implementation will work.

------
adrianhoward
_The book is designed for people who are new to unit testing and Test-Driven
Development. For anyone in the current software development industry, this is
very few people._

Sigh. I only wish this were true :-)

I encounter a lot of people who say that they do TDD, or understand TDD, but
they're often doing something _very_ different from what Beck describes. For
example the number of folk who treat TDD as a synonym for unit testing is
scary.

Far to many folk see the "T" and forget about the "DD".

~~~
k_bx
> For example the number of folk who treat TDD as a synonym for unit testing
> is scary.

I think the problem is in 2 parts: in TDD term (Test-Driven
Design/Development, it's just not that obvious), and in lack of unit-testing
at most projects (I see) at all. Was there any statistics on that, by the way?

~~~
adrianhoward
_Was there any statistics on that, by the way?_

Nope. Only my personal experiences of talking to folk and teaching/advocating
TDD. I encounter a lot of folk who think just using an xUnit framework ==
doing TDD. It's depressing.

My experiences may be biased since I'm often brought to help out with folk who
are having problems. However Googling for things like "TDD is not about
testing" shows lots of people having similar experiences :-)

------
k_bx
copy of my comment:

I am python developer. I also ask myself these questions, and on current
project I use TDD heavily (but still far from 100%). One thing it totally
gives me is ability to let other devs in team without need of tons of
collaboration to implement some functionality, and then for me being able to
refactor it as much as I want, but not being blamed for errors. Since it's
their job to put as much tests as would cover all functionality, and it's my
job to only write tests for my new code, and fix (or remove) old tests. I
think this blame-less in dynamic languages like python is real diamond :)

Also, one question I ask myself is "unit-testing vs type theory". And can
unit-testing in dynamic language be an instrument that would make dynamic
type-checking to be a good thing even in serious production. It's also a big
question, and there's a lot to think on it.

------
powerslave12r
Question:

I recently got these two books \- Test Driven: TDD and Acceptance TDD for Java
Developers \- Agile Java™: Crafting Code with Test-Driven Development

I'm an experienced programmer but new to Java and TDD. Do I need the book that
is reviewed here? I considered it back when I was buying the other two books.

~~~
adrianhoward
I'd definitely consider it. It's by the man who invested the concept of TDD
and the xUnit framework after all :-)

My experience is that people tend to split into two camps.

One group prefers Kent's book - which is kind of like the K&R of TDD. It's
thin and very to the point, but needs a bit of work from the reader to get the
best out of it. The examples are deliberately simple to express the concepts
clearly.

The other prefers David Astel 's "Test-driven Development: A Practical Guide".
It's a bit more grounded in real world examples, which some folk seem to find
an easier way to get a grip on the concepts.

Another thing to bear in mind that they both talk about "old" versions of
JUnit - before they rebuilt it based on attributes - so you're probably going
to want to look at something that covers the latest JUnit or TestNG or
something (I'm not a Java hacker by trade - so can't really comment on what
the best testing environment is there these days).

------
gaius
Everything you need to know about TDD:
[http://ravimohan.blogspot.co.uk/2007/04/learning-from-
sudoku...](http://ravimohan.blogspot.co.uk/2007/04/learning-from-sudoku-
solvers.html)

------
ludicast
I loved his TDD series on pragprog.

