Software Development and Project Management
In agile development methods such as Extreme Programming (XP), what is the activity of reorganizing the internal structure of a program so that it is easier to understand and change, without changing its externally visible behavior?
- APair programming
- BReverse engineering
- CRefactoring
Show answer and explanation
Answer: C. Refactoring
Refactoring improves the structure of code without changing its function, for example by merging duplicated code, splitting long functions and choosing clearer names. To confirm that the behavior has not changed, automated tests are prepared and run after each small change. Pair programming is an XP practice in which two people write a program together at one computer. Reverse engineering is analyzing an existing program to uncover its specification and design.
- A. This is an XP practice in which two people write a program together at one computer, one typing and the other reviewing.
- B. This is analyzing an existing program or binary to uncover its specification and design.
- C. Correct. The structure of the code is improved while its externally visible behavior is kept.
Continue: 9 more Software Development and Project Management questions