Skip to content

Repository files navigation

Refactoring Real-World Code

CI

A deliberately messy order-pricing service alongside a behavior-preserving refactor. The repo is designed for reviewers to compare implementations and see why each change matters.

Portfolio signal

  • Demonstrates how to refactor under characterization tests instead of rewriting by instinct.
  • Preserves behavior while introducing a clearer domain model and service boundary.
  • Documents the progression so reviewers can judge the engineering decisions, not just the final code.

What to review

  • src/refactor_case/legacy.py for the starting point.
  • src/refactor_case/service.py and src/refactor_case/domain.py for the refactor.
  • REFACTORING_NOTES.md for the reasoning trail.

Quick start

pip install -e .[dev]
pytest -q

Refactoring progression

v0-legacy → characterization tests → domain model → strategy extraction → explicit validation → production-oriented service boundary. See REFACTORING_NOTES.md.

About

Behavior-preserving refactoring case study with characterization tests and a clearer domain model.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages