To cover all branches of a method’s logic flow, it is necessary to make a test for each if-statement, switch-case, logic operator (&&, ||), etc. Dependent on the number of branches a method consists of its cyclomatic complexity will rise or fall. A cyclomatic complexity of ten means that the method has ten possible branches.
The McCabe testing strategy describes that for each branch in the method, there should be a test method testing and verifying the output of that branch. Pitest does not actually refer to the McCabe testing strategy, but as we will see it ensure that, the developer writes code, which follows the same guiding principle. I will come back to Pitest later in the article.