Parvo Cure
Author: Jessica Yauney (jyauney@stanford.edu)
Description:
In the age of ubiquitous generative AI, it can be problematic to assign a project that can be easily completed by the tools the university gives students for free. However, it is also problematic if you expect novices to be able to generate code that these tools can't. This is an ambiguous programming project that makes requirements analysis, decomposition, testing, and communication the hard part. Because even when the code itself is small enough for a generative AI system to produce, it is important that students learn to create it themselves. Depending on how you want to approach the assignment you can frame it as a typical CS1 assignment that is far more AI-proof from an academic integrity perspective or a project that invites students to use AI but make sure they don't forget to do the thinking necessary.
In this themed assignment, students are tasked with creating a set of small code segments that manage the distribution of medicine for puppies
Students are rewarded for noticing what the prompt does not say, asking high-value questions, turning answers into precise contracts, and building tests that make their interpretation visible.
Metadata
| Summary | This assignment asks students to build a small multi-component ordering system for a fictional canine parvovirus treatment company. The programming tasks themselves are intentionally appropriate for CS1 and are within the range of what modern generative-AI tools can often produce. The learning challenge instead comes from incomplete, inconsistent, and ambiguous requirements. Students must identify risks, decide what needs clarification, use a limited number of questions for a person playing the Product Manager, document assumptions, decompose the system into separate components, and validate their interpretation with unit and integration tests. |
|---|---|
| Audience |
The assignment is intended for a CS1 course after students have learned basic control flow, functions or methods, collections, file input, and simple classes or modules. Students should also have had at least a brief introduction to automated testing. The project is especially suitable for courses reconsidering learning goals in the context of generative AI. Students may complete the implementation without AI, use AI only after requirements and design work, or use AI throughout while remaining responsible for evaluating assumptions, testing behavior, and explaining their decisions. |
| Difficulty |
The coding difficulty is intentionally moderate for CS1. Most individual components require straightforward use of conditionals, arithmetic, collections, file loading, and small classes or functions. The conceptual difficulty is higher because students must recognize ambiguity, prioritize questions, reason about interactions among components, and distinguish requirement problems from implementation problems. The assignment can be completed in a single 90–115 minute structured lesson with reduced implementation scope, or as a multi-day project with a complete implementation and larger test suite. |
| Topics | Requirements analysis; ambiguity and specification; program decomposition; classes and modules; dictionaries/maps; lists; CSV/file input; validation and exceptions; unit testing; integration testing; software interfaces; data flow; debugging; technical communication; metacognition; generative-AI-assisted programming. |
| Strengths |
The assignment shifts student attention from code production toward specification, design, testing, and communication. This makes it useful in an environment where code generation is increasingly inexpensive but evaluating whether generated code is correct remains essential. The limited Product Manager question budget encourages prioritization and strategic communication. Students must decide which uncertainties are important enough to spend a question on rather than asking for implementation help. The required separation into components makes program structure visible and creates natural opportunities for both unit and integration testing. Tests act as executable statements of what students believe the requirements mean. The intentionally imperfect data and requirements create productive ambiguity: students can discover inconsistencies before coding, during component testing, or when individually correct pieces fail to integrate. The same instructional structure can be reused with different themes, allowing instructors to preserve assessment and facilitation materials while changing the story or domain. |
| Weaknesses |
Some students may initially perceive intentionally ambiguous requirements as unfair if the instructional purpose is not explained clearly. The instructor must distinguish between productive ambiguity and arbitrary hidden expectations. Facilitation requires preparation: the Product Manager should use a consistent answer key, and instructors should avoid accidentally revealing teacher-only ambiguity notes. A single early interpretation can affect many downstream calculations. Grading therefore needs to avoid repeatedly penalizing the same root misunderstanding when the rest of a student's implementation is internally consistent. |
| Dependencies |
Students need a working Python or Java development environment. Starter ZIP files are provided for both languages, along with CSV data files, source-file scaffolding, and starter unit and integration tests. No external libraries are required. Python uses the standard library and If generative AI is part of the activity, instructors should specify when AI use is permitted and what planning, decision-log, testing, or reflection artifacts must be produced independently. |
| Variants |
The project can be run as a short in-class activity, a multi-day team project, a testing-focused exercise with partial implementations, or an AI-explicit assignment in which students evaluate generated code against their own requirements and tests. The same design can be remixed into other themes while preserving the underlying ambiguities and component interactions. Possible alternatives include:
Difficulty can be increased by reducing starter scaffolding, requiring students to design their own CSV schema, adding malformed input files, increasing the number of interacting components, or asking students to write acceptance tests for another team's implementation. |
| Teaching Notes |
The assignment works best when requirements analysis is treated as a first-class activity rather than a prelude to coding. Give students time to inspect the specification before they are allowed to ask Product Manager questions or begin implementation. The instructor should resist answering engineering questions in the Product Manager role. A useful response is: “That is an engineering decision; what product behavior do you need clarified?” Encourage students to record assumptions and connect each important requirement to at least one test. During integration, ask students to identify whether a failure comes from code, an interface mismatch, or a disagreement about the specification. If AI is allowed, a productive structure is to require students to freeze an ambiguity log, question list, architecture sketch, and initial tests before using a code generator. The debrief can then focus on where generated code made unsupported assumptions and how testing exposed them. |
Small calculators, table lookups, and simple classes are exactly the kinds of tasks that help CS1 students practice. They are also the kinds of tasks modern code-generating tools can often complete from a prompt. That means that instructors have some interesting tradeoffs to consider. Instead of making the entire grade based on a pencil and paper test in class, this lesson invites you to change the focus of the assignment. It provides a prompt that AI says it can generate code for, but that requires a human touch. The important questions become:
- What did the customer actually mean?
- Which assumptions did the implementation silently make?
- How should a system be decomposed?
- What evidence would convince us that the system works?
Students translate vague prose into explicit decisions, data contracts, and testable behavior. Small components are separated, named, and integrated. The architecture is visible enough to discuss in CS1. Each team gets a limited number of clarifying questions. The limit forces prioritization toward the unknowns that create the greatest risk. Unit tests document local decisions and integration tests expose mismatches between components.
Assignment arc
- Read an intentionally imperfect specification. The requirements contain omissions, contradictions, stale wording, suspicious data, and undefined terms.
- Spend the question budget. Teams have a designated amount of time and number of questions for the person playing Product Manager (the teaching team).
- Commit to an interpretation. Teams record product answers plus assumptions for anything still unresolved.
- Build in components and test at two levels. Each subsystem lives in its own file/class; students write unit tests and integration tests.
- Run acceptance tests and retrospect. Initial failures are treated as evidence about requirements and interfaces, not merely as coding mistakes.
What is included in this activity (and what is not)?
The site contains
- A student brief
- Java and Python starter packages
- An instructor ambiguity map
- Facilitation notes
- Remix ideas
- A rubric
Options
- An instructor may ban AI, permit it after the requirements phase, or allow it throughout. The learning target remains the student's ability to own the specification, design, and evidence.
- You can assign this as an individual assignment or a group assignment
- You can do it in class or for homework
- You can create intense time pressure or not
- You can use this as a formative or summative assessment
- You can be transparent about the ambiguity or not.