TDD’s Advantage in Experimentation

Rafael A. George Duval
2 min readDec 16, 2023

--

Every line of code we write is a decision we make. TDD helps us confirm those decisions by providing feedback. We make design decisions, and TDD allows us to get feedback. Testing is about confirmation, not affirmation.

The focus should be on achieving business outcomes rather than writing elegant code. Thus, the time spent writing a test should be proportional to confirming information about a particular problem. TDD has an advantage over other approaches because it allows us to experiment with many solutions for the same problem in less time. Yet, it’s important to consider the trade-off of testing only essential application pieces. This trade-off is not worth it, as the business’s success depends on being flexible and accommodating to customers’ needs. For ambiguous problems, we confirm our decisions one step at a time. This helps us gather evidence to support our conclusions as we write them. TDD allows us to explore different scenarios and clarifies our thinking about what is essential and workable. TDD is an inductive approach that moves from specific examples to generalizations. The benefit of this workflow is its ability to divide and conquer. Working on smaller sections of code is much easier than tackling a large amount of code or an entire system. The approach’s robustness comes from confirming intermediate steps toward a solution.

[¹]: Clean Agile: Back to Basics

--

--

Rafael A. George Duval
Rafael A. George Duval

Written by Rafael A. George Duval

✍🏼 Building a Solo Digital Media Company 🧪 Snippets of Text [https://snippetsoftext.substack.com/subscribe]

No responses yet