![]() However, on stackoverflow in chat with one user I was said that the CC of this code = 4 (he used the third method) and the following image by that user was provided: So according to this rule CC = two if conditions +1 =3. For switch/caseĬonstructs, the default block does not count. Ladder if constructs, the final else does not count. Switch/case constructs, each case block counts as one. The if statements,įor, while, and do/while constructs, each count as one. The branching and looping constructs and add 1. So, a simple rule of thumb is this: Count Now, this is all simple enough for a small, modest method like this.įor larger functions, drawing the graph and doing the calculation from The rule of thumb is from Testing for ISTQB Advanced Level Technical Test Analyst vol 3 book: Let's suppose we have the following code: public void testIt(boolean a, boolean b).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |