Refactoring Fundamentals
By Steve Smith
Refactoring is a critical developer skill that helps keep code from collapsing under its own weight. This course covers when and how to refactor code, as well as a wide variety of "code smells" that may indicate some refactoring is warranted. The course concludes with a refactoring kata that students can perform on their own to practice their refactoring skills.
Course info
Rating
Level
Intermediate

Updated
Dec 13, 2013

Duration
8h 1m

Table of contents
Introducing Refactoring
Introduction
2m
What is Refactoring?
4m
Why Should You Refactor?
2m
Technical Debt
2m
When Should You Refactor
5m
Refactoring Principles
2m
The Refactoring Process
2m
Demo: Characterization Tests
3m
Refactoring Tips
1m
Refactoring Tools
2m
Premature Optimization
1m
Refactoring and Tests
1m
Demo: A Simple Refactoring
3m
Summary
1m
Bloating Code Smells
Introduction
1m
Code Smells
2m
Principle of Least Surprise
1m
Organizing Code Smells
1m
The Bloaters
1m
Long Method
4m
Long Method Examples
19m
Primitive Obsession
6m
Long Parameter List
7m
Data Clumps
2m
Combinatorial Explosion
2m
Oddball Solution
1m
Class Doesn't Do Much
0m
Required Setup/Teardown Code
1m
Summary
1m
Obfuscating Code Smells
Introduction
1m
The Obfuscators
1m
Regions
5m
Comments
8m
Poor Names
9m
Vertical Separation
1m
Inconsistency
1m
Obscured Intent
1m
Summary
1m
Object Orientation Abuser Code Smells
Introduction
1m
Switch Statements
5m
Temporary Field
4m
Alternative Classes with Different Interfaces
2m
Class Depends on Subclass
4m
Inappropriate Static
1m
Summary
2m
Code Smells: Change Preventer
Introduction
1m
Change Preventers
1m
Divergent Change
1m
Shotgun Surgery
1m
Parallel Inheritance Hierarchies
2m
Inconsistent Abstraction Levels
2m
Conditional Complexity
6m
Poorly Written Tests
1m
Summary
1m
Code Smells: Dispensables
Introduction
1m
The Dispensables
0m
Lazy Class
1m
Data Class
3m
Duplicate Code
2m
Dead Code
2m
Speculative Generality
2m
Summary
1m
Code Smells: The Couplers
Introduction
1m
The Couplers
1m
Feature Envy
4m
Inappropriate Intimacy
2m
Law of Demeter
4m
Indecent Exposure
1m
Message Chains
1m
Middle Man
1m
Tramp Data
1m
Artificial Coupling
1m
Hidden Temporal Coupling
3m
Hidden Dependencies
5m
Summary
2m
Environment and Testing Code Smells
Introduction
1m
Environment Smells
8m
Test Smells
2m
Not Enough Tests
2m
DRY vs. DAMP
2m
Fragility
16m
The Liar
1m
Excessive Setup
1m
The Giant
1m
The Mockery
1m
The Inspector
1m
Generous Leftovers
2m
The Local Hero
1m
The Nitpicker
1m
The Secret Catcher
1m
The Loudmouth
1m
The Greedy Catcher
1m
The Sequencer
0m
The Hidden Dependency
1m
The Enumerator
1m
The Stranger
1m
The OS Evangelist
1m
Success Against All Odds
1m
The Free Ride
1m
The One
1m
The Peeping Tom
1m
The Slow Poke
1m
The Contradiction
1m
Roll the Dice
6m
Hidden Tests
2m
Second Class Citizens
1m
Wait and See
2m
Inappropriate Test Group
1m
The Optimist
1m
The Sleeper
1m
The Void
0m
Summary
1m
Method Refactorings
Introduction
1m
Extract Method
2m
Rename Method
3m
Demo: Extract and Rename Method
5m
Inline Method
2m
Introduce Explaining Variable
2m
Inline Temp
1m
Replace Temp with Query
1m
Demo: Replace Temp with Query
3m
Split Temporary Variable
2m
Parameterize Method
1m
Replace Parameter with Explicit Methods
2m
Add Parameter
1m
Remove Parameter
3m
Separate Query from Modifier
4m
Summary
1m
More Method Refactorings
Introduction
1m
Preserve Whole Object
3m
Replace Parameter with Method
2m
Introduce Parameter Object
2m
Remove Setting Method
2m
Hide Method
1m
Replace Constructor with Factory Method
3m
Replace Error Code with Exception
3m
Remove Assignments to Parameters
1m
Replace Exception with Test
2m
Replace Method with Method Object
5m
Compose Method
3m
Substitute Algorithm
3m
Summary
1m
Class and Object Refactorings
Introduction
1m
Encapsulate Field
2m
Encapsulate Collection
3m
Move Field
2m
Move Method
5m
Extract Class
3m
Inline Class
2m
Extract Interface
2m
Extract Subclass
3m
Extract Superclass
4m
Hide Delegate
2m
Remove Middle Man
2m
Summary
1m
Class Hierarchy Refactorings
Introduction
1m
Pull Up Field
2m
Push Down Field
2m
Pull Up Method
3m
Push Down Method
2m
Collapse Hierarchy
3m
Replace Inheritance with Delegation
4m
Replace Delegation with Inheritance
3m
Replace Type Code with Class
5m
Replace Type Code with Subclasses
3m
Replace Conditional with Polymorphism
4m
Summary
1m
Pattern-Based Refactorings
Introduction
1m
Encapsulate Classes with Factory
4m
Form Template Method
5m
Introduce Null Object
5m
Move Accumulation to Visitor
8m
Move Embellishment to Decorator
7m
Replace Conditional Dispatcher with Command
6m
Replace Conditional Logic with Strategy
6m
Replace State-Altering Conditionals with State
8m
Replace Type Code with State (or Strategy)
4m
Unify Interfaces with Adapter
8m
Summary
1m
Gilded Rose Kata
Description
Course info
Rating
Level
Intermediate

Updated
Dec 13, 2013

Duration
8h 1m

Description
Refactoring is a critical developer skill that helps keep code from collapsing under its own weight. Learn how to recognize "code smells" that may indicate the need for refactoring, the refactoring process, and when and how to apply specific refactorings to your code.
About the author