Skip to content

A3 — Refactoring to Patterns

Task

Start from working code with a genuine design problem. Refactor incrementally toward an appropriate pattern or pattern composition.

Requirements

  • define the motivating change scenario;
  • characterize existing behavior with tests;
  • show the refactoring sequence as individually reviewable steps;
  • identify preconditions and risk at each step;
  • measure at least two relevant structural/quality properties before and after;
  • explain whether the final canonical pattern form is necessary;
  • include a git history that makes the sequence inspectable.

Evaluation principle

Pattern conformance is secondary to behavior preservation, improved changeability, and justified structure.