All mock tests are FREE till 31 December — register to save your progress
Unit 6 · Software Engineering Paper 2 CS · July 2018

Consider the following statements:
P: Refactoring is the process of changing a software system in such a way that it does not alter the external behaviour of the code yet improves the internal architecture.
Q: An example of refactoring is adding new features to satisfy a customer requirement discovered after a project is shipped.
Which of the above statements is/are true?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. P only

Explanation

The answer is P only. P is Fowler's standard definition of refactoring: the observable behaviour of the system is preserved while the internal structure is cleaned up, for example by extracting a method, renaming a variable or removing duplication. Q is false, because adding a new feature changes what the software does and is therefore enhancement (perfective maintenance), not refactoring. Since exactly one statement is true, options (2), (3) and (4) are ruled out.

More Software Engineering questions