Skip to content

PumukyDev/white-box-testing-cc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

White Box Testing – CC

Objective

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;
}

Documentation

You can view the documentation explaining the cyclomatic complexity analysis in PDF or the web page version

License

This project is under MIT License

About

White-box testing using Cyclomatic Complexity (CC)

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •