Ideas from TPRC2022: Tools to help refactor large mature code bases
Every Perl gig I have ever had, and from most of the conversations I had at this years Perl and Raku Conference, was working on a large code based that is serving the business and it's customers very well such that the business is profitable (i.e. a mature code base).
This is an enviable position to be in but whilst this software is robust from the outside, there is often a reluctance to make dramatic changes. Unfortunately code that is perceived as too fragile to touch tends to be replaced and replaced in another language.
We have frameworks for testing (Test:: etc) and linting (Perl::Critic) with suites of well established reusable polices, so why not a similar framework for refactoring?
Such a tool might have provided polices to assist replacing deprecated syntax, migrate between "Try" implementations, fixing up scalar vs list context, just to name a few.
Achieving a 100% successful transition on any given code base is probably unrealistic, being able to produce diffs that can be accepted by human review 80%+ of the time would present excellent value.
I see this as being very similar to unit testing - consider that whilst some functionality in a codebase may be extraordinarily challenging to write tests for, this shouldn't be an excuse to write no tests at all. Achieving an 80% test coverage might be considered outstanding and provide enormous value.
Perhaps folks already have something they can publish to CPAN or just throw up on Github to socialize ideas? What's your thoughts?