miss_hit
miss_hit copied to clipboard
Improvement of cyclomatic complexity to more accurately estimate number of equivalence classes for testing
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.