miss_hit icon indicating copy to clipboard operation
miss_hit copied to clipboard

Improvement of cyclomatic complexity to more accurately estimate number of equivalence classes for testing

Open andybacchus opened this issue 4 years ago • 0 comments

Cyclomatic complexity is based on the control flow of graph of the program. As a result of that the cyclomatic complexit of the following two pieces of code are different. a)

if x>b
y = x^2;
else
y = -x^2;
end

b)

y = single(x>b)*x^2 - single(x<=b)*x^2;

However both pieces of code would require the same number of tests to cover all equivalence classes.

An improved metric which treats these as being equally complex would be very useful.

andybacchus avatar Apr 09 '20 12:04 andybacchus