Teaching students to work with AI
AI assignment ideas for computer science
Your students have a coding agent that writes better first-draft code than most of them. That’s not the crisis it looks like - but it does mean the assignments have to move.
Computer science is further into this than any other discipline. The tooling is genuinely good, professional practice has already shifted, and “write a function that does X” stopped being assessable some time ago.
The useful reframe: your students are going to spend their careers reviewing, debugging and taking responsibility for code they didn’t write. That was already true before AI - it’s what working on a team means. AI just moved it from year three of their job to week three of your course.
Reading code you didn’t write
1. The plausible bug
Give students AI-generated code that passes the obvious tests and fails on something specific - an off-by-one at a boundary, an unhandled empty input, a race under concurrency, integer overflow at scale. They find it, explain why it happens, and write the test that would have caught it.
Grade the test, not the fix. Anyone can patch a line; writing the test that exposes the class of bug is the skill.
2. The security review
AI-generated code with a real vulnerability - SQL injection through a concatenated query, a missing authorization check, a secret in the source, unsafe deserialisation. Students identify it, rate the severity, and say what an attacker would actually do with it.
3. It works, but it won’t scale
Code that is correct and quadratic where it should be linear, or that loads an entire table into memory. Students profile it, explain the complexity, and rewrite the hot path. The correctness is a distraction, which is the point.
Design, which is still the hard part
4. The interface before the implementation
Students design an API or module boundary and defend it before writing any code - what’s exposed, what’s hidden, what happens when a caller misuses it. Then they have AI implement it. Grade the design and the revisions they made after seeing it built.
5. Two architectures, one constraint
Give a system requirement where two reasonable designs exist and one constraint makes the choice non-obvious - a hard latency budget, an offline requirement, a compliance boundary. Assign a side. Grade the tradeoff reasoning.
6. The requirement that isn’t stated
A spec with a gap: it doesn’t say what happens when two users edit at once, or when the network drops mid-write. Models fill these silently with a plausible default. The assignment is noticing the gap and deciding deliberately.
When the fundamentals are the point
Introductory courses have a legitimate case for restriction. A student who never writes a loop by hand doesn’t build the mental model that later lets them read one quickly. But the restriction has to be observable - it has to happen in lab, on paper, or in a setting you can see.
7. Trace it by hand
Give code and ask for the state of every variable at each iteration. Do it in class. It takes ten minutes and tells you more about who understands pointers than a week of submitted assignments.
8. Explain it to the rubber duck
Students explain their code line by line to an AI character playing a confused junior who keeps asking why. Shallow understanding collapses in about four questions.
Working with the agent itself
9. The specification exercise
Students write only the prompt, not the code. Grade the prompt: does it state the constraints, the edge cases, the performance requirement, the interface? Then run it and compare what came back against what they intended.
10. Take responsibility for it
Students submit AI-generated code with a signed statement: what it does, what it doesn’t handle, what they verified and how, and what they’d want reviewed before it shipped. This is the actual professional artifact, and almost nobody teaches it.
On autograders
Test-passing autograders are now close to useless as an integrity mechanism, because passing tests is the one thing these tools do reliably. They’re still fine as feedback. Just don’t mistake a green suite for evidence that a student understands anything.
Common questions
Should I ban Copilot in CS1?
You can, in lab and on exams, where you can see it. A take-home ban is unenforceable and mostly penalises the honest. Structure the course so the graded moments that matter happen where you’re watching.
Doesn’t this make the course harder?
For students, yes - reviewing code is genuinely harder than writing it. That’s the argument for teaching it rather than the argument against.
What about students who want to learn to code without AI?
Give them the trace-by-hand and from-scratch work in lab, where it’s protected. The two aren’t in conflict; they just need different settings.
How do I generate the seeded bugs?
Ask a model to write the solution, then ask it to introduce a subtle bug of a specific class. Verify the bug yourself before assigning - it sometimes introduces a different one than you asked for, which is its own lesson.
See what this looks like in a real assignment
Kova turns a sentence into immersive, auto-graded coursework - AI conversations students have to argue their way through, models they build and defend, transcripts scored on the reasoning rather than the artifact.
The full guideHow Conjure builds itRequest a demoKeep reading
- Teaching students to work with AI · the full guide
- AI in group work
- AI policy for your syllabus