<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged tdd</title>
<link>https://coderlegion.com/tag/tdd</link>
<description>Powered by Question2Answer</description>
<item>
<title>...that's so crazy, it might just work!</title>
<link>https://coderlegion.com/13487/thats-so-crazy-it-might-just-work</link>
<description>&lt;p&gt;We've all seen it! The post in the early hours of the morning! I've done this, I've found that - “I solved the Riemann Hypothesis!”&lt;/p&gt;
&lt;p&gt;You take a quick peek!  Another one. Another late-night manifesto. Another graph that looks convincing. You’ve been click-baited before; an elegant PDF, triumphant tweets, the occasional YouTube video narrated in a voice that appeals. Most of us have trained ourselves to treat RH claims like unsolicited crypto tips: interesting in theory, radioactive in practice. We mute, we scroll, we protect our remaining brain cells.&lt;/p&gt;
&lt;p&gt;So when I say I have a proof, I expect the eye-roll. I deserve it. The history of the problem is a graveyard of brilliant ideas that died quietly in the appendices of online preprints. But here’s the difference this time: I’m not asking you to believe me. I’m asking you to &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jmullings/riemann-hypothesis-singularity-proof/tree/main/TDD_PROOF&quot;&gt;&lt;em&gt;run the code&lt;/em&gt;.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Because the only honest way to answer the inevitable “that’s crazy” is to hand over a 100% falsifiable, machine-verifiable test-driven development (TDD) suite and say: &lt;em&gt;break it&lt;/em&gt;.&lt;/p&gt;
&lt;h4 id=&quot;why-the-skepticism-is-rational&quot;&gt;Why the skepticism is rational&lt;/h4&gt;
&lt;p&gt;The Riemann Hypothesis is the ultimate mathematical catnip. It sits at the intersection of number theory, analysis, physics, and pure aesthetics. It promises to unlock the distribution of primes, the zeros of the zeta function, and a dozen other deep structures. For years it has resisted every attack. Every few months someone announces a proof, the community holds its breath for forty-eight hours, then the flaw appears — usually a hidden division by zero, an unjustified interchange of limits, or a computer check that only ran up to 10⁶ and not 10¹². The pattern is so reliable that the rational response has become a defensive reflex: &lt;em&gt;ignore until peer-reviewed or independently reproduced&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I get it. I’ve done the same with these bold claims! But defensive reflexes can also become blind spots. What if the next claim isn’t a lone genius in a basement but an open, executable, modular framework? What if the proof isn’t a single 40-page LaTeX document but 1,900 passing tests, zero failures, and an architecture deliberately built so that &lt;em&gt;anyone&lt;/em&gt; can swap in their own function, their own kernel, their own spectral operator — and let the mathematics itself be the referee?&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jmullings/riemann-hypothesis-singularity-proof/wiki&quot;&gt;That is exactly what this repository is.&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&quot;the-crazy-part-a-collaborative-falsification-engine&quot;&gt;The crazy part: a collaborative falsification engine&lt;/h4&gt;
&lt;p&gt;Here’s the part that still makes me grin like an idiot at 3 a.m.: the entire proof is now a &lt;em&gt;plug-and-play test harness&lt;/em&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You don’t like the sech² curvature kernel? Drop in your own test function. The Bochner PSD checks and the Weil explicit-formula decomposition will run automatically.  &lt;/li&gt;
&lt;li&gt;You have a better gravity-well operator? Swap the polymeric Hilbert–Pólya matrix for yours. The PHO-representability gate and the Rayleigh-quotient bounds will immediately tell you whether it survives or breaks.  &lt;/li&gt;
&lt;li&gt;You think the Kadiri-Faber constants can be tightened? Edit &lt;code&gt;_B_VK&lt;/code&gt; in &lt;code&gt;analytic_bounds.py&lt;/code&gt; and watch &lt;code&gt;test_42&lt;/code&gt; re-run the monotonicity and asymptotic-vanishing assertions in real time.  &lt;/li&gt;
&lt;li&gt;You suspect an off-critical zero hides somewhere? Feed it to the triad governor (&lt;code&gt;triad_scan&lt;/code&gt;) and it will compute the three-layer contradiction.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every layer is isolated, every function is exported, every test is named and documented. The suite is not a black box; it is a &lt;em&gt;laboratory&lt;/em&gt;. You are not a passive reader. You are now a co-experimenter. The math decides. Not me, not you, not any single ego. The code runs, the assertions fire, and the verdict is mercilessly binary: pass or fail.&lt;/p&gt;
&lt;p&gt;That is the crazy part. &lt;strong&gt;&lt;em&gt;And that is why it just might work&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h4 id=&quot;what-the-harness-actually-proves&quot;&gt;What the harness actually proves&lt;/h4&gt;
&lt;p&gt;The architecture rests on a simple contradiction engine built around the Weil explicit formula and the positivity basin (Theorem B 2.0). Any admissible spectrum must keep the corrected functional $\widetilde{F}_2(T&lt;em&gt;0; H, \lambda^*) \ge 0$. An off-critical zero injects a strictly negative contribution $\Delta A&lt;/em&gt;{\rm avg} &amp;lt; 0$ (Layer A, proven via continuous H-integral and Riemann–Lebesgue decay). &lt;/p&gt;
&lt;p&gt;The triad governor scripts wires the three layers together and acts as an automated theorem prover. Feed it a hypothetical off-critical configuration and it returns a confusion matrix: no false rejections on-critical, no undetected anomalies off-critical. Every test in tiers 40–44 now passes with the new analytic bounds. The remaining 10 xfailed tests are honest finite-$N$ artefacts in the $\widetilde{F}_2$ equality conjecture — they are marked as such and do not affect the contradiction chain.&lt;/p&gt;
&lt;p&gt;The suite currently runs numerous passing tests across 26 tiers. Zero failures. The warnings are only harmless integration warnings from &lt;code&gt;scipy.quad&lt;/code&gt; on a deliberately pole-straddling support used for finiteness checks. Everything else is green.&lt;/p&gt;
&lt;h4 id=&quot;why-this-changes-the-game&quot;&gt;Why this changes the game&lt;/h4&gt;
&lt;p&gt;Most RH claims are hermetic: you must trust the author’s calculation, the hidden lemma, the 400-line derivation that no one else has time to re-derive. This claim is the opposite. It is &lt;em&gt;anti-hermetic&lt;/em&gt;. The code is public, the tests are public, the gaps were public, then closed in public, with every commit and every pytest run visible. You do not have to accept my word. You can fork the repo, replace the &lt;code&gt;averaged_deltaA_continuous&lt;/code&gt; implementation with your own quadrature method, and watch the sign and decay tests re-run. If your version still passes, the envelope negativity survives. If it fails, the community now has a concrete counter-example to study.&lt;/p&gt;
&lt;p&gt;This is not a proof by authority; &lt;strong&gt;&lt;em&gt;it is a proof by &lt;/em&gt;invitation to falsify&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And that invitation is open to everyone — amateur, professional, physicist, number theorist, even the skeptic who started this article by reaching for the unfollow button. Swap in your function. Run the suite. Let the math decide.&lt;/p&gt;
&lt;h4 id=&quot;the-endgame&quot;&gt;The Endgame&lt;/h4&gt;
&lt;p&gt;Either the community finds the flaw (and we all learn something profound about where the current bounds break), or the suite survives every attempted break. In the first case, the RH remains open and we have a sharper diagnostic tool than we had yesterday. In the second case, the contradiction chain stands and the Riemann Hypothesis is settled.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;I am not asking you to believe. I am asking you to test.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Because the craziest idea of all is this: after 165 years of solitary genius and lonely PDFs, the final proof of the Riemann Hypothesis might not come from one mind in one room. It might come from thousands of minds, each contributing one clean function, one tighter constant, one better quadrature — all judged by the same merciless, reproducible test harness.&lt;/p&gt;
&lt;p&gt;For me, that is not crazy, &lt;a rel=&quot;nofollow&quot; href=&quot;https://zenodo.org/records/19223508&quot;&gt;it's how science is supposed to work&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/13487/thats-so-crazy-it-might-just-work</guid>
<pubDate>Wed, 25 Mar 2026 16:23:18 +0000</pubDate>
</item>
<item>
<title>TDD in the Age of AI: How Evals Can Benefit from Test-Driven Development</title>
<link>https://coderlegion.com/11288/tdd-in-the-age-of-ai-how-evals-can-benefit-from-test-driven-development</link>
<description>
&lt;p&gt;Test-Driven Development (TDD) has been a cornerstone of quality software engineering for decades. But as we enter the age of AI-assisted development and large language models, does TDD still hold relevance? The answer is a resounding yes&amp;mdash;and perhaps more than ever before.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Timeless Principles of TDD&lt;/h2&gt;



&lt;p&gt;At its core, TDD follows a simple cycle: write a failing test, write the minimum code to pass, then refactor. This red-green-refactor loop forces developers to think about requirements and edge cases before implementation. The result? Cleaner code, better design, and a comprehensive test suite that serves as living documentation.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;TDD Meets AI: A Natural Partnership&lt;/h2&gt;



&lt;p&gt;When working with AI coding assistants, TDD becomes even more valuable. Here&amp;rsquo;s why:&lt;/p&gt;



&lt;ul class=&quot;wp-block-list&quot;&gt;
&lt;li&gt;&lt;strong&gt;Clear specifications&lt;/strong&gt;: Tests provide unambiguous requirements that AI can understand and implement against&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verification layer&lt;/strong&gt;: Tests act as a safety net to validate AI-generated code behaves correctly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reduced hallucinations&lt;/strong&gt;: When AI knows it must pass specific tests, outputs tend to be more grounded and practical&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Iterative refinement&lt;/strong&gt;: The red-green-refactor cycle works naturally with AI iteration&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Evals: TDD for AI Systems&lt;/h2&gt;



&lt;p&gt;Perhaps the most exciting application of TDD principles is in the world of AI evaluations&amp;mdash;commonly called &amp;ldquo;evals.&amp;rdquo; Evals are systematic tests designed to measure how well an AI model performs on specific tasks or criteria.&lt;/p&gt;



&lt;p&gt;The parallel to TDD is striking:&lt;/p&gt;



&lt;figure class=&quot;wp-block-table&quot;&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;TDD Concept&lt;/th&gt;&lt;th&gt;Eval Equivalent&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Write failing test first&lt;/td&gt;&lt;td&gt;Define expected behavior before training/prompting&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Minimum code to pass&lt;/td&gt;&lt;td&gt;Iterate on prompts or fine-tuning until eval passes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Refactor&lt;/td&gt;&lt;td&gt;Optimize prompts while maintaining eval scores&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Test suite&lt;/td&gt;&lt;td&gt;Eval suite covering multiple capabilities&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Applying TDD Mindset to Evals&lt;/h2&gt;



&lt;p&gt;Here&amp;rsquo;s how you can apply TDD thinking to your AI evaluation strategy:&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;1. Define Success Criteria First&lt;/h3&gt;



&lt;p&gt;Before crafting prompts or fine-tuning models, clearly define what success looks like. What inputs should produce what outputs? What edge cases matter? This is your &amp;ldquo;test specification.&amp;rdquo;&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;2. Create Measurable Evals&lt;/h3&gt;



&lt;p&gt;Write evals that can objectively determine pass/fail. This might include exact match comparisons, semantic similarity thresholds, or structured output validation. Avoid vague criteria that require subjective judgment.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;3. Start with Failing Evals&lt;/h3&gt;



&lt;p&gt;Just like TDD, begin with evals that your current system fails. This ensures you&amp;rsquo;re building toward measurable improvement rather than just validating the status quo.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;4. Iterate Incrementally&lt;/h3&gt;



&lt;p&gt;Make small changes to prompts or model configurations, run your eval suite, and observe the impact. Large changes make it difficult to understand what&amp;rsquo;s working.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;5. Prevent Regression&lt;/h3&gt;



&lt;p&gt;Maintain a comprehensive eval suite that runs with every change. Just like unit tests catch regressions in code, evals catch regressions in AI behavior.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Practical Benefits&lt;/h2&gt;



&lt;p&gt;Teams adopting eval-driven development report several benefits:&lt;/p&gt;



&lt;ul class=&quot;wp-block-list&quot;&gt;
&lt;li&gt;&lt;strong&gt;Faster iteration&lt;/strong&gt;: Clear pass/fail criteria eliminate guesswork&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Better communication&lt;/strong&gt;: Evals serve as a shared language between engineers, product managers, and stakeholders&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confidence in deployment&lt;/strong&gt;: A passing eval suite provides assurance before shipping&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Documentation&lt;/strong&gt;: Evals document expected behavior in an executable form&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Conclusion&lt;/h2&gt;



&lt;p&gt;TDD isn&amp;rsquo;t just surviving the AI age&amp;mdash;it&amp;rsquo;s thriving. The discipline of writing tests first translates beautifully to the world of AI evals, where defining expected behavior upfront is crucial for building reliable systems.&lt;/p&gt;



&lt;p&gt;Whether you&amp;rsquo;re writing traditional software, working with AI coding assistants, or building AI-powered products, the TDD mindset remains invaluable: specify behavior first, verify it works, then iterate with confidence.&lt;/p&gt;



&lt;p&gt;The age of AI doesn&amp;rsquo;t diminish the importance of testing&amp;mdash;it amplifies it.&lt;/p&gt;
&lt;p&gt;The post &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com/tdd-in-the-age-of-ai-how-evals-can-benefit-from-test-driven-development/&quot;&gt;TDD in the Age of AI: How Evals Can Benefit from Test-Driven Development&lt;/a&gt; appeared first on &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com&quot;&gt;sudoish&lt;/a&gt;.&lt;/p&gt;

</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/11288/tdd-in-the-age-of-ai-how-evals-can-benefit-from-test-driven-development</guid>
<pubDate>Mon, 09 Feb 2026 04:22:29 +0000</pubDate>
</item>
<item>
<title>TDD Tests Assumptions, Not Just Code</title>
<link>https://coderlegion.com/9060/tdd-tests-assumptions-not-just-code</link>
<description>&lt;p&gt;In software development, the mistake that tends to cost more isn't the typical bug. It's building the wrong thing. A bug announces itself when something fails, and the fix is usually local. A wrong feature passes every test, ships, and only shows up when users don't use it. By then the design, the data model, and the code around it all rest on the misunderstanding. Some bugs break that pattern, such as corrupted data or a security hole, but they're the exception rather than the typical case.&lt;/p&gt;
&lt;p&gt;Teams should be focused on preventing the delivery of features that don't match what users need, implementing requirements that were misunderstood, or discovering halfway through that the domain model was wrong. Test-Driven Development (TDD) is one solution to this problem, but it's often a very poorly understood concept, and even those who do understand it can still do TDD wrong.&lt;/p&gt;
&lt;p&gt;Dan North, who coached teams in TDD, wrote in &quot;Introducing BDD&quot; that people's misunderstandings of TDD &quot;almost always came back to the word 'test'.&quot; His answer was Behaviour-Driven Development. Practices like Gojko Adzic's Specification by Example put the same concrete examples in front of stakeholders before any code exists. BDD and Specification by Example are TDD's idea with better vocabulary, and this post is about that idea.&lt;/p&gt;
&lt;p&gt;The promise of TDD is that tests guide design and catch bugs early. The reality, sometimes, is that teams write tests for features they don't yet understand, design interfaces around incomplete requirements, and spend hours on tests that get thrown away when understanding finally arrives. The resulting debate often gets heated. Advocates measure test coverage and celebrate red-green-refactor. Skeptics count rewritten tests as waste. Both sides miss what actually happened: when done right, those rewritten tests forced understanding before the wrong system got built and delivered. When done wrong, they were just ceremony.&lt;/p&gt;
&lt;blockquote class=&quot;pull-quote&quot;&gt;
&lt;p&gt;Much of TDD's value isn't in the tests. It's in the understanding that writing them demands.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;testing-assumptions-not-just-code&quot;&gt;Testing Assumptions, Not Just Code&lt;/h3&gt;
&lt;h4 id=&quot;business-rule-tests-state-assumptions&quot;&gt;Business-Rule Tests State Assumptions&lt;/h4&gt;
&lt;p&gt;Most discussions frame TDD as a code quality tool: write tests first, implement to pass, refactor for quality. Coverage metrics become the measure of success. But every test also encodes assumptions about user needs and business logic. When you write a test asserting business rules, you're stating assumptions about how the system should behave, and not just your assumptions as a developer but the ones baked into the requirements themselves. A test can't check those assumptions against users on its own. Writing it makes them concrete enough to check, against the codebase and against someone who knows the business.&lt;/p&gt;
&lt;p&gt;Not every test carries business assumptions. Small tests around a class's collaborators mostly serve design, so the argument here is about the tests that assert business rules. In outside-in TDD, those are the first test or two for each new rule, written at the rule's boundary before you know which classes you'll need. A developer who starts inside-out from a helper class still gets TDD's small steps, but not this gain. Even these tests have a limit. They can catch a requirement that was misunderstood, not one that was wrong to begin with, because whether users value a premium discount at all is a question for prototypes and users.&lt;/p&gt;
&lt;h4 id=&quot;writing-the-assertion-forces-the-choice&quot;&gt;Writing the Assertion Forces the Choice&lt;/h4&gt;
&lt;p&gt;For those business-rule tests, timing is the gain. Writing the test first means you don't build for days before discovering misalignment, which is what happens when tests come at the end of a feature or not at all. You might find that an entire scope of work needs to go back for reconsideration, and finding that on day one is obviously better than finding it on day ten.&lt;/p&gt;
&lt;p&gt;Consider a test asserting that &lt;code&gt;CalculateDiscount(customer)&lt;/code&gt; returns 15% for &quot;premium&quot; customers. That test encodes assumptions about what &quot;premium&quot; means, what discount they deserve, and whether discounts even work this way. Discovery can happen immediately, because writing the test forces you to define &quot;premium&quot; concretely. You might realize the customer object has no tier field, or that the pricing service doesn't support percentage-based discounts, or that the requirement contradicts existing business rules.&lt;/p&gt;
&lt;p&gt;Even the expected value forces a choice. On a $100 order that already carries a 10% promo code, is the answer $85, $76.50, or $75? Implementation code picks one too, as a line of arithmetic. The developer writing it is thinking about how to calculate, not about what the answer should be. An assertion asks for the answer itself. Working out $76.50 by hand is the moment you notice two discounts are stacking, so the choice gets made knowingly before any implementation begins.&lt;/p&gt;
&lt;p&gt;That only helps if the choice reaches someone who knows the business. The habit that makes it work is taking any assertion you had to guess at to the product owner before moving on. TDD doesn't supply that habit. It supplies the moment where the guess becomes visible to the developer.&lt;/p&gt;
&lt;p&gt;The test's setup can expose the larger misunderstanding too. To build a premium customer for the test, you have to decide what makes a customer premium. If you ask, you learn early that product meant purchase history rather than a tier. If nobody asks, product clarifies it later anyway, and the test is where the correction lands, as one visible, reviewable edit rather than a hunt through the code. Early or late, the test change isn't waste. It's learning captured before shipping wrong behavior.&lt;/p&gt;
&lt;p&gt;A wrong assumption found before implementation costs a conversation, and found after, it costs the conversation plus the code built on it. Tests force specific questions that conversation alone often leaves unasked, because an assertion needs an exact input and an exact expected output where a requirements discussion can stay abstract.&lt;/p&gt;
&lt;h4 id=&quot;test-first-makes-the-question-a-default&quot;&gt;Test-First Makes the Question a Default&lt;/h4&gt;
&lt;p&gt;Other routes can surface the same guess. A careful developer writing code first can meet the same question, and an example card in a Specification by Example session forces the same choice. TDD's claim isn't that only a test can force the choice. It's that a test-first habit forces the choice every time a developer starts a new rule, as a default rather than a matter of care, including on teams that never hold those sessions. It also reaches rules no session thought to raise, like how a premium discount stacks with a promo code, because those only appear when someone writes out the specific case.&lt;/p&gt;
&lt;h4 id=&quot;rewrites-are-learning-unless-they-track-implementation&quot;&gt;Rewrites Are Learning Unless They Track Implementation&lt;/h4&gt;
&lt;p&gt;Skeptics still count the rewrites as waste, and some test code will get thrown away. Mocks and implementation details in a test encode their own assumptions, and some of those only get checked by building the code. That's fine. A little code waste is a small price compared to the larger waste of building the wrong system because critical misalignments went undiscovered. It stays little when tests written under uncertainty are few and coarse, so a rewrite touches a handful of assertions rather than a suite.&lt;/p&gt;
&lt;p&gt;When large test rewrites happen repeatedly, though, they might signal something else. The tests may be coupled to implementation details rather than behavior, so every internal change breaks them. Or the developer who wrote them was going through the motions rather than asking what the code should do. The trigger tells you which. A rewrite prompted by a stakeholder's answer or a newly found domain fact is learning, and a rewrite prompted by a refactor that changed no behavior is coupling.&lt;/p&gt;
&lt;p&gt;TDD treated as a checklist rather than a discipline for understanding will produce tests that don't surface assumptions early. The waste isn't in TDD itself; it's in treating TDD as compliance rather than inquiry.&lt;/p&gt;
&lt;h3 id=&quot;stop-measuring-success-by-tests&quot;&gt;Stop Measuring Success by Tests&lt;/h3&gt;
&lt;p&gt;This reframing should change what we measure, but not by replacing one test metric with another. Using test coverage as a success metric is a distraction. Measuring &quot;assumptions caught&quot; would be too. Value delivered is the only meaningful measure of success.&lt;/p&gt;
&lt;p&gt;One signal connects value back to the tests: features that return for rework because a business rule was misunderstood. Compare one team's count before and after it adopts the habit. That's a team signal rather than proof, since rework also comes from stakeholders changing their minds. Don't compare rules that got a business-rule test first against rules that didn't. Developers may write tests first more readily for rules they already understand, so that comparison flatters the habit.&lt;/p&gt;
&lt;p&gt;Coverage metrics can still provide useful insight into quality gaps, but think in terms of use case coverage rather than line coverage. Are the critical business scenarios tested? Are the edge cases stakeholders care about covered? That's a different question than &quot;what percentage of lines have tests?&quot;&lt;/p&gt;
&lt;p&gt;Tests are a tool, not an outcome. When teams treat coverage percentages as goals or count rewritten tests as waste, they've confused the means for the end.&lt;/p&gt;
&lt;p&gt;The test suite does have secondary value as documentation that new developers can read to understand system constraints without digging through old conversations and tickets. But that's a side effect, not a success metric.&lt;/p&gt;
&lt;h3 id=&quot;match-the-test-to-how-settled-the-requirement-is&quot;&gt;Match the Test to How Settled the Requirement Is&lt;/h3&gt;
&lt;p&gt;Which tests to write first depends on how risky the assumption is, and how to write them depends on how settled the requirement is. The riskiest assumptions tend to sit in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Business rules.&lt;/strong&gt; How discounts work, what triggers notifications, when transactions are valid&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Edge cases stakeholders haven't considered.&lt;/strong&gt; What happens when the cart is empty? When the user has no purchase history?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data validity assumptions.&lt;/strong&gt; What &quot;valid&quot; input looks like, what formats are acceptable, what happens with missing fields&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The same test-first habit serves two different purposes depending on how settled the requirement is:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Requirement &lt;/th&gt;&lt;th&gt;What the test is for &lt;/th&gt;&lt;th&gt;How to write it &lt;/th&gt;&lt;th&gt;When the test changes&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Clear and stable &lt;/td&gt;&lt;td&gt;Checking the implementation against an agreed rule &lt;/td&gt;&lt;td&gt;Fine-grained tests around the logic, kept for the long term &lt;/td&gt;&lt;td&gt;Something broke a commitment, so fix the code&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Uncertain &lt;/td&gt;&lt;td&gt;Exposing the assumptions inside the rule &lt;/td&gt;&lt;td&gt;A few tests at the business-rule boundary, asserting outcomes a stakeholder can confirm, light on mocks &lt;/td&gt;&lt;td&gt;Understanding moved, so update the test and keep going&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Classifying a requirement as clear is itself an assumption, and the falsely settled ones are where teams build the wrong thing. If writing the first test for a &quot;clear&quot; rule raises a question the ticket can't answer, the rule belongs in the uncertain row.&lt;/p&gt;
&lt;p&gt;How settled the requirement is matters more than the usual debate about test-first versus test-after. A study by Davide Fucci and colleagues of 39 professionals found that the order of test and production code had no important influence on code quality or productivity, while small, steady steps did. Small steps are a benefit TDD brings to the code itself, separate from the understanding this post is about.&lt;/p&gt;
&lt;p&gt;That study scored code against predefined stories on small coding tasks. The requirements were already specified, so there was nothing to misunderstand. Its finding covers code quality and productivity, not catching misunderstood requirements. For catching them, the case for writing the test first rests on the mechanism the discount example showed rather than on data. An assertion written before the code has to state the expected value with no code to copy it from, while one written after can simply record whatever the code already does.&lt;/p&gt;
&lt;p&gt;The better question is what assumptions you're making about user needs and how to validate them fastest. Sometimes that's writing a test first, other times it's building a prototype first, and sometimes it's showing mockups to users first. The goal isn't perfect tests. It's validated understanding.&lt;/p&gt;
&lt;blockquote class=&quot;pull-quote&quot;&gt;
&lt;p&gt;The most overlooked value of TDD isn't in the tests that pass. It's in the tests that change because an assumption turned out to be wrong.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;tests-are-commitments-to-what-you-re-building&quot;&gt;Tests Are Commitments to What You're Building&lt;/h3&gt;
&lt;p&gt;Writing the test first forces a question: what should this code actually do? That question demands understanding before implementation. The passing assertion represents a commitment: this is the contract we're building to. Implementation honors that commitment by making the test pass.&lt;/p&gt;
&lt;p&gt;When tests change during development, you're realigning based on discovery. When tests fail after changes, they're surfacing broken commitments that need attention. The discipline isn't about tests. It's about starting with understanding, securing genuine commitment to what you're building, and then honoring what was agreed.&lt;/p&gt;
&lt;p&gt;Building the wrong thing is the more expensive mistake. TDD's first business-rule tests address the misunderstood-requirement half of it by forcing clarity before code, but only when practiced as inquiry rather than compliance. Tests that surface wrong assumptions early are valuable even when they get rewritten. Tests written as ceremony produce waste without insight.&lt;/p&gt;
&lt;p&gt;In practice, that means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Treat coverage as a diagnostic for missing use cases, not a goal&lt;/li&gt;
&lt;li&gt;Read a rewritten test as an answered question, not as failure&lt;/li&gt;
&lt;li&gt;Write tests to the requirement's state, coarse and disposable while it's uncertain, fine-grained once it's settled&lt;/li&gt;
&lt;li&gt;Measure whether you delivered what users actually needed, starting with how often features return for rework over a misunderstood rule&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TDD isn't just a testing practice. It's a discipline for understanding.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/9060/tdd-tests-assumptions-not-just-code</guid>
<pubDate>Mon, 29 Dec 2025 15:36:37 +0000</pubDate>
</item>
<item>
<title>[BOOK REVIEW] Beck K., Extreme Programming Explained (1999)</title>
<link>https://coderlegion.com/8718/book-review-beck-k-extreme-programming-explained-1999</link>
<description>&lt;p&gt;This is the teaser post of the &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/A_n2k0xOR_O8qX4PlSqevw/beck-k-extreme-programming-explained-1999&quot;&gt;original&lt;/a&gt; review that is pretty detailed, containing images and diagrams.&lt;/p&gt;
&lt;h2 id=&quot;beck-k-extreme-programming-explained-1999-&quot;&gt;Beck K., Extreme Programming Explained (1999)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Extract&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The book is only 1/5 about programming and 4/5 about organizational matters. The book covers all the core and corollary elements of what is nowadays called Agile. It accompanies the other 2 Beck's books on the subject: &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/ZYiWQIgyTDWvBFM9vcECRQ/beck-k-planning-extreme-programming-2001&quot;&gt;Planning Extreme Programming (2000)&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/JpuwEWmVTg2tQBf-iIL94Q/beck-k-tdd-by-example-2002&quot;&gt;TDD by Example (2002)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Contents&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;li&gt;XP Notions Hierarchy&lt;/li&gt;
&lt;li&gt;Values&lt;/li&gt;
&lt;li&gt;Principles&lt;/li&gt;
&lt;li&gt;Practices&lt;/li&gt;
&lt;li&gt;Whole XP Team (Cross-Functional Teams)&lt;/li&gt;
&lt;li&gt;Process Bottlenecks&lt;/li&gt;
&lt;li&gt;Planning via Managing Scope&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Design&lt;/li&gt;
&lt;li&gt;Scaling XP&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;[VS] The book name is rather misleading. Roughly 80% of it is dedicated to organizational matters. This messes the book goals, makes absorbing the book material by engineering and managerial audiences hard.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;The following purely engineering notions are explored in the book: Test-First Programming, Incremental Design, Automated Tests, Pair Programming, Ten-Minute Build, Code and Tests, Single Code Base.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The book is quite short. It consists of two parts: 'Exploring XP' (which describes practical, useful elements) and 'Philosophy of XP' (a series of essays on the subject). For practicality, my review does not cover the latter. However, it gets very interesting and valuable reading after you have internalized XP enough to absorb its roots.&lt;/p&gt;
&lt;p&gt;The book sometimes uses mind maps to explain key concepts. The issue is those maps are practically unreadable. This review fixes that issue. Enjoy.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;[VS]: XP (and later Agile) is not about software construction (&quot;what to do&quot;). It is about the elements of an organizational process (&quot;how to do&quot;) that may or may not bring value to your specific software products.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;Practically Waterfall is &quot;what to do&quot; and XP is &quot;how to do&quot; your Waterfalls.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;Most of XP is pure common sense derived from production and marketing management practices 1. These practices were already well developed in organizational cultures 2 more advanced than those in Software Engineering at the time of the book's writing.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;Internalize the core content of the book, consciously, selectively apply it in the daily practice and you get what many today calls Agile.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;xp-notions-hierarchy&quot;&gt;XP Notions Hierarchy&lt;/h3&gt;
&lt;p&gt;The XP notions - Values, Principles, Practices - are organized in the following hierarchy.&lt;/p&gt;
&lt;p&gt;...continue reading at the original &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/A_n2k0xOR_O8qX4PlSqevw/beck-k-extreme-programming-explained-1999&quot;&gt;review&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/8718/book-review-beck-k-extreme-programming-explained-1999</guid>
<pubDate>Mon, 22 Dec 2025 08:32:37 +0000</pubDate>
</item>
<item>
<title>[BOOK REVIEW] Meszaros G., xUnit Test Patterns (2007)</title>
<link>https://coderlegion.com/7304/book-review-meszaros-g-xunit-test-patterns-2007</link>
<description>&lt;p&gt;This is the teaser post of the &lt;a rel=&quot;nofollow&quot; href=&quot;http://%20https://valentineshi.dev/content/book-reviews/x8REmtO9TWGq-3r_SDHMvQ/meszaros-g-xunit-test-patterns-2007&quot;&gt;original&lt;/a&gt; review that is pretty detailed, containing images and diagrams.&lt;/p&gt;
&lt;h2 id=&quot;meszaros-g-xunit-test-patterns-2007-&quot;&gt;Meszaros G., xUnit Test Patterns (2007)&lt;/h2&gt;
&lt;p&gt;Extract&lt;/p&gt;
&lt;p&gt;This &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.amazon.com/xUnit-Test-Patterns-Refactoring-Code/dp/0131495054&quot;&gt;book&lt;/a&gt; is essential language-agnostic source to make your TDD delivering principal values: maintainable test code, joyful &lt;abbr title=&quot;System Under Test&quot;&gt;SUT&lt;/abbr&gt; refactorings, and zero product defects.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Contents&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Concepts&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Goals of Test Automation&lt;/li&gt;
&lt;li&gt;Testing Philosophy&lt;/li&gt;
&lt;li&gt;Principles of Test Automation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Practice&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Test Smells&lt;/li&gt;
&lt;li&gt;Test Automation Strategy&lt;/li&gt;
&lt;li&gt;xUnit Basics&lt;/li&gt;
&lt;li&gt;Test Fixtures&lt;/li&gt;
&lt;li&gt;Result Verification&lt;/li&gt;
&lt;li&gt;Test Doubles&lt;/li&gt;
&lt;li&gt;Test Organization&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Testing with Databases&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Issues with Testing with Databases&lt;/li&gt;
&lt;li&gt;Testing without Databases&lt;/li&gt;
&lt;li&gt;Testing the Database&lt;/li&gt;
&lt;li&gt;Database Patterns&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Roadmap to Effective Test Automation&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Test Automation Difficulty&lt;/li&gt;
&lt;li&gt;Roadmap to Highly Maintainable Automated Tests&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Remaining Patterns&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;/h3&gt;
&lt;p&gt;While &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/JpuwEWmVTg2tQBf-iIL94Q/beck-k-tdd-by-example-2002&quot;&gt;TDD by Example&lt;/a&gt; is more conceptual, practically demonstrating only &lt;abbr title=&quot;Red, Green, Refactor&quot;&gt;TDD cycle&lt;/abbr&gt;, this one presents a much wider and very practical body of knowledge a software engineer must not miss.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;[INFO] [xUnit](&lt;a rel=&quot;nofollow&quot; href=&quot;https://en.wikipedia.org/wiki/XUnit&quot;&gt;https://en.wikipedia.org/wiki/XUnit&lt;/a&gt;) is the family of unit testing frameworks implementing unified specific approaches and test code patternsThe family includes test frameworks for &lt;abbr title=&quot;JUnit&quot;&gt;Java&lt;/abbr&gt;, &lt;abbr title=&quot;NUnit, xUnit.net&quot;&gt;C#,&lt;/abbr&gt;, &lt;abbr title=&quot;Vitest, Jest, Mocha&quot;&gt;JavaScript&lt;/abbr&gt;, &lt;abbr title=&quot;PHPUnit&quot;&gt;PHP&lt;/abbr&gt; to name a few.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Despite seemingly &lt;abbr title=&quot;948 pages&quot;&gt;heavy&lt;/abbr&gt;, The book is effectively organized and is a pleasure to absorb using my reviewSkim the diagrams and maps, take 1-2 techniques you like most and start applyingWhen hungry again return for moreWith time the book becomes a good foundational reference on testing.&lt;/p&gt;
&lt;p&gt;The review combines &quot;Part INarratives&quot; and &quot;Part IIIPatterns&quot; into a single space as they discuss the same at different level on granularityPart I introduces concepts, Part III provides implementation patternsOn top the review moves the more broad concepts (goals, philosophy and principles) up.&lt;/p&gt;
&lt;h3 id=&quot;concepts&quot;&gt;Concepts&lt;/h3&gt;
&lt;h4 id=&quot;goals-of-test-automation&quot;&gt;Goals of Test Automation&lt;/h4&gt;
&lt;p&gt;Tests should (p. 84):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Help us to improve quality and understand the SUT.&lt;/li&gt;
&lt;li&gt;Reduce (and not introduce) risk.&lt;/li&gt;
&lt;li&gt;Be easy to run, easy to write and maintain.&lt;/li&gt;
&lt;li&gt;Require minimal maintenance as the system evolves around them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;testing-philosophy&quot;&gt;Testing Philosophy&lt;/h4&gt;
&lt;p&gt;(p. 94)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write the tests first!&lt;/li&gt;
&lt;li&gt;Tests are examples (of SUT usage)!&lt;/li&gt;
&lt;li&gt;Usually write tests one at a time, but sometimes list all the tests one can think of as skeletons upfront.&lt;/li&gt;
&lt;li&gt;Outside-in development helps clarify which tests are needed for the next layer inward.&lt;/li&gt;
&lt;li&gt;Use primarily State Verification (p. 172, 525) but will resort to Behavior Verification (p. 531) when needed to get good code coverage.&lt;/li&gt;
&lt;li&gt;Perform fixture design on a test-by-test basis.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;principles-of-test-automation&quot;&gt;Principles of Test Automation&lt;/h4&gt;
&lt;p&gt;(p. 102)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write the Tests First&lt;/li&gt;
&lt;li&gt;Design for Testability&lt;/li&gt;
&lt;li&gt;Use the Front Door First&lt;/li&gt;
&lt;li&gt;Communicate Intent&lt;/li&gt;
&lt;li&gt;Don’t Modify the SUT&lt;/li&gt;
&lt;li&gt;Keep Tests Independent&lt;/li&gt;
&lt;li&gt;Isolate the SUT&lt;/li&gt;
&lt;li&gt;Minimize Test Overlap&lt;/li&gt;
&lt;li&gt;Minimize Untestable Code&lt;/li&gt;
&lt;li&gt;Keep Test Logic Out of Production Code&lt;/li&gt;
&lt;li&gt;Verify One Condition per Test&lt;/li&gt;
&lt;li&gt;Test Concerns Separately&lt;/li&gt;
&lt;li&gt;Ensure Commensurate Effort and Responsibility&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;practice&quot;&gt;Practice&lt;/h3&gt;
&lt;h4 id=&quot;test-smells&quot;&gt;Test Smells&lt;/h4&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/x8REmtO9TWGq-3r_SDHMvQ/meszaros-g-xunit-test-patterns-2007#test-smells&quot;&gt;continue at the original [review]&lt;/a&gt;&lt;/p&gt;
</description>
<category>Unit Testing</category>
<guid isPermaLink="true">https://coderlegion.com/7304/book-review-meszaros-g-xunit-test-patterns-2007</guid>
<pubDate>Thu, 13 Nov 2025 08:47:56 +0000</pubDate>
</item>
<item>
<title>TDD: Barrier and Brilliance</title>
<link>https://coderlegion.com/7306/tdd-barrier-and-brilliance</link>
<description>&lt;h2 id=&quot;tdd-barrier-and-brilliance&quot;&gt;TDD: Barrier and Brilliance&lt;/h2&gt;
&lt;p&gt;TDD stalled on Beck’s “no design before tests” flaw, but when paired with thoughtful design it flips costs into benefits—isolated complexity, minimal debugging, and cleaner interfaces shaped from the consumer’s view.&lt;/p&gt;
&lt;hr&gt;
&lt;blockquote&gt;&lt;p&gt;Kent Beck, who gave us both TDD and Extreme Programming, deserves credit as the pioneer whose vision shaped modern agile practice—even if his early framing carried the flaws natural to anyone charting new ground.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is the short overview and conclusion induced by the insightful &lt;a rel=&quot;nofollow&quot; href=&quot;https://geometrian.com/projects/blog/test_driven_development_is_stupid.html&quot;&gt;Test-Driven Development is Stupid&lt;/a&gt; writing. The colleague Geometrian rightfully (in my view) dismisses TDD for the same flaw I did in my &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/writings/hRJExsTjQqKa_fxkH6HftQ/applying-tdd-teaches-everything&quot;&gt;Applying TDD Teaches Everything&lt;/a&gt; article and my &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/JpuwEWmVTg2tQBf-iIL94Q/beck-k-tdd-by-example-2002#issues&quot;&gt;review&lt;/a&gt; of Beck's TDD by Example book.&lt;/p&gt;
&lt;p&gt;Here is a short list that would finally clarify the entire thing (hopefully).&lt;/p&gt;
&lt;h3 id=&quot;the-barrier-to-tdd&quot;&gt;The Barrier to TDD&lt;/h3&gt;
&lt;p&gt;Most developers who never adopted TDD were stopped by Beck’s original flaw: the notion of “no &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/niceties/bpUtR6-nTmmHlTJT7FPr8A/architecture-design&quot;&gt;design&lt;/a&gt; before tests.” This single misstep, rooted in Extreme Programming &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/A_n2k0xOR_O8qX4PlSqevw/beck-k-extreme-programming-explained-1999&quot;&gt;1&lt;/a&gt;, &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/book-reviews/ZYiWQIgyTDWvBFM9vcECRQ/beck-k-planning-extreme-programming-2001&quot;&gt;2&lt;/a&gt; undermined TDD’s credibility and turned many away before they could experience its real benefits.&lt;/p&gt;
&lt;h3 id=&quot;the-cost-of-no-tdd&quot;&gt;The Cost of No-TDD&lt;/h3&gt;
&lt;p&gt;Those who reject TDD end up paying elsewhere:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;They lack complexity isolation,&lt;/li&gt;
&lt;li&gt;They are forced into endless debugging runs of the entire system, multiplying wasted time saved from not doing TDD, and&lt;/li&gt;
&lt;li&gt;They miss the uniquely powerful design perspective TDD provides—shaping clean public interfaces as a consumer of their own code. Coarse &quot;paper&quot; &lt;a rel=&quot;nofollow&quot; href=&quot;https://valentineshi.dev/content/niceties/bpUtR6-nTmmHlTJT7FPr8A/architecture-design&quot;&gt;designs&lt;/a&gt; like UML &lt;abbr title=&quot;We talk here about backend systems more complex than generic CRUD.&quot;&gt;are required&lt;/abbr&gt; before TDD, but they can only touch the surface of consumer-facing API design. The main work in this department happens with TDD - it allows the engineer to feel and act as an API consumer, which fundamentally &lt;abbr title=&quot;Makes it shorter, optimizes inputs and outputs, hides more complexity, extracts it to dedicated locations etc.&quot;&gt;improves the implementation&lt;/abbr&gt; compared to what it would have been without TDD. This often leads also to updates of the coarse paper design solutions.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;the-brilliance-of-tdd&quot;&gt;The Brilliance of TDD&lt;/h3&gt;
&lt;p&gt;Reversing the costs above reveals the true brilliance of TDD:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;TDD provides the complexity isolation to the level manageable by humans - the main issue of people writing software.&lt;/li&gt;
&lt;li&gt;TDD nearly eliminates the need for system-wide debugging. Instead of rerunning the whole application, you validate behavior in isolation, accelerating iteration and learning.&lt;/li&gt;
&lt;li&gt;TDD is not just about correctness—it is a design instrument - finer and additional to careful UML etc. design. Writing tests first (once a design is thoughtfully established—e.g. UML class, sequence etc. diagrams) places you in the code consumer’s seat, ensures your public interfaces are clean and convenient for use, hiding the implementation details beneath. Unlike UML’s static sketches, TDD (again, upon design made) delivers executable, evolving API consumer feeling in an engineer writing the code - a code producer.&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>Unit Testing</category>
<guid isPermaLink="true">https://coderlegion.com/7306/tdd-barrier-and-brilliance</guid>
<pubDate>Thu, 13 Nov 2025 08:47:52 +0000</pubDate>
</item>
</channel>
</rss>