thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Foundational

Refactoring

Restructuring existing code to improve readability, maintainability, or performance without changing its external behavior.

Definition

Refactoring is safe when backed by automated tests and is the third step of the TDD cycle. It reduces technical debt.

Example

Extracting duplicated device-login code into a reusable connect() function.

Exam tip

Refactoring must not change behavior; tests prove that.

Related terms