Skip to content
Ameen Abozaid
Planned lessonMID-072-L06

Demo: an AI-assisted refactor of the order saga under green tests

  • Lesson 6 of 6
  • Mid-level
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

  1. Confirm the tests and contract tests are green; add a characterization test for compensation.
  2. Prompt with goal, the saga class, its tests, and constraints; ask for a plan of small steps.
  3. Apply step one (extract state transitions); run tests; commit.
  4. 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.
  5. Ask AI for edge-case tests; discard one that only restates the code; run mutation tests.
  6. 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.