Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Analyzing Complexity and Design > The Response for Class metric

The Response for Class metric

The Response for Class (RFC) metric is the total number of methods that can potentially be executed in response to a message received by an object of a class. This number is the sum of the methods of the class, and all distinct methods are invoked directly within the class methods. Additionally, inherited methods are counted, but overridden methods are not, because only one method of a particular signature will always be available to an object of a given class.

Note

The Response Set (RS) of a class is a set of methods that can potentially be executed by an object of that class. RFC is the count of these methods belonging to the set.

Notice that a given method is counted only once even if it is invoked many times in the call graph as a response to a message. Classes with high RFC are more complex and prove to be difficult to debug and test, because of high cross-object communication and higher variance in the potential responses and call graphs, as responses to messages received by that class.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint