nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

What does entry/exit coverage measure? #398

Closed hingen closed 1 year ago

hingen commented 1 year ago

In the textbook, it is mentioned that:

Entry/exit coverage measures coverage in terms of possible calls to and exits from the operations in the SUT.

I'm a bit confuse with what it measures exactly.

Suppose we are testing a method. By "calls to", is it referring to every possible combination of input arguments? And by "exits from", is it referring to every possible return value?

damithc commented 1 year ago

@hingen Entry points refer to all places from which the method is called from the rest of the code i.e., all places where the control is handed over to the method in concern. Exit points refer to points at which the control is returned to the caller e.g., return statements, throwing of exceptions

hingen commented 1 year ago

I see, thanks prof!