CS FundamentalsVery hardProduct-company placement · GATE CS

Class Cart has 5 methods. Together they call 9 methods of other classes, of which 7 are distinct. What is its Response For a Class (RFC) = number of own methods + distinct methods directly called?

  1. A. 14
  2. B. 12
  3. C. 7
  4. D. 5

Correct answer: B. 12

RFC = 5 + 7 = 12. Each called method is counted once however often it is called, so using all 9 calls (14) is wrong. A high RFC means more potential behaviour to understand and test.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic