0

I have been reading a number of tutorials about condition and branch testing (coverage). All of them show simple examples, and mention the difference of condition and branch to be that in condition testing compound conditions are considered, and each elementary part of a condition should be tested for True and False. My main problem is that I do not have the big picture. Consider the image below:

enter image description here

I have a simple condition first, a compound condition and another simple condition. So to test conditions (which focuses on elementary parts of a compound condition), it seems I only need to find cases such as x=8 (TF) and x=0.5(FT). However, this seems to ignore other parts of my graph which have branches. Could you please help me understand?

PS. Should I start from statement coverage, and then add missing tests for branch (if required), and then add tests for elementary conditions (if required)?

0

What you need to do is to do a boundary analysis: Identify which values of your variables have different meanings/effects in the context of your program (in terms of branch execution - since the paths to states 6 and 7 result in the same code to be executed).

In this case, X may mean different things when:

  • It's lower than zero;
  • It's between zero and one (not including);
  • It's between one and four (not including);
  • It's between four and seven (not including);
  • It's bigger than seven;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.