Notifications
Clear all
Topic starter
16/08/2026 4:10 pm
We inherited a legacy codebase with a single function spanning 10k lines. It handled everything from data validation to API calls to file I/O. Unreadable, untestable.
Used Aider's `/test` to add pytest cases for the few known outputs, then `/extract` to pull out logical blocks into separate functions. Key was using `--yes` on the initial refactor commands after verifying the proposed changes looked safe. It took a few hours, but the function is now under 500 lines and modular. Biggest win was Aider kept the tests passing after each extraction. No license issues for this internal use case.