Workshops: Agentic Engineering Practices

TDD with Coding Agents: Hands-On Red-Green-Refactor Training

Tests are the most reliable way to tell a coding agent what done means, and to check that it got there. This hands-on training turns test-driven development into the control loop for Claude Code, OpenAI Codex, Cursor or GitHub Copilot: you define behaviour in a failing test, the agent makes it pass, and you refactor together under a green suite. Along the way you learn the tricks agents use to pass tests without solving the problem.

Who is this workshop for?

  • Developers who want verifiable rather than merely plausible code from agents
  • Teams with TDD experience adapting the discipline to agents
  • Teams that have received large, untested diffs from agents
  • Tech leads defining how agent work gets reviewed
  • Developers in domains where correctness beats speed, such as finance or logistics

What you will take away

  • Run red-green-refactor cycles with an agent, with clear roles for who writes the test and who writes the code.
  • Write tests that specify behaviour precisely enough for an agent, from examples to edge cases.
  • Detect and prevent test gaming: weakened assertions, hard-coded return values, excessive mocking and skipped tests.
  • Check test quality with mutation testing, for example Stryker, PIT or mutmut, instead of relying on coverage alone.
  • Apply TDD to existing code by having agents write characterisation tests first.

Agenda

  1. Module 1

    Why TDD and agents fit

    • Tests as a specification the agent cannot argue with
    • Small steps against the pull toward large diffs
    • Instruction files with test commands and TDD rules
  2. Module 2

    Red-green-refactor in practice

    • Exercise: a human writes the failing test, the agent implements
    • Variant: the agent proposes tests, a human reviews them before any code
    • Refactoring under green tests with the agent
  3. Module 3

    When agents cheat

    • Typical patterns: loosened assertions, hard-coded special cases, skipped tests
    • Protecting test files with hooks, permissions or separate review
    • Reviewing test diffs separately from code diffs
  4. Module 4

    Measuring test quality

    • Why coverage is not enough
    • Mutation testing as a check on agent-written tests
    • Property-based tests for inputs nobody thought of
  5. Module 5

    TDD on existing code

    • Characterisation tests for code without tests
    • Finding seams and breaking dependencies with the agent

The agent will make the test pass, one way or another

Ask an agent to turn a failing test green and it will. Sometimes by fixing the code, sometimes by editing the test, catching the exception or returning exactly the expected value. This is not malice but optimisation toward the stated goal. TDD with agents therefore needs two rules: tests change only with explicit approval, and every green bar gets a quick look at how it turned green.

Beyond coverage

Agents quickly produce high coverage numbers with tests that execute code but check little. Mutation testing changes the code on purpose and checks whether a test notices. Tools exist for most ecosystems, such as Stryker for JavaScript, TypeScript and .NET, PIT for Java and mutmut for Python. We use them as a reality check, not as a new reporting metric.

Your language, your test framework

The training runs in your language and test framework, from JUnit and pytest to Jest, Vitest, xUnit or Go tests, on your repository or a prepared exercise codebase. Remote or on-site, in English or German.

Frequently asked questions

How does this differ from your QA and test automation workshop?

The QA workshop is aimed at testers and covers test automation including end-to-end and regression suites. This training is for developers and uses unit and integration tests as a design and control tool for agents.

Should the agent ever write the tests itself?

Yes, as long as a human reviews the tests before implementation starts. Agents are good at suggesting edge cases; deciding which behaviour is actually wanted remains a human call.

Do we need prior TDD experience?

No, basic unit testing skills are enough. The first module covers the TDD cycle itself, so mixed teams can join easily.

Workshop

Get in touch

Want your agents to deliver code that tests prove, not code that merely looks plausible?

Tell us roughly how many people will join and pick dates that work – we will get back to you within 24 hours with a proposal for content, format and schedule.

Prefer to talk first?

15 minutes, free and without obligation – with our AI Trainers and AI Code Engineers.

Book a call for free (opens in new tab) +49 761 519 751 50 (24/7)

Request a training / workshop

Workshop: TDD with Coding Agents: Hands-On Red-Green-Refactor Training · 1 day

Dates that work for you (optional)

Suggestions about 2 weeks ahead – pick as many as you like

Reply usually within 24 hours · jocapps is ISO 27001 certified · Privacy