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

Workshop: Using TDD to Get Better Results From ...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Clare Sudbery Clare Sudbery
April 13, 2026
6

Workshop: Using TDD to Get Better Results From LLMs or AI

These slides are for a 90-minute-long workshop at the SoCraTes UK Training Day, on 18th June 2026 (https://socratesuk.org/training_day.html).

How can you use an LLM to build reliable software? Is it even possible? Are the extravagant claims, both for and against, realistic?

If you combine tests and XP rigour with the efforts of an AI coding assistant, what you can get is something very powerful. This workshop will give you the to start building a very simple app using tests, process files and AI… as well as show some of the potential pitfalls.

Avatar for Clare Sudbery

Clare Sudbery

April 13, 2026

Transcript

  1. @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
  2. 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
  3. USE SOURCE CONTROL github.com/claresudbery/ai-tdd-workshop • So… Either FORK my repo

    • …or create your own repo • (there’s no working code in mine • - just reference files • - so you can just copy files from there) @ClareSudbery
  4. @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
  5. @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!
  6. Halfway (ish) Start a new chat context …because in the

    real world, projects are shared and contexts are lost @ClareSudbery
  7. RESULTS • Who completed part 1? • Who completed the

    extension? • What problems did you encounter? • Who's happy with the result? What did you like? • If you were successful, why do you think that is? @ClareSudbery
  8. CODING WITHOUT TESTS • Does your solution work? • How

    do you know it works? • How will you know if it's broken? • What if you start a new session and continue? • What if you want to add new features? @ClareSudbery
  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 LLM-AUGMENTED CODING: GOLDEN RULES 1. Don't write code (first

    draft) if AI can do it for you 2. Consider a small language model 3. Ask WHY 4. Beware confirmation bias (in both directions) 5. Explore ways of measuring effectiveness
  11. @ClareSudbery CONCLUSIONS • Golden rules apply to people as well

    as LLMs! • Gotchas (exercise caution – I ain’t no cheerleader): • Confirmation bias • Context impacts code • Security • Out of date technologies • Data protection • Ethics • How much power the LLM has (to commit, edit, etc) • Environmental impact (small language models)