Refactoring and code quality
T-Level: Digital Production, Design & Development: Refactoring and code quality
What you'll learn
- 1
Imagine you have a messy wardrobe 🧥👗👟. Refactoring is like tidying it up — you don't throw anything away, you just organise it so you can find things faster.
- 2
What does refactoring do to your code?
- 3
Here's a messy bit of code. Drag the lines into a better order to group related things together.
- 4
Let's refactor this code together — it calculates the total cost of items in a basket.
- 5
Now you try — rename this variable to something clearer: oldName = 'Alice'
- 6
Why is 'user_name' better than 'x' for storing a person's name?
- 7
True or false: Refactoring can introduce new bugs if you're not careful.
Practise Refactoring and code quality with Whizlo
Free AI-tutored lessons, unlimited practice questions, and progress tracking for ages 16–18. Aligned to the UK National Curriculum.