Test-driven development in practice, and when not to
Red, green, refactor in steps small enough to survive a bad afternoon, a rule built that way in the lab, and the cases where writing the test first is the wrong tool
You are building a rule test-first. You write a test, run it, and it passes at once, before you have written any code for it. What is the best next move?
Test-driven development, TDD, is a way of working in which a failing test comes before the code that makes it pass. That is the whole definition. Everything else in this chapter is about doing it well, and about knowing when to put it down. It is not a way of testing; it is a way of building, where the tests are a by-product that you keep.
The loop
The loop has three steps, repeated many times an hour.
- Red. Write one small test for the next piece of behaviour. Run it. It must fail, and it must fail for the right reason: an assertion that says the answer was wrong, not an import error. (Chapter A first unit test spent its time on this distinction.)
- Green. Write the least code that makes it pass. Not the best code and not the general code: the least.
- Refactor. With every test green, tidy what you wrote a minute ago and what was already there: names, duplication, structure. Run the tests after each small change. Behaviour must not change, and the tests are how you know.
Martin Fowler’s short account adds a step before the loop: write a list of the cases you expect to need, then pick them in a sensible order. The list is not a plan to follow rigidly. It stops you from holding six edge cases in your head while you write the first line. When you think of a new case mid-loop, you add it to the list and carry on with the one in hand.
Kent Beck, who says he rediscovered the practice and wrote the book on it, gives three ways to get from red to green. Know them by name, because you use all three:
- Fake it. Return the constant the test expects. It feels silly and it is sound: you now have a green bar and a safe place to stand.
- Triangulate. Add a second test with a different expected value. The constant can no longer satisfy both, so you write the real logic.
- Obvious implementation. When the right code is plain, write it directly. Drop back to faking the moment a step surprises you with a red bar.
The skill is choosing the size of the step. When you are confident, take big steps. When a test fails in a way you did not expect, take smaller ones until you are sure again. Beck’s point is that you adjust the gear, not that you always crawl.
Why the red step is not a ceremony
Every red step answers one question: can this test fail? A test written after the code is often green from its first run, and then you have no evidence it checks anything. You wrote the code, then wrote a test shaped like the code, and the two agree by construction. A first unit test showed how: assert line_total(line) == line.unit_price_kobo * line.qty repeats the implementation and passes whatever the implementation does.
With test-first, you wrote the expected value before the code existed. It came from the requirement, on paper. When the code then makes it green, two independent statements of the behaviour agree. That is where a test’s value comes from.
The same logic gives you the rule for the surprising green. If a new test passes before you write code, you have not seen it fail. You do this: break the code in the place the test is meant to guard, run the test, see it go red, put the code back. In the lab you do it to a >= that a boundary test should catch. It takes thirty seconds, and you do it again whenever a test is green at once.
What it does to design
The side effect that gets the most attention is design. A test is the first caller of your code, and writing it first makes you decide the interface before the implementation. If the test is awkward to write, the interface is awkward to use.
Look at what the free-delivery rule asks for. The first test you write is delivery_charge(net_kobo=3_000_000, distance_km=3) == 0. Three decisions were made, and none of them involved a database:
- The rule is a pure function of two integers. It does not read an order, a clock or a table, so every case is one line of test.
- It takes net goods in kobo, not the subtotal. You will confirm that choice with a test in the lab, because it is a business decision: does a customer whose discount pulls them under ₦20,000 get free delivery? Here the answer is no, and a test now records it.
- The threshold and the distance limit are named constants, which the second and fourth tests force you to name.
Compare this with writing the rule inside price_cart after the fact. You would test it through a whole cart, with a promo, a tier and a quantity all in play, and you would have a hard time seeing which part failed.
Time works the same way. promo_applies(promo, now) takes now as an argument and never reads the system clock, which is why the lab can test the stroke of midnight in Lagos without waiting for it. The lab’s FakeClock (in checkout/clock.py) holds a time and moves only when the test calls advance. The caller in production passes SystemClock().now(). The test passes a clock it controls.
// reads the system clock, and the day number is arithmetic on a string
function reportRange() {
const now = new Date(); // CI's clock, in CI's time zone
const y = now.getUTCFullYear(), m = now.getUTCMonth() + 1, d = now.getUTCDate();
return { from: `${y}-${pad(m)}-01`, to: `${y}-${pad(m)}-${pad(d - 1)}` }; // day 0 on the 1st
}
// the test: expected = the same expression with the same clock// the clock and the zone are arguments
function reportRange(clock, tzHours) {
const local = new Date(clock.now() + tzHours * 3600000);
// first of the local month to yesterday; on the 1st, the whole previous month
}
// the test hands in a fake clock set to 31 Jan, 1 Mar 2028, 1 Jan, 22:30 UTC with tz +2... Watch two things in the sim. First, the code and the test agree on an ordinary day, and the date edge is where they come apart. Second, the fix is never to wait for the edge: it is to put the clock in your hand. The promo change in the lab does exactly that, with 22:59 UTC (23:59 in Lagos, which is one hour ahead of UTC all year) as the test’s starting point.
Tests and design go wrong together
TDD is not safe from itself. These are the failure modes people meet:
| Failure | What it looks like | What to do |
|---|---|---|
| Tests that mirror the implementation | Every refactor breaks a dozen tests, though no behaviour changed | Assert on results (a returned fee), not on which helper was called. See What a good test looks like |
| Skipping the refactor step | Green code piles up with duplicated branches and magic numbers | Treat refactor as part of the cycle, not an optional extra. Fowler singles it out as the commonest error |
| Mocks everywhere | The design bends to make mocking easy: layers of indirection that do nothing | Use plain values and pure functions where you can; fake only what is slow or outside your control (Fakes, stubs and mocks) |
| Steps that are too big | A red bar that tells you nothing, and twenty minutes of debugging | Go back to the last green and take a smaller step |
| Testing only the cases you thought of first | A green suite with the boundary missing | Keep the case list and use the techniques in Choosing test cases |
The second row from the bottom has a cure built into the loop: when a step goes wrong, you revert to the last green state and take a smaller step. With a green bar a few minutes old, that costs minutes. Without it, you are debugging.
The “mocks everywhere” row is the heart of the argument in Is TDD Dead?, the recorded conversation between Beck, Fowler and David Heinemeier Hansson in 2014. Hansson argued that driving design from unit tests had led to what he called test-induced design damage: extra layers added to make code easy to isolate. Beck’s reply was that the damage comes from design decisions, not from the practice. You do not need to take a side to take the lesson. If a test forces you to build something you would not build otherwise, ask whether the pain is telling you the design is wrong or the test is.
What the research says
Be careful with strong claims here, in either direction. Two studies are worth knowing.
Nagappan and his co-authors reported results from four industrial teams that adopted TDD, comparing each with a similar team that did not. They found fewer defects in the TDD teams at the cost of longer development time. It is a real result, from real teams, and it is observational: the teams were not randomly assigned, and the effect varied between them.
Fucci and colleagues looked inside the process. They asked whether the benefits come from the test-first order or from the way TDD is usually practised. Their finding: the sequence of test then code, against code then test, had no important influence on quality or productivity. What did matter was fine-grained steps and uniformity, a steady rhythm of small cycles. Their reading is that TDD’s benefits may owe more to those small, steady steps, which help focus, than to the test-first order itself.
Put the two together and you get a practical position. Test-first is a good way to get the small, steady rhythm, and for a rule with a clear statement, like the free-delivery threshold, it is a cheap way to get it. The order is not sacred. A team that writes a few lines of code and then its tests, in cycles of minutes, is probably getting most of the benefit. A team that writes a day of code and then a day of tests is probably not. That is an inference the study fits, not something it tested: it did not compare day-long batches.
When not to
Test-first needs one thing before it works: you know what you want the code to do. When you do not, a test cannot say it.
Exploratory work. You are finding out what a page should look like, or how an unfamiliar library behaves, or what shape a response has. A test written now would pin a guess, and you would rewrite it with every change of mind. The better approach is a spike: write throwaway code to learn, time-box it, keep what you learned and delete the code. Then drive the real version from tests, now that you know what to ask for. The danger is not the spike. It is a spike that quietly becomes production because it works. Say, before you start, that it will be deleted, and do it.
Markup and layout. Whether a banner looks right is a human judgement. A unit test of the page string checks that some text is present, which is not the same as checking that the page works, and it breaks when someone moves a paragraph. What is worth testing sits behind the page: the rule that decides what the banner says. Test that, and look at the page with your eyes (or with a browser test, which a later chapter in this module covers: End-to-end and browser tests).
Throwaway scripts. A one-off migration you will run once and read the output of does not repay a suite. If the output is the check, keep the check as the output.
Code with no seam yet. An old function with no tests cannot be driven from a test, because it already exists and its behaviour is whatever it does. The move there is characterisation: pin down what it does now, then change it. The project Test a legacy function is that practice.
Notice what is not on the list: “it is too slow” and “we are in a hurry”. A pure pricing rule costs minutes under TDD and saves the Monday morning in the opening story. The list is about not knowing, not about time.
Spike, then stabilise
The pattern that joins the two is short. You spike to learn. You write down what you learned as a list of behaviours. You throw the spike away, and you build each behaviour test-first. The lab ends with exactly this on the checkout page: a spike to see what a delivery message might look like, deleted afterwards, and one test written against the rule it exposed.
What to carry away
Small steps, a red you have seen, and a refactor you did not skip: that is the practice. Chapters ahead build on it. Coverage and mutation testing give you a number for how well a suite checks what it covers, which is the measured version of the question “can this test fail?” that you asked by hand here.
You build two changes test-first in Ojaline’s checkout service: a free-delivery rule (six cycles) and a grace window on a promo’s last day (using FakeClock). Then you spike a page change, throw it away and write one test. The prices are illustrative. Everything runs from labs/testing. Output is trimmed and times will differ.
1. Check the starting point, back up the two files you will change and set up a cycle log. The log is how you see your own cycle time.
cd labs/testing
.venv/bin/pytest tests/unit -q -p no:randomly
mkdir -p scratch && cp checkout/pricing.py checkout/api.py scratch/
cycle() { .venv/bin/pytest tests/unit/test_free_delivery.py -q -p no:randomly 2>&1 | tail -${2:-3}; echo "$(date +%H:%M:%S) $1" >> tdd-log.txt; }10 passed, about 0.1 s. The cycle function runs the new test file and appends a time and a label to tdd-log.txt. Define it again in each new terminal. If you use a shell without tail -N, run the pytest line by hand and log with date.2. Cycle 1: red for the right reason, then fake it. The rule: delivery is free when the net goods (after discounts, before VAT) reach ₦20,000 and the customer is within 15 km. Create tests/unit/test_free_delivery.py:
from checkout.pricing import delivery_charge
def test_a_big_basket_near_the_customer_ships_free():
assert delivery_charge(net_kobo=3_000_000, distance_km=3) == 0The test needs a function to call, or it dies with an import error (the wrong red). Add a stub at the bottom of checkout/pricing.py that does the old thing. Python looks names up when a function runs, so the bottom of the file works:
def delivery_charge(net_kobo: int, distance_km: int) -> int:
return delivery_fee(distance_km)cycle "c1 red"assert 150000 == 0 with the where line showing delivery_charge(net_kobo=3000000, distance_km=3), and 1 failed. It reached the code and the answer was wrong: the right red. Now fake it: change the body to return 0, then cycle "c1 green". You see 1 passed. A constant is a legitimate green here, because the next test will not allow it.3. Cycle 2: triangulate. Add a second test that a constant cannot satisfy:
def test_a_small_basket_pays_the_normal_fee():
assert delivery_charge(net_kobo=1_000_000, distance_km=3) == 150_000cycle "c2 red"assert 0 == 150000 and 1 failed, 1 passed. Now write the real rule. Replace the stub in checkout/pricing.py with:
FREE_DELIVERY_FROM = 2_000_000 # N20,000 of net goods, in kobo
def delivery_charge(net_kobo: int, distance_km: int) -> int:
if net_kobo >= FREE_DELIVERY_FROM:
return 0
return delivery_fee(distance_km)Run cycle "c2 green" and you see 2 passed.
4. Cycle 3: the boundary, and a test that is green at once. Add the pair of values either side of the line:
def test_the_threshold_itself_ships_free_and_a_kobo_less_does_not():
assert delivery_charge(net_kobo=2_000_000, distance_km=3) == 0
assert delivery_charge(net_kobo=1_999_999, distance_km=3) == 150_000cycle "c3 green at once"3 passed with no code change: the >= already does the right thing. You have not seen this test fail, so do what the Predict question said. In checkout/pricing.py change net_kobo >= FREE_DELIVERY_FROM to net_kobo > FREE_DELIVERY_FROM and run cycle "c3 mutant" 6. You should see assert 150000 == 0 for the exact-threshold line and 1 failed, 3 passed. Put >= back and run cycle "c3 restored": 3 passed. The test can fail, and it guards the boundary.5. Cycle 4: the distance limit. Another pair, either side of 15 km:
def test_free_delivery_stops_beyond_15_km():
assert delivery_charge(net_kobo=3_000_000, distance_km=15) == 0
assert delivery_charge(net_kobo=3_000_000, distance_km=16) == 500_000cycle "c4 red"assert 0 == 500000 on the 16 km line and 1 failed, 3 passed: today the rule gives free delivery at any distance. Add the limit. After FREE_DELIVERY_FROM put FREE_DELIVERY_UP_TO_KM = 15, and change the condition to if net_kobo >= FREE_DELIVERY_FROM and distance_km <= FREE_DELIVERY_UP_TO_KM:. Run cycle "c4 green": 4 passed. The 500,000 is the 5 to 40 km band from DELIVERY_BANDS, so you took it from the existing rule, not from the new code.6. Cycle 5: wire it into the quote, then pin the net-goods decision. The rule exists but price_cart does not call it. Add imports and a test at the top and bottom of the file:
from datetime import datetime, timezone
from checkout.pricing import Line, delivery_charge, price_cart
NOW = datetime(2026, 11, 23, 9, 0, tzinfo=timezone.utc)(replace the first line of the file with the block above, keeping the blank lines) and append:
def test_the_quote_waives_delivery_for_a_big_basket():
quote = price_cart([Line(2_500_000, 1)], distance_km=3, now=NOW)
assert quote.delivery_fee == 0
assert quote.total == quote.net + quote.vatcycle "c5 red"assert 150000 == 0, with the Quote(subtotal=2500000, tier_discount=125000, ... net=2375000, ... delivery_fee=150000, ...) printed in the where line, and 1 failed, 4 passed. In price_cart change fee = delivery_fee(distance_km) to fee = delivery_charge(net, distance_km) and run cycle "c5 green": 5 passed.Now record the business decision from the opening story. Append:
def test_the_threshold_is_on_net_goods_after_the_tier_discount():
# a subtotal of N20,500 is over the line; after the 5% tier discount the net is N19,475
quote = price_cart([Line(2_050_000, 1)], distance_km=3, now=NOW)
assert quote.net == 1_947_500
assert quote.delivery_fee == 150_000cycle "c5b green at once"6 passed, at once, because the wiring used net. This test is green without code, and that is deliberate: it is there so nobody changes net to subtotal later without a red bar. To check it can fail, change delivery_charge(net, distance_km) to delivery_charge(subtotal, distance_km) in price_cart: this test goes red with assert 0 == 150000. Restore it.7. Cycle 6: an edge the first five missed, and a refactor. Ask what happens with a bad distance. delivery_fee refuses a negative one, but the new rule returns before it gets there. Append (and add import pytest after the datetime import):
def test_a_negative_distance_is_refused_even_for_a_big_basket():
with pytest.raises(ValueError, match="distance cannot be negative"):
delivery_charge(net_kobo=3_000_000, distance_km=-1)cycle "c6 red"Failed: DID NOT RAISE <class 'ValueError'> and 1 failed, 6 passed. This is the bug from the opening story, found in a minute. Fix it and tidy in one move: ask delivery_fee first, so it validates the distance, and then decide. Replace the body of delivery_charge with:
def delivery_charge(net_kobo: int, distance_km: int) -> int:
fee = delivery_fee(distance_km) # also refuses a negative distance
if net_kobo >= FREE_DELIVERY_FROM and distance_km <= FREE_DELIVERY_UP_TO_KM:
return 0
return feeRun cycle "c6 green": 7 passed. Then the whole unit folder: .venv/bin/pytest tests/unit -q -p no:randomly gives 17 passed.
8. Read your cycle log.
cat tdd-log.txt9. A second change, with FakeClock: a promo grace window. Nekesa asks that an order started before HARMATTAN ends may finish up to 30 minutes after Lagos midnight, because payments take time. Write the tests first. Create tests/unit/test_promo_grace.py:
from datetime import datetime, timezone
from checkout.clock import FakeClock
from checkout.pricing import PROMOS, promo_applies
HARMATTAN = PROMOS["HARMATTAN"]
def test_promo_is_live_in_its_last_minute():
# 22:59 UTC is 23:59 in Lagos on 31 December
clock = FakeClock(datetime(2026, 12, 31, 22, 59, tzinfo=timezone.utc))
assert promo_applies(HARMATTAN, clock.now())
def test_an_order_ten_minutes_past_midnight_still_gets_the_promo():
clock = FakeClock(datetime(2026, 12, 31, 22, 59, tzinfo=timezone.utc))
clock.advance(minutes=11) # 00:10 in Lagos on 1 January
assert promo_applies(HARMATTAN, clock.now()).venv/bin/pytest tests/unit/test_promo_grace.py -q -p no:randomly1 failed, 1 passed: the first test is green already (the existing code handles Lagos midnight), the second fails with assert False and a where now = <checkout.clock.FakeClock object ...>.now line. Now the obvious implementation. In checkout/pricing.py, add timedelta to the datetime import, add GRACE = timedelta(minutes=30) under DELIVERY_FAR_FEE, and change the first line of promo_applies’s body to day = (now - GRACE).astimezone(LAGOS).date(). The file now says 2 passed.Add the other edge of the grace, and then the one that your obvious implementation gets wrong. Append:
def test_the_grace_ends_after_thirty_minutes():
clock = FakeClock(datetime(2026, 12, 31, 22, 59, tzinfo=timezone.utc))
clock.advance(minutes=31) # 00:30 in Lagos on 1 January
assert not promo_applies(HARMATTAN, clock.now())
def test_the_grace_does_not_start_the_promo_late():
clock = FakeClock(datetime(2026, 11, 30, 23, 10, tzinfo=timezone.utc)) # 00:10 on 1 December in Lagos
assert promo_applies(HARMATTAN, clock.now()).venv/bin/pytest tests/unit/test_promo_grace.py -q -p no:randomly1 failed, 3 passed: the 30-minute test passes, and the last one fails. Shifting now back by the grace moved the start of the promo as well as its end, so an order at 00:10 on 1 December is told the promo has not begun. Only a test at the other end of the window could catch it. Fix it by applying the grace to the end only. Replace promo_applies with:
def promo_applies(promo: Promo, now: datetime) -> bool:
"""Is the promo live at `now`? Days are Lagos days (UTC+1, no DST).
The last day runs GRACE past midnight; the first day starts on time."""
started = now.astimezone(LAGOS).date() >= promo.starts_on
not_over = (now - GRACE).astimezone(LAGOS).date() <= promo.ends_on
return started and not_overRun the file again: 4 passed. Then the unit folder: 21 passed.
10. A spike where TDD does not fit. Marketing wants the checkout page to show whether delivery is free. You do not know what it should say or how it should look, so you do not write a test. Check the ports first, since the lab documents 8094 for the checkout API and 8095 for the fake provider:
lsof -i :8094 -i :8095If both are free, start the apps in two terminals (if a port is busy, use 8194 and 8195, and set PROVIDER_URL to match):
export CHECKOUT_DB="$PWD/scratch/spike.sqlite"
.venv/bin/uvicorn fake_provider.app:app --port 8095
.venv/bin/uvicorn checkout.api:app --port 8094Then edit the PAGE string at the bottom of checkout/api.py. Add <p id="delivery" role="note"></p> above the result paragraph. Add this function above the click handler and an input listener, and reload http://localhost:8094/ in your browser. Change the wording three times:
async function preview() {
const r = await fetch("/cart/price", {method: "POST", headers: {"Content-Type": "application/json"},
body: JSON.stringify({lines: [{product_id: Number(product.value), qty: Number(qty.value)}], distance_km: 3})});
const q = await r.json();
delivery.textContent = q.delivery_fee === 0 ? "Delivery is free" : `Delivery ${q.delivery_fee / 100} NGN: free over 20,000 NGN`;
}
qty.addEventListener("input", preview);curl -s -X POST localhost:8094/cart/price -H 'Content-Type: application/json' -d '{"lines":[{"product_id":1,"qty":2}],"distance_km":3}' returns "delivery_fee":0, and with product_id 2 it returns "delivery_fee":150000. You learned the wording and the endpoint needed no change in minutes, which a test written first could not have told you. Stop both servers with Ctrl-C.11. Throw the spike away and test what it showed. Stop both servers (Ctrl-C in each terminal). Restore the page and keep one test of the behaviour the page depends on, through the API:
cp scratch/api.py checkout/api.pyCreate tests/integration/test_free_delivery_api.py:
import pytest
from fastapi.testclient import TestClient
from checkout.api import create_app
from checkout.search_index import SearchIndex
@pytest.fixture
def client(db, payments, clock):
return TestClient(create_app(db, payments, clock, SearchIndex()))
def test_the_price_endpoint_waives_delivery_over_the_threshold(client):
body = {"lines": [{"product_id": 1, "qty": 2}], "distance_km": 3} # 2 x N12,000
assert client.post("/cart/price", json=body).json()["delivery_fee"] == 0.venv/bin/pytest -q35 passed, 1 skipped, 1 deselected: the starter 23, your 7 free-delivery tests, your 4 grace tests and your 1 API test. The skipped one is the browser test (no Chromium installed); the deselected one is the quarantined flaky test. You tested the rule, which is stable, and not the markup, which you will change tomorrow.12. Put the lab back. Later chapters count tests from the clean state.
cp scratch/pricing.py checkout/pricing.py
cp scratch/api.py checkout/api.py
unset CHECKOUT_DB
rm -rf scratch tdd-log.txt tests/unit/test_free_delivery.py tests/unit/test_promo_grace.py tests/integration/test_free_delivery_api.py
.venv/bin/pytest -q23 passed, 1 skipped, 1 deselected, the starter state.Break it further. In your promo change, replace (now - GRACE) in the not_over line with (now + GRACE) and, before you run the unit folder, write down which tests you expect to fail. Then run it. (Two fail: the 23:59 test and the 00:10 test, because adding the grace pushes the last minute of 31 December into 1 January, which is past the end. The wrong direction moved the promo’s end earlier and your tests said so.) Now change GRACE to 20 minutes without touching a test: does anything fail? (Nothing does: the tests at 00:10 and 00:30 both agree with a shorter window.) What does that tell you about where the suite pins the window? Add a test at 00:25 Lagos that expects the promo to be live, watch it fail, and restore 30. Put everything back before you move on.
Hamisi has two tasks this week at Tallowmere. One is a new rule: prescription refills may be re-ordered no more than once every 21 days. The other is a redesign of the order-confirmation page, whose layout the designer has not finalised. He has five days, a nine-engineer team and a habit of writing the test first for everything. A colleague says the habit is wasting time on the page; another says skipping it on the rule is how Monday's bug happened.
- BOOK Test-Driven Development: By Example Kent Beck, 2002
The source. Read Part I with a pencil and run each step; it is the best demonstration of step size in print. Read: Part I, the money example (chapters 1 to 17), for the loop done slowly and the names fake it, triangulate and obvious implementation . Skip Part II, the xUnit implementation, unless you want to build a test framework..
- POST Test Driven Development Martin Fowler, 2005
A short statement of the loop, with the list of cases before it and a warning about skipping the refactor step. Read it in five minutes; it is a summary, not an argument.
- TALK Is TDD Dead? Kent Beck, David Heinemeier Hansson and Martin Fowler, 2014
A five-part recorded conversation, with minutes, on confidence, test-induced design damage, feedback, and the cost of testing. Start with parts 1 and 2 for the disagreement about design; the later parts matter more once you have run a team.
- PAPER A Dissection of the Test-Driven Development Process: Does It Really Matter to Test-First or to Test-Last? Fucci, Erdogmus, Turhan, Oivo and Juristo, 2016
Evidence that step size and rhythm mattered more than the order of test and code in the data they studied. Read it to see how the claim is built and how far it reaches. Read: The abstract and the discussion section. Skip the statistical models unless you read that kind of paper..
- PAPER Realizing quality improvement through test driven development: results and experiences of four industrial teams Nagappan, Maximilien, Bhat and Williams, 2008
The best-known industrial comparison: fewer defects, longer development. Read the threats section to see why the result is suggestive, not a proof. Read: The abstract, and the section on threats to validity. The publisher may ask you to sign in for the full text..
- TALK TDD, Where Did It All Go Wrong Ian Cooper, 2017
A conference talk whose title names its subject: where TDD practice goes wrong. The page was not checked against the talk itself, so watch it after the lab and judge it against the tests of yours that broke on a refactor.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.