ITPEC FE Morning April 2023 Question 51
As for software development activities, which of the following is refactoring?
Explanation
Changing the internal structure without changing the external specifications — refactoring improves maintainability while the program keeps behaving the same.
Refactoring, a core practice of XP and agile development, cleans up code in small steps: removing duplication, splitting long methods, renaming unclear identifiers. After each step the tests are re-run to confirm that the external behaviour has not changed.
Answer (a)
Why not others:
- •(b) — two programmers coding one program together is pair programming
- •(c) — building an early version to get user feedback is prototyping
- •(d) — writing the test cases before the code is test-driven development (test first)
Key rule: If the external specification changes, it is not refactoring; automated regression tests are what make refactoring safe.
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 FE past-paper collection or Report an issue.