Code quality and technical debt

Response for a class

Also known as Response for a class, Response for a class in software engineering

By WeavePublished 1 min read

Definition

A measure of the number of methods potentially executed in response to a message received by a class.

What it means

Response for a class, or RFC, counts a class’s methods plus methods that its methods may invoke, according to a tool’s relationship rules. A large response set can indicate broad behavior and testing surface. Because counting transitive calls can vary, teams must document whether external, inherited, and recursive calls are included.

Example

A service class exposes eight methods, each invoking several policy and persistence methods. Its response set is large enough that a small change requires many behavioral checks, motivating a review of responsibility boundaries.

Limitations

RFC can be inflated by framework callbacks, utility calls, or shared services. A high count is not proof of poor design, and a low count does not guarantee understandable behavior. Use representative call paths when deciding what to change.

How to use the signal

Inspect representative call paths because a transitive count can be inflated by shared utilities and framework callbacks.

Weave can relate large response sets to review duration and rework in affected pull requests. The analysis tool owns call-graph construction; Weave helps the team see how the signal behaves in its delivery workflow.

How this relates to Weave

Weave can relate large response sets to review duration and rework in affected pull requests. The analysis tool owns call-graph construction; Weave helps the team see how the signal behaves in its delivery workflow.

Explore Engineering intelligence

Sources and further reading

  1. Martin Fowler, Refactoring and software design