CS FundamentalsHardProduct-company placement

How many of these refactoring statements are correct? 1. A refactoring must not change the observable behaviour of the code. 2. A good test suite is the safety net that makes refactoring safe. 3. Fixing a bug while restructuring code still counts as a pure refactoring. 4. Refactoring in small, separately committed steps makes problems easier to find and undo.

  1. A. 1
  2. B. 2
  3. C. 3
  4. D. 4

Correct answer: C. 3

1, 2 and 4 are correct. Fixing a bug changes behaviour, so it should be a separate change from the restructuring; mixing them makes it unclear which change caused what.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic