[Solved]: In control flow graphs, what is the difference between a path and a branch?

Problem Detail: I’m studying for an exam on software testing and in my notes I found this:

Many more paths than branches. A pragmatic compromise will be needed 

I cannot understand the difference between paths and branches; each time I work out the paths and branches of a graph I end up with the same number. Thanks!

Asked By : Jurgen Camilleri

Answered By : babou

I do not know the exact definitions used by your class, so I am saying this with caution. A branch normally correspnds to a graph edge that allows control to pass from one node to another in the graph. A path is a succession of edges connected to each other, with possible repetition and representing the successive parts traversed by the control. So a branch will be a element of the program structure, a static entity. The path represent a fragment of computation. If you say more about what you understood, I may be able to tell you whether it makes sense.
Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/12436

Leave a Reply