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.
- A. 1
- B. 2
- C. 3
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A structure chart shows a date-formatting utility called by 14 modules (high fan-in) and a controller module that calls 23 different…
- A team keeps postponing cleanup of a hard-coded module: each new feature touching it now takes three days instead of one. In the…
- A UML state machine has the transition Idle → Processing labelled 'submit [cart not empty] / validateCart()'. What do the three parts mean?
- A team draws one UML diagram showing which artefacts (JARs, containers) run on which nodes (servers, devices) and how the nodes…
- Using Robert Martin's Stable Dependencies Principle, package A has instability I = 0.2 and package B has I = 0.8. Which dependency…
- What is the cyclomatic complexity of this function, counting each simple condition separately and each loop header as one decision? python…