Automatic Test Data Generation Algorithm on Branch Coverage
CHEN Ji-Feng,ZHU Li,SHEN Jun-Yi,WANG Zhi-Hai
DOI: https://doi.org/10.3969/j.issn.1002-137X.2006.12.068
2006-01-01
Computer Science
Abstract:In order to generate test data for a given branch, a new program flow graph is constructed, and Fibonacci method is used to optimize the path selection. The conception and calculation to path-based test data generation complexity is presented. If all branch predicates on the selected path are linear expression, the linear constrain set is constructed and solved to generate test data, otherwise the path can be determined infeasible. Else, the derivatives of a predicate function is approximated by its divided difference, and the nonlinear function is linearized. The test data can also be generated by simple iteration or the path is determined as likely infeasible. If the selected path is infeasible or likely infeasible, a new path is selected. The process above is repeated until the desired test data is obtained or there is no new path to be selected, and the given branch is infeasible. Example and experiment show that the algorithm is feasible and effective.