Appearance
Lesson 11 — Prove invariants and run deliberately
Where this lesson fits: the core loop works. This lesson turns "it seemed fine when I played" into a repeatable verification and launch routine.
Time: 2–3 hours
Prerequisites and outcomes
Complete lessons 01–10. By the end, you can select the narrowest relevant test, run the solution and smoke checks, and tell a build problem from a runtime problem.
Prepare and run
Reuse the tutorial chapter 08 project prepared in lesson 10. Read tutorial chapter 09; it adds no files and shares chapter 08's build.
From your learner project's solution folder, run:
powershelldotnet test --filter FullyQualifiedName~LearningPlan3CaptureTests dotnet build dotnet test dotnet run --project Platforms\DesktopVK -- --smoke-test-seconds 2Confirm the focused filter discovers both tests from lesson 07. The total
dotnet testcount will be two higher than the unmodified snapshot if you kept those tests.For a repository-maintenance link check, open a separate terminal at the course repository root, then run:
powershellpython scripts\check_doc_links.pyThe checker covers tracked Markdown, not untracked LP3 files.
Optional contributor operation:
.\scripts\TestChapterProjects.ps1, run from the repository root, first regenerates chapter snapshots and then builds, tests, and smoke-runs them. It writes generated repository files and can take a long time. Do not run it if you have snapshot changes you need to keep; back up work and read getting started first.
Guided operations
- In
Tests\Systems\LearningPlan3CaptureTests.cs, temporarily change the expected region size from10to11. Rundotnet test --filter FullyQualifiedName~MultipleEnemyFreeRegions_ChooseTheSmallestand observe the failure. Restore10, rerun the same command, and identify the region-selection operation. - Run a focused system suite before the full solution suite.
- Build, run the bounded smoke check, and inspect exit status separately. A successful build alone does not prove a graphical host starts.
- In the course repository, open
scripts\chapter-manifest.jsonandscripts\generate_chapters.py. Generated source is not edited by hand. - Run the Markdown link check after documentation edits.
Checkpoint
Record the exact command, pass/fail result, and invariant checked. Demonstrate that a failure can be reproduced without relying on an unspecified manual sequence.
Common mistakes
- Running only the full test suite and losing the fast feedback of a focused test.
- Treating a compile pass as proof that the game window can launch.
- Editing generated snapshot files instead of their source or manifest and regenerating.
Questions and extension
Which critical app-level operations currently have fewer automated checks than pure systems? Propose one behavior-focused test for death/respawn, pause flow, or level completion.

