/TDD-money-problem

Source code from the "Learning TDD" book

Primary LanguageC#

Learning TDD with the Money Problem

  • Workshop to learn TDD step-by-step from Saleem Siddiqui 's book :
  • You will find other languages in this repository : C#, scala
    • I have chosen to make a step-by-step guide from the book in C#

img/Learning-Test-Driven-Development.jpg

What is TDD

TDD is a technique borne of a set of beliefs about code :

  • Simplicity - the art of maximizing the amount of work not done
  • Obviousness and clarity are more virtuous than cleverness
  • Writing uncluttered code is a key component of being successful

Test-Driven Development is a way of managing fear during programming - Kant Beck

Designing and structuring code

  • TDD is not fundamentally about testing code
  • Its purpose : improve the design and structure of the code
    • The Unit Tests that we end up with are an added bonus
    • Primary benefit : simplicity of design we get

A bias toward simplicity

  • In software we can measure simplicity :
    • Fewer lines of code per feature
    • Lower Cyclomatic Complexity
    • Fewer side effects
    • Smaller runtime / memory requirements
  • TDD forces us to craft the simplest thing that works
  • Virtue isn't mystical :
    • Using TDD won't cut by half :
      • your development time
      • the lines of code
      • defect count
    • It will allow you to arrest the temptation to introduce artificial / contrived complexity

Increased Confidence

TDD increases our confidence in our code :

  • Each new test flexes the system in new and previously untested ways
  • Over time : the tests suite guards us against regression failures

About this repo

This is a monorepo containing all the source code for the "Learning Test-Driven Development" book, published by O'Reilly.

Prerequisites

  • You need to install the runtime environment for the language you prefer use (Go, Python, C#, Scala, JS)
  • To understand the evolution and purpose of the code, you need the accompanying book.

Workshop

Workshop