Revised ebook version: JAN 2024
Matheus Marabesi and Emmanuel Valverde, Software Craftspersons at Codurance, have written a guide to help developers create quality test code that adds value and agility to the development process. In this book, they take you through the most common anti-patterns that hinder Test-Driven Design (TDD).
Back in late 2021, Matheus sent out a survey, worldwide, to anyone interested in and/or using TDD in their workplace.
The results of the survey (which are in the first section of the book; A Case for TDD Anti-Patterns) helped to shape the Testing Anti-Pattern Workshops that Matheus then ran during 2021/2022 and are available, on-demand, on the Codurance YouTube Channel. In these workshops, Matheus explored the origins, history and pitfalls of anti-patterns.
The survey and workshops went on to become the basis for this e-book: Common patterns that make TDD harder.
The goal is to highlight the potential patterns that can hinder TDD and provide guidance on how to overcome them. Matheus uses real-life examples to demonstrate how testing is a vital aspect of the development process to produce high-quality code. The purpose is not to assign blame or point out mistakes, but instead to offer a constructive approach to dealing with different anti-patterns when writing testable code. By following this approach, developers can improve their development skills and produce better quality code.
Whether you're a seasoned tester or new to the field, you'll find valuable information and tips for implementing TDD best practices by avoiding common anti-patterns. Even if you are unfamiliar with TDD or at the early stages of using it, it’s worth reading this book because this is actually when you need to be able to recognise anti-patterns that waste your time and energy.
Each anti-pattern is listed in the main contents, so if you know the name you can find it easily. If you aren’t sure as to which anti-pattern you are looking for, Matheus has grouped the patterns into different levels, starting at Level I which focuses on those that you will experience when you start to test-drive your code.
Each anti-pattern is described by Matheus in simple terms with examples of code and where possible he also includes suggested further reading, links to his video series or research, should you want to delve deeper.
At the end of each example Matheus also lists the key points that you need to pay attention to in order to avoid falling down this particular rabbit hole, again.
Matheus Marabesi
Software Craftsperson