Skip to content
0%
0% of stage
Concept 2 min

TDD (Test-Driven Development)

In an agentic context, the test becomes the executable specification the agent uses to know whether it got it right.

In one sentence

Write the test before the code. In an agentic context, this matters even more because the test becomes the executable specification the agent uses to know whether it got it right, without depending on human judgment at every step.

Before

Criterion in someone’s head

What it does

Test written before the code

After

The agent checks on its own whether it got it right

Example

Before writing the generator, the test was written: given this report, the letter must mention the new school and must not mention the address.

With that, the agent has an objective target. It runs the test, sees red, fixes it, sees green. Without it, it needs a human saying “looks good” at every step, and then there’s no way to scale.

In practice

  • Write the criterion as an executable test before asking for the implementation.
  • A test that has never failed may not be testing anything. Break it on purpose once to check.
  • In an agentic context, the test is the specification the agent reads. Write for it.

How to make it tangible

Write the acceptance criterion as an executable test before asking for the implementation.

Translated from Portuguese with AI assistance.

To discuss

Is this already in place in your company? Compare with the criterion:

Done when: When the agent knows on its own whether it got it right, because it runs the test.