TDD Coaching and Training in 2023

This article was originally published on Linkedin

A giant post-it note with "(why|how|should) we do TDD coaching in 2023"
A "marketplace" post-it from the unconference

During the awesome Avanscoperta retreat in Riccione I hosted a session on TDD training and coaching. Here’s a recap.

Participants: Alessandro Di Gioia Cédric Pontet Marco Consolaro Gianluca Padovani Simone V. Emanuele DelBono Alessandro Melchiori

Thanks to all who participated; what follows is my own summary of contributions coming from the people above. Any factual errors below are mine. And Thank you to Avanscoperta for inviting me!

Question: how do you know your training succeeds?

Difference between training and coaching:

There’s a difference between internal and external coaching. An external coaching program might start with

What is the syllabus for TDD training?

There is a big difference between TDD and “refactoring legacy code”.  The latter uses different and sometimes opposite techniques!  This is why refactoring legacy code is an advanced technique. A recommended sequence of topics to master:

  1. TDD with katas
  2. Software Design principles and patterns
  3. Refactoring on tested code
  4. Refacroring code without tests (ie, legacy code)

More generally, there is a book that covers a comprehensive training program: Agile Technical Practices Distilled is the result of “distilling” years of experience in training

The best trainer in Europe is probably Emily Bache; her book and method Samman Technical Coaching is highly recommended

TDD for the Front-End?

One side question is “do you really TDD on the frontend”? Testing int the front-end is universally thought of as more difficult than testing in the back-end.

One school says that the key is to make testing the FE more similar to testing in the BE: apply the Humble Object pattern, extract logic objects that do not depend on visible features.  See also the concept of sub-cutaneous testing, that was introduced by David Astels in his book Test-Driven Development: A Practical Guide

Another school relies on visual testing with Playwright or Cypress; approval testing means you approve snapshots of the UI and then the system checks that those snapshots do not change

Other notable mention: Aslak Hellesøy’s work on Sub-Second Acceptance Testing

Generally speaking, you want to have only a few very important end-to-end acceptance tests, and one of those is the walking skeleton, that is an early test that the technical components of the system are talking to each other.