Skip to main content

Reference Pointers

This is the module's "read only if stuck" layer. If the concept page and practice pages have done their job, you should not need most of these links. Use this page when a specific move's mechanics are not landing, or when a reviewer asks "where does this pattern come from?" and you want the canonical source.

Source Roles in This Module

BookRoleCluster(s) used
Refactoring (Fowler)Primary -- the canonical catalog1, 3, 4, 5
Working Effectively with Legacy Code (Feathers)Selective support -- seams and characterization2
Clean Code (Martin)Selective support -- naming and function length pressure3
Good Code, Bad Code (Hansen)Selective support -- engineering-judgment framing1, 3, 4
Head First Design Patterns, OOADBackground -- the design destinations many refactors head toward4

Read Only If Stuck -- by Cluster

Cluster 1: The Refactoring Discipline

If you cannot articulate why behavior preservation is the non-negotiable property:

If "when to refactor" is still vague:

If a manager is blocking you and you want the argument:

Cluster 2: Tests as a Safety Net

If the value of self-testing is not yet obvious:

If you've never written a characterization test:

If you've never introduced a seam:

  • martinfowler.com/bliki/LegacySeam.html -- modern retelling with code
  • Feathers, Working Effectively with Legacy Code, ch. 4 "The Seam Model" and ch. 25 "Dependency-Breaking Techniques" (external book)

Cluster 3: Fundamental Refactor Moves

When the mechanics of Extract Function fight you:

When Inline Function is the right answer and you cannot justify it:

When you reach for Rename and the scope is unclear:

When Change Function Declaration feels risky:

When Move Function's steps blur together:

When Split Phase vs Extract Function is ambiguous:

When Encapsulate Record seems like ceremony:

When Replace Primitive with Object pays back less than expected:

Cluster 4: Reorganizing Data and Logic

When Decompose Conditional seems redundant:

When consolidating guards or flattening nests:

When Replace Conditional with Polymorphism's recurrence requirement is unclear:

When you can't decide between Parameter Object and Preserve Whole Object:

Cluster 5: Refactoring Large Changes and Rollout

When a refactor is too big for a single commit:

When the system is too large to refactor in place:

When a manager pushes back on incremental structural change:

Optional Deep Dive

You can ignore this section entirely and still pass the module. Open one of these only if a specific question keeps returning after you've worked the concept and practice pages:

Concept-to-Source Map

A compact crosswalk. Every primary concept maps to at least one chunk.

ConceptTypePrimary chunk(s)
01 Refactoring is behavior preservationPRIMARY013
02 The two hatsPRIMARY013, 014
03 When to refactorPRIMARY015, 016
04 Characterization testsPRIMARY032, 035
05 Legacy seams and enabling pointsPRIMARY032 + martinfowler.com/bliki/LegacySeam.html
06 Test granularitySUPPORTING033, 036
07 Extract Function / Inline FunctionPRIMARY038, 039, 040
08 Extract Variable / Rename / Change DeclarationPRIMARY041, 043, 045
09 Move Function / Move Field / Split PhasePRIMARY056, 058, 048
10 Encapsulate Record / Replace PrimitivePRIMARY049, 052
11 Replace Conditional with PolymorphismPRIMARY068, 069
12 Parameter Object / Preserve Whole ObjectSUPPORTING045, 074
13 Decompose / Consolidate ConditionalSUPPORTING066, 067
14 Branch by Abstraction / Parallel ChangePRIMARY020 + external Fowler bliki
15 Strangler refactorsSUPPORTING019 + external Fowler bliki / articles