Model Online / On-Site
Duration
Modules 5 modules

Course Objective & Scope

In growing codebases, high cyclomatic complexity, duplicated logic and undocumented side effects slow down feature delivery—yet asking an LLM to rewrite working code without a safety net invites regressions. This course combines objective static analysis with disciplined, test-backed AI refactoring.

Identifying hotspots via SonarQube/linter metrics and Git churn, mapping dependencies and side effects with LLMs, generating characterization tests before touching code, applying structured refactoring patterns with coding agents, and resolving N+1, memory and algorithmic bottlenecks are practised hands-on.

Who Should Attend?

  • Software developers and senior engineers
  • Tech leads and software architects
  • Teams maintaining and evolving brownfield enterprise codebases
  • Prerequisite: experience with object-oriented or functional programming and unit testing

Key Takeaways

  • Prioritise high-impact technical debt by combining static complexity metrics with Git churn
  • Map control flow, hidden state and side effects in undocumented modules using LLMs
  • Generate characterization (golden master) tests that lock in current behaviour before refactoring
  • Decompose large functions and god-classes in small, behaviour-preserving commits
  • Fix database query, memory and concurrency bottlenecks backed by profiling evidence

Curriculum

Codebase Comprehension and Technical Debt Hotspots
  • Selecting targets with cyclomatic/cognitive complexity, coupling and Git churn data
  • Extracting call graphs and implicit business rules from unfamiliar code with LLMs
Code Smell Detection and Architectural Boundary Analysis
  • Spotting god classes, long methods, primitive obsession and layer leaks
  • Triaging static analysis findings (SonarQube, ESLint, Ruff, Roslyn) with AI
Building the Safety Net: Characterization Tests
  • Generating snapshot and golden-master tests before touching untested legacy code
  • Locking in edge cases and existing error behaviours
Step-by-Step Behaviour-Preserving Refactoring
  • Extract method/class, guard clauses, strategy patterns and isolating pure functions
  • Keeping structural refactoring commits strictly separate from behaviour changes
Performance Analysis and Resource Optimisation
  • Identifying N+1 ORM queries, redundant serialisation, memory leaks and async blocking
  • Before/after benchmarking and regression-free delivery

Other Courses in This Category

Get in touch