Industry testing

if(condition1)
    dosomething1();
if(condition2)
    dosomething2();
if(condition3)
    dosomething3();

This is a complete branch test if there are two test cases in this example.

  • condition1 = condition2 = condition3 = true;
  • condition1 = condition2 = condition3 = false;

Or did I misunderstand this? Trying to figure out the difference between testing branches and paths. I am getting path testing, so I hope this is correct.

+1
source share
6 answers

Branch Testing:

Testing in which all branches of the program source code are checked at least once.

Yes; You are doing proper branch testing, as all of your branches hit. In fact, you can delete your second test case, as case 1 executes all branches.

, , , , , , .

+3

, ,

. IF TRUE FALSE,

, IF.

, :

IF "A > B"

A , B

ENDIF

, 100% - :

1: A = 5, B = 2, true.

2: A = 2, B = 5, false.

, 1, 2 .

1 .

+2

100% - , . - ( ), . , , .

1: , ( TTT). .

2: , () , FTT .

3: , TFT . .

4: , , TTF . .

, : TTT, FTT, TFT TTF. , .

, - .

( http://www.codign.com/pathbranchcode.html)

+1

, !

: " . • ( DD-path) (, if case)? , if, , ? , ?"
: https://en.wikipedia.org/wiki/Code_coverage

- Georgia Tech Computer Science , .

: https://www.youtube.com/watch?v=JkJFxPy08rk

+1

If I understand what you're asking, then you may need eight test cases to fully cover the alternatives in this code. For example, what if you dosomething2()rely on some other state configured on dosomething1()? Your test cases will not understand this requirement.

0
source

Yes, you understand correctly. Testing branches is simply "all branches are running."

0
source

All Articles