Skip to main content

Learning Resources

This module is populated from the local chunked books in library/raw/semester-03-software-design/books plus a small, validated set of external Fowler / Feathers resources. Use this page as a source map, not as an instruction to read everything.

Source Stack

BookRoleHow to use it in this module
Refactoring: Improving the Design of Existing Code (Fowler, 2nd ed.)Primary teaching sourceDefault escalation for any named refactor move, mechanics, and tradeoff reasoning
Working Effectively with Legacy Code (Feathers)Selective supportSeams, enabling points, and characterization-test discipline
Clean Code (Martin)Selective supportNaming and function-length pressure -- argument for why small-function style is worth the ceremony
Good Code, Bad Code (Hansen)Selective supportEngineering-judgment framing for when a move pays vs. when it does not
Head First Design PatternsBackground onlyPatterns enabled by refactoring; primary home is S3M3/S3M4

Resource Map by Cluster

Cluster 1: The Refactoring Discipline

NeedBest local chunkWhy
precise definition of refactoring + two hatsRefactoring ch. 2 intro: Defining Refactoring and The Two HatsCanonical definition and the hats metaphor in Fowler's own words
why refactor at allRefactoring ch. 2: Why Should We Refactor?Summary of benefits; keep this short
when to refactorRefactoring ch. 2: When Should We Refactor? (Part 1)Rule of three, preparatory, comprehension, litter-pickup
when to refactor -- trade-offsRefactoring ch. 2: When Should We Refactor? (Part 2)Planned vs opportunistic plus how to argue for refactoring to managers
when refactoring gets hardRefactoring ch. 2: Problems with Refactoring (Part 1)Slows-me-down myths and database/published-API issues

Cluster 2: Tests as a Safety Net

NeedBest local chunkWhy
why refactoring needs testsRefactoring ch. 4: Value of Self-Testing CodeFoundational argument for self-testing
first test example and fixtureRefactoring ch. 4: Sample code and a first testConcrete first-test walkthrough
adding tests and boundary probingRefactoring ch. 4: Modifying the Fixture and Probing the BoundariesCharacterization-test discipline in action
what "enough tests" meansRefactoring ch. 4: Much More Than ThisCoverage without perfection

Cluster 3: Fundamental Refactor Moves

NeedBest local chunkWhy
Extract Function mechanicsRefactoring ch. 6: Extract Function (Part 1)Canonical motivation and simplest case
Extract Function with local variablesRefactoring ch. 6: Extract Function (Part 2)How to handle captured state
Inline FunctionRefactoring ch. 6: Inline FunctionInverse move and when indirection does not pay
Extract VariableRefactoring ch. 6: Extract VariableLocal naming as intent
Change Function DeclarationRefactoring ch. 6: Change Function DeclarationMigration-friendly signature change
Rename VariableRefactoring ch. 6: Rename Variable and Introduce Parameter ObjectScope-aware renaming
Move FunctionRefactoring ch. 8: Move Function (Part 1)Feature-envy remedy
Move FieldRefactoring ch. 8: Move FieldData-sided feature envy
Split PhaseRefactoring ch. 6: Split PhaseSequential-concerns separation
Encapsulate RecordRefactoring ch. 7: Encapsulate Record (Part 1)Raw record -> class
Replace Primitive with ObjectRefactoring ch. 7: Replace Primitive with ObjectMost undervalued move per Fowler

Cluster 4: Reorganizing Data and Logic

NeedBest local chunkWhy
Decompose ConditionalRefactoring ch. 10: Decompose ConditionalSingle-conditional cleanup
Consolidate / Guard ClausesRefactoring ch. 10: Consolidate Conditional Expression and Replace Nested Conditional with Guard ClausesCombining same-result guards; flattening nests
Replace Conditional with Polymorphism (Part 1)Refactoring ch. 10: Replace Conditional with Polymorphism (Part 1)Recurrence-rule and motivation
Replace Conditional with Polymorphism (Part 2)Refactoring ch. 10: Replace Conditional with Polymorphism (Part 2)Worked example with subclasses
Introduce Parameter Object (second half of the chunk)Refactoring ch. 6: Rename Variable and Introduce Parameter ObjectBoth moves live in this chunk
Preserve Whole ObjectRefactoring ch. 11: Preserve Whole ObjectPass the whole, not pieces

Cluster 5: Refactoring Large Changes and Rollout

NeedBest local chunkWhy
Refactoring and architectureRefactoring ch. 2: Refactoring Architecture and YAGNIWhy structural change belongs in incremental refactoring
Refactoring and performanceRefactoring ch. 2: Refactoring and PerformanceThe "performance panic" objection answered
Problems with refactoring (part 3)Refactoring ch. 2: Problems with Refactoring (Part 3)Branches, published APIs, and long-lived migrations

External Resources

All URLs validated on module creation; re-check before assigning.

Exercise Support Chunks

Use these when the concept pages are understood but your fluency is weak:

Use Rules

  • If you are unsure which move applies, read the Fowler chunk for two plausible moves and compare their motivations.
  • If the concept page's mechanics are enough to execute the move, do not open the source chunk. The source is reinforcement, not a second syllabus.
  • If you catch yourself reading a whole chapter end-to-end, stop. You are shifting from "learn the move" to "survey the book." They are different tasks.
  • Official-looking external pages (martinfowler.com, refactoring.com, refactoring.guru) are preferred over third-party summaries. Refactoring.guru is specifically cited for its animated walkthroughs; its prose is a second pass, not a first.