Skip to content

mgarciadelojo/tdd-workshop

Repository files navigation

TDD Workshop

Clone the repo and complete the exercise working in pairs!

Content:

What is TDD?

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that is not proven to meet requirements.

Why using TDD?

  • Develop a whole other level of confidence.
  • Freedom to be creative with no fear of breaking things.
  • Design by contract.
  • Avoid superfluous code.
  • Code coverage is guaranteed from the start!

Red / Green / Refactor

RED: Write a failing test.

Requires understanding the story well enough to write a test for what you expect (design by contract!). The test should fail initially because there is no production code yet, hence RED.

GREEN: Make the failing test pass.

Write only the bare minimum code required to make the failing test pass while ensuring your previous tests still pass (no regressions).

REFACTOR: Refactor the code you wrote.

Is there any chance to make your code simpler? Can some tidy ups be made?

About

TDD Workshop in Nodejs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published