Refactor verification

Investigating how to verify the correctness of refactors

Table of contents

  1. Introduction
  2. Early returns
  3. AST rewriting
  4. Refactor rules
  5. Real world case studies
  6. Libraries of refactors

def hello(world) -> None:

I fancied investigating some ways to verify the correctness of a code refactor.

Here I discuss the considerations for any potential solution, and explore different options, demonstrating them with minimal code examples.

The goal is to lighten the cognitive load associated with verifying rewrites 'manually' (i.e. mentally).

Thanks for reading! 🚀