Refactoring Fundamentals
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.
What you'll learn
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.
Table of contents
- 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
- 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
- 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
- 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
- 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
- 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
- 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