Cyclomatic complexity and basis path
问题 Lets, consider we have the following method: public void testIt(boolean a, boolean b){ if (a && b){ ... } if (a){ .... } } Cyclomatic complexity of this method =3. So, according to basis path testing we should have 3 tests in order to achieve statement and decision coverage. However, I see that I can use only two tests (true, true) and (false,false) to achieve statement and decision coverage. Where is my mistake? 回答1: answer from @OldFox is correct, just some additions: Where is my mistake?