This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 1: Software refactoring exercise

Preparation

face Josiah Wang Rob Chatley

This exercise supplements my live lectures on software refactoring in Week 5.

I will assume that you have already attended/watched the live lecture, or already know what Template Method and Strategy Patterns are.

Just like my live coding session in the lecture, you now have the chance to refactor some code using the Template Method Pattern and the Strategy Pattern.

Many thanks to Robert Chatley for allowing me to reuse this exercise from his Software Engineering Design course. I have adapted the code to Python and reworked it to suit my needs.

Do try this exercise yourself first and not just look at the solutions! Trying to refactor the code yourself is very different from just reading the solutions!