ITPEC IP October 2024 Question 50

Which of the following is the appropriate explanation of refactoring?

Explanation

Improving internal architecture without changing functions — refactoring keeps the software's external behavior identical.

Refactoring reorganizes code (removing duplication, splitting long functions, clarifying names) so it is easier to read and maintain, while the functions the software provides stay exactly the same. Tests are run before and after to confirm the behavior has not changed.

Answer (a)

Why not others:

  • •(b) — deriving specifications by analyzing how existing software works is reverse engineering
  • •(c) — correcting a defect so the software meets its specifications is debugging, or corrective maintenance, and it changes behavior
  • •(d) — adding a requested function changes what the software does, so it is enhancement, not refactoring

Key rule: Refactoring changes the inside and never the outside; any change to what the software does, whether a fix or a new feature, is something else.

Software Development Management Techniques · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.