CS FundamentalsVery hardProduct-company placement

Code smells: in system X, adding a new payment type forces small edits in eight classes. In system Y, the class Report is edited for database changes, for new export formats and for tax-rule changes. Which smells are these?

  1. A. X is divergent change; Y is shotgun surgery
  2. B. X is feature envy; Y is a god class
  3. C. X is shotgun surgery; Y is divergent change
  4. D. Both are shotgun surgery

Correct answer: C. X is shotgun surgery; Y is divergent change

Shotgun surgery is one change scattered over many classes; divergent change is one class changed for many unrelated reasons (an SRP violation). They are mirror images, which is why the names are often swapped.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic