This project demonstrates white box testing, focusing on cyclomatic complexity (CC) analysis. It evaluates the number of independent paths through a simple function that determines whether a person is an adult based on their age. The aim is to understand the code's structure, identify the decision points, and determine the minimum number of test cases needed to cover all execution paths.
The cyclomatic complexity analysis is based on the following JavaScript function:
function isAdult(age) {
if (age >= 18) {
console.log("It is an adult");
return true;
} else if (age < 0) {
console.error(`The age "${age}" is incorrect`);
}
return false;
}You can view the documentation explaining the cyclomatic complexity analysis in PDF or the web page version
This project is under MIT License