๐ WAYPOINT LESSON
Designing from a spec
โญโญโญ advancedโณ 10 min read๐ Lesson 191 of 256
One method per spec bullet, guards stated in one sentence, and every transition driven to every boundary.
Designing from a spec. The exam hands you a class diagram or a prose spec; your implementation is graded behavior-by-behavior. The workflow:
- List the fields with types (from "the register tracks..." โ a count? a list? a total?).
- One method per bullet in the spec; do not invent extras the spec did not name (the rubric cannot award them).
- State the guard for each transition in one sentence before coding ("arrive fails when full OR plate already present").
- Order of events: a scoreboard that processes a foul then a goal is a different state than goal-then-foul only if the spec says order matters โ decide, then code.
And the testing discipline: after implementing, drive every transition to every boundary โ full, empty, duplicate, missing โ because the hidden tests were written by someone who thought of them first.
โก Now practice
Ready to CodeState machine labThree class designs driven to every boundary; state transitions are the whole exam.
3 challenges ยท ยท ~65 min