This repository aims to refactor a slightly modified version of TaskList for teaching refactoring. The refactored code addresses numerous code smells present in the original implementation, including:
- Broken encapsulation
- Data classes
- Divergent change
- Feature envy
- Long method
- Duplicate code
- Switch statements
- Primitive obsession
The code to refactor is available here.
The following refactoring techniques were used:
- Move method
- Replace temp with query
- Rename method
- Extract method
- Extract interface
- Replace data value with object
- Introduce local extension
- Introduce assertion
- Replace Constructor with Factory Method
- This repository does not implement any feature mentioned in the original TaskList repository.
- This repository does not implement solitary unit-tests. All the unit-tests are sociable.
I published an article titled "Refactoring Mindset" - a deliberate and proactive approach to consistently improve your code. The article is available here.