Exercises in this lecture               Go to the notes, in which this exercise belongs -- Keyboard shortcut: 'u'   Alphabetic index   Course home      

Exercise 14.2
Cyclomatic complexity of GCD


Find the cyclomatic complexity of Euclid's, gcd, function in this C program.

If possible, find test cases that allow you to test each independent path of the gcd function.

Independent paths are defined here in course material.

How many test cases do you actually need to cover all source lines of the gcd function?


Solution