Skip navigation

Category Archives: TDD

Here is a Kata for the Bowling Game problem.

Here is a kata for the Prime Factors problem.



another with story and comments.

It is a useful presentation to do a programming Kata (Java-Kata) and show the TDD

from: Prentice Hall – The Clean Coder


more Kata at :

TDD Mantra:

  1. Red – Write a failing automated test that doesn’t work (usually not even compile).
  2. Green – Make the test work quickly (as fast as possible, you can commit any type of sin to go there).
  3. Refactor – Re-factor the code (remove duplication).


Benefits (so far):

+Code (with a min 1 re factoring) -> It’s more clean

+You reduce the scope from “Do a complex thing” to “Pass a test” -> You have an accurate idea about what the problem is, It is dimension ed!

+Your code passed a test, YOU HAVE AUTOMATED TESTS ^^ (so you can re-factor with confidence)

+The design evolves fast

+No more “it’s ALMOST ready” (until you not pass the tests IT’s NOT DONE* )


Danger (so far)

-Your tests need to be “bullet proof”

-Not everything can be tested…


TO REMEMBER: “The cycle is”




from: Kent Beck – Test-Driven Development


Final Notes:

  • It has to make sense in the Domain world and in Java world, do not abuse the Domain syntax.
  • “I will never interrupt an interruption”  – Jim Coplien
  • “Excellent programmer spending 5 – 10 min reasoning a question that can be answered by the computer in 15 ms”
  • “TDD gives you control over the sizes of the steps” – Kent Beck
  •  Isolated tests, one test breaks as to mean-> one problem. Two tests broke -> 2 problems and so on.
  •  You are focused. One problem at a time
  • Surprised for RED bars? Go to smaller steps


* DONE from the Scrum definition of done.