Refactor a Tangled Java Pricing Engine With Design Patterns
Overview
What this challenge is about.
Start from a provided Java 21 codebase with the legacy PricingEngine class, 38 example fixtures (input cart, expected price), and one failing test demonstrating a bug from last quarter. Decompose into: a PricingRule interface (Strategy), composable PriceModifier decorators for promotions, and a chain for sequential customer-tier discounts. Maintain a single integration test that compares old vs. new prices on the 38 fixtures to enforce zero behavior change. Add unit tests per pattern (minimum 80 percent line coverage). Deliver: refactored code (Git PR-ready), JUnit 5 test suite, 6-page design doc with UML class diagram, and a 1-page reviewer-friendly diff summary.
The Brief
What you'll do, and what you'll demonstrate.
Refactor a 4,800-line pricing class into a clean OO design using Strategy, Decorator, and Chain of Responsibility with provable zero behavior change.
Earning criteria — what you'll demonstrate
- Apply Strategy, Decorator, and Chain of Responsibility on a real codebase
- Maintain zero behavior change during a structural refactor
- Translate an if/else chain into a polymorphic, testable design
- Author a design doc with UML that a reviewer can act on
Program Fit
Where this fits in your program.
Sharpens the same skills your degree expects you to demonstrate.
Skills
Skills you'll demonstrate.
Each one shows up on your verified credential.
Careers
Roles this prepares you for.
Real titles. Real skill bridges. Pick the one closest to your trajectory.
Career mappings coming soon.