Skip to main content

Small Refactor Moves Workshop

Attempt these tasks before opening feedback. Preserve initial predictions, diffs, commands, actual results and assistance. Reuse valid lab evidence; extra lesson drills are repair or optional depth.

P06: Extract without changing traversal​

Extract per-line rounding from the supplied invoice while keeping its loop and event order. Save the smallest checked diff.

P07: Inline an effectful argument​

Show why square(nextValue()) cannot simply become nextValue()*nextValue(). Give a preserving transformation.

P08: Rename a published API​

Plan expansion, caller migration and retirement of an old method name used by a scheduled external job.

P09: Split phase with error order​

Split price_order while preserving the X 2x failure. Explain what the intermediate record must retain.

P10: Inspect value-wrapper compatibility​

Wrap an organization record and list observations beyond property reads that may change.

Use the behavior contracts and offline labs. For a named gap, consult the Refactoring book index and module reading guide.