Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andybacchus opened this issue Apr 9, 2020 · 0 comments
Labels
component: sem Affects semantic analysis difficulty: extreme This change requires significant language/algorithm/architecture design requires: sem Change can only be implemented once semantic analysis works tool: mh_metrics Affects the code metrics tool

Comments

@andybacchus
Copy link

andybacchus commented Apr 9, 2020

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.

@florianschanda florianschanda added tool: mh_metrics Affects the code metrics tool difficulty: extreme This change requires significant language/algorithm/architecture design labels Apr 9, 2020
@florianschanda florianschanda added the component: sem Affects semantic analysis label Aug 17, 2020
@florianschanda florianschanda added the requires: sem Change can only be implemented once semantic analysis works label Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sem Affects semantic analysis difficulty: extreme This change requires significant language/algorithm/architecture design requires: sem Change can only be implemented once semantic analysis works tool: mh_metrics Affects the code metrics tool
Projects
None yet
Development

No branches or pull requests

2 participants