An Automatic Generation Algorithm of Basic Path Set— Reflect the Situation of Branch Coverage
La Xu · Computer Knowledge and Technology · 2014
As all kinds of algorithms about the generation of basic path set have given plenty of exercise in the software testing,so that it improves the efficiency of unit testing greatly.But each basic path generated by those algorithms can't reflect which portions of the code have been covered intuitively.This article comes up with a new algorithm which can generate the shortest basic path for it adopts methods of reusing shortest path and covering branch node one by one.What's more,the basic path generated by this algorithm can reflect which branch node it has cover.This algorithm will help us narrow the time when we design the test case based on basic paths,and improve the efficiency of unit and regression testing.The practice shows that my algorithm has a good effect especially on complex units that need generate test cases artificially for the automatic generation of test cases cannot meet the coverage requirements.