Demo: an AI-assisted refactor of the order saga under green tests
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
refactor the Shop order saga orchestrator with AI. Prepares MID-072-LAB1.
Draft outline details
Step by step
- Confirm the tests and contract tests are green; add a characterization test for compensation.
- Prompt with goal, the saga class, its tests, and constraints; ask for a plan of small steps.
- Apply step one (extract state transitions); run tests; commit.
- Planned mistake: accept a large AI diff that also "simplifies" retry logic; a test fails because compensation order changed. Fix: reject and redo as small steps.
- Ask AI for edge-case tests; discard one that only restates the code; run mutation tests.
- Write the PR description with the prompt log and accepted and rejected suggestions.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.