People who practice test-driven development (TDD) often describe it as a powerful approach. And while they make a convincing case, nothing beats experiencing it for yourself. So that's exactly what we'll do in this workshop.
We'll start with a brief explanation of TDD's red-green-refactor cycle. Red: write a test for the next bit of functionality you want to add. Green: write the code needed to make the test pass. Refactor: improve the code and the tests. Next, it's time to put that cycle into practice implementing a fairly simple algorithm. There's very little setup needed, so you can do this in any programming language you like.
In the last part of the workshop you'll share you experiences and your code. We'll reflect on those as a group, drawing lessons from it. And we'll discuss how the red-green-refactor cycle applies, even when you're writing something that's not unit testable, like test automation.
Please complete the setup of this workshop beforehand, by following the instructions in the "Setup for the kata"-section of the workshop repo:
https://codeberg.org/joeposaurus/counterstring-codekata#setup-for-the-kata. The absolute minimum setup you need to do, is make sure you're able to write code and tests in a programming languague of your choice.
Key takeaways:
- TDD lets you take small steps with feedback at every step.
- TDD lets you discover the right implementation as you go.
- The ideas of TDD still apply when you're writing test automation.