Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SAG: How Can You Combine AI With Test Driven De...

Avatar for Clare Sudbery Clare Sudbery
November 21, 2025
9

SAG: How Can You Combine AI With Test Driven Development?

(These slides are from the day-long workshop at Software Architecture Gathering, Berlin, Monday 24th Nov 2025.)

Even Kent Beck is vibe coding these days. But how can you create robust maintainable systems, if you didn’t write the code yourself?

Software engineers are, rightly, always looking for quicker more efficient ways of working. But sometimes they adopt false economies and end up having to work harder and more slowly as a result. One of the ways this can happen is by forgetting to write tests. Another way this can happen if by relying too heavily on the outputs of an AI coding assistant.

But if you combine TDD (Test Driven Development) with the outputs of an AI coding assistant, what you can get is something very powerful. This workshop will help participants build a very simple app using both TDD and AI.

Laptops required. Participants will work in pairs. Programming languages used will be the choice of the participants.

Avatar for Clare Sudbery

Clare Sudbery

November 21, 2025
Tweet

More Decks by Clare Sudbery

Transcript

  1. DEMO Q&A EXERCISE, PART ONE (30 mins) BREAK Agenda 9:00

    – 10:30 10:30 – 11:00 11:00 – 12:30 (60 mins) LUNCH 12:30 – 13:30 @ClareSudbery DISCUSSION EXERCISE CONT. WRAP-UP EXERCISE, PART TWO (30 mins) BREAK 13:30 – 15:00 15:00 – 15:30 15:30 – 17:00 ENDS 17:00
  2. @ClareSudbery Windsurf – free until you reach your token limit

    (which could happen during the day!) Cursor – free up to a limit, or if you have your own API keys from OpenAI or Anthropic (Claude) VSCode with GitHub CoPilot – free up to a limit Download a tool (if you haven’t already) One that will work in an integrated IDE
  3. @ClareSudbery 2 minutes Write your most optimistic LLM- coding goal

    on a sticky note What would be fun to build using LLM-augmented coding? Write clearly – people need to read it Add your name and remember what you wrote!
  4. @ClareSudbery YOU ARE LIKELY TO BE ABOUT TO MOVE SEATS

    Be prepared! And remember to introduce yourself… Name + role
  5. @ClareSudbery Walk around, waving your sticky note Find the person

    who wrote it Form a pair / three with them Introduce yourselves! Name + role
  6. All the resources we use today are available in the

    following GitHub repo: github.com/claresudbery/ai-tdd-workshop • Exercise descriptions (exercises folder) • Sample markdown (markdown folder) • Sample results (results folder) • Sample process files (process-files folder) @ClareSudbery
  7. @ClareSudbery Windsurf – free until you reach your token limit

    (which could happen during the day!) Cursor – free up to a limit, or if you have your own API keys from OpenAI or Anthropic (Claude) VSCode with GitHub CoPilot – free up to a limit Download a tool (if you haven’t already) One that will work in an integrated IDE
  8. @ClareSudbery Open the tool you’re going to be using Ask

    your AI to help you build the following tool: • Take a markdown file as input – see markdown folder in repo for a sample (sample-input.md) • The markdown file is text from a Slack channel. • There are also 28 sample reply threads, in sub-folder in markdown folder • You want the tool to identify reply thread insertion points, and insert each reply thread in the correct place • You want a nice UI that allows users to upload either all the relevant markdown files, or paste text in directly • (WARNING: Text copied from Slack will be ugly. The sample files have had some processing.) • The output should be a nicely formatted markdown file. • DON’T ATTEMPT TO WRITE CODE YOURSELF. NO TESTS UNLESS LLM SAYS SO! LLM IS IN CHARGE. • These instructions are available in the GitHub repo, in exercises/part1-basic.md. • If you finish this exercise and want more, see exercises/part1-extensions.md. • Go!
  9. @ClareSudbery LLM-AUGMENTED CODING: GOLDEN RULES 1. Encourage the LLM to

    ask clarifying questions 2. Move in small steps. Big steps feel fast but they quickly slow you down. 3. Always start with tests. - a. Ask the LLM to write tests before code. - b. Check and refine the tests. - c. Ask the LLM to make the tests pass by implementing the solution. - d. Keep running all tests to make sure nothing is broken. 4. Ask the LLM to summarise conversations. Persist those summaries in files. 5. Use a starter character in each process file. 6. Throw things away! Start again from scratch. Beware the sunk cost fallacy. 7. Regularly start a new chat context. 8. Be polite. Use "please" and "thank you".
  10. @ClareSudbery EXERCISE TWO STEP 1 • Get your LLM to

    help you summarise everything you’ve discussed so far, about what you’re building and how you want it to function • Persist the results – eg in a file called project_spec.md STEP 2 • Start again from scratch! • Delete everything except project_spec.md (or equivalent) • Start a brand new chat window. Try a different LLM if you can! • Tell the LLM you want to proceed using TDD (test driven development) • Ask it to read and follow instructions in testing_process.md and running-scripts.md or any other process files from the process-files folder in the GitHub repo. • Remember the golden rules. • These instructions are available in the GitHub repo, in exercises/part2.md.
  11. @ClareSudbery 2 minutes Write new stickies for either “INSPIRED” or

    “STILL SEEKING ANSWERS” Make sure you include the headings on the stickies! It will help me. Then stick them on the wall in the designated areas.