All topics

Coding with AI: verify, test, review

Learners use AI to help write code, then read, test, security-check, and explain every line before they trust it.

Outline

Who it is for: Pioneers and adults who can write and test Python without AI and want to use AI coding tools without shipping unsafe or wrong code. Not for Builders.

AI tools write code that looks correct and often is not. Code that runs can still leak data, trust bad input, or fail on the cases nobody tested. A large test of AI models found security flaws in almost half of their code, and developers say their top problem is answers that are “almost right”. At the end, the learner can read AI-written code, test it against the spec, find security flaws, and explain why they accept or reject it.

This module is about checking, not generating. Learners spend most of the time reading, testing, debugging, and reviewing. Each AI-assisted task ends with tests, a security look, and an explanation in the learner’s own words.

AI policy: this module is for Pioneers and adults who have passed the Python 3 checkpoint without AI. The module checkpoint and any capstone defence are done without AI: learners trace, test, and fix code by hand and explain it aloud.

Planned lessons

  1. Why AI code must be read before it runs
  2. Reading and tracing AI code line by line
  3. Writing a clear spec, with tests, before you ask
  4. Writing tests that find the cases AI missed
  5. Debugging AI code that is almost right
  6. Reviewing an AI change as a Git diff
  7. Spotting insecure code: input, secrets, and injection
  8. Checking the packages and licences that AI suggests
  9. Running untrusted code safely
  10. AI agents: prompt injection and giving tools too much power
  11. Explaining AI code in your own words, or rejecting it
  12. A small project: specify, test, review, and document

Teach it as

One sessionRead an AI-written function and predict what it does, write three tests for it, find one bug and one security flaw, and explain the fix, in one 2 hour class. Use printed AI answers if there is no internet.
One dayMorning: reading and tracing AI code, and writing tests from a spec. Afternoon: spotting insecure code, reviewing an AI change as a Git diff, and explaining it.
One weekDay 1: reading and tracing AI code, and writing a clear spec. Day 2: writing tests and finding the cases AI missed. Day 3: debugging AI code and reviewing changes as diffs. Day 4: security review, packages, and running code safely. Day 5 (Build and Show): checkpoint without AI, then each learner shows a small project, its tests, its review notes, and explains every line.

Know this first

Standards this follows

Videos to download

No videos listed yet.