#45coding & debugging

Refactor Legacy Code Safely

Improves structure while preserving externally visible behavior.

0 views 0by @yazeed
Base prompt
Refactor this legacy module for [maintainability goal]. First map its callers, side effects, data contracts, and existing tests. Identify the smallest sequence of changes, add only tests that protect meaningful behavior, and implement one slice at a time. Remove dead code, preserve APIs and output, and run relevant checks after each slice. Show a concise diff summary and any behavior that could not be verified.

Follow-up steps

  1. 1

    Refine and verify

    Tests the output against the original goal and improves its practical usefulness.

    step 1
    Review the final diff for unintended behavior changes, public API changes, and unused code.

Comments0

Sign in

No comments yet.