/TDD_exercices

Exercising some TDD Katas

Primary LanguageJava

TDD_exercices

Test driving developement

Why TDD

Fewer bugs and errors are the primary benefit of the TDD approach. When the code has fewer bugs, you'll spend less time fixing them than other programming methodologies. TDD produces a higher overall test coverage and, therefore to a better quality of the final product.

TDD CYCLE

  • Red step : write a fail test
  • Green step: write the minimum code to get it green (pass it)
  • Refactor step: refactor your code.

TDD Principals

  1. You are not allowed to write any production code unless it is for making a failing unit test pass.

Some of the guiding principles for TDD are "KISS" (or "keep it simple stupid"), and "YAGNI" ("you ain't going to need it"). Both of these principles are subtly different but they both agree that in the context of TDD, the focus should be to just write enough code to pass the test, using the simplest solution to do so. This helps keep the design as clean and clear as possible.

  1. Don't Repeat Yourself (a.k.a. DRY)

My Katas

  1. LeapYear Kata
  1. Fizzbuzz kata
  1. Roman Numeral
  1. Bowling Kata