DSA Factory
Free SOLID and design smells lessonsSOLID and design smells · Stage 2 · Spotting trouble · Step 2

Design smells and refactoring

The patterns that tell you a design is going wrong, and the small, safe refactoring that answers each. About 13 minutes.

Quick check

What is the defining property of a refactoring?

  1. AIt changes the structure of the code without changing its observable behaviour
  2. BIt adds a new feature
  3. CIt makes the program faster
Show the answer

It changes the structure of the code without changing its observable behaviour. Tests should pass before and after.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve