针对现有方法主要用于顺序程序的路径覆盖的问题,提出了一种可应用于并发程序路径覆盖的适应值函数构造方法及实现算法,测试者可以运用该方法生成覆盖指定并发路径的测试用例.该方法的核心是通过计算测试用例的执行轨迹和目标路径之间的相似度来评估测试用例的适应值.实验结果表明,该方法为搜索可覆盖小概率目标路径的测试用例提供较强的导向性,并可以完全自动化地为每条目标路径构造出其适应值函数.
Nowadays many researchers have proposed different methods to generate test data using genetic algorithm for a specified path. Existing methods primarily focus on the path coverage for sequential pro- grams testing. An approach to construct the fitness function for test case generation in concurrent programs testing is provoked. This approach evaluates the fitness values of the test case by assessing the similarity between the path exercised by a generated input data and the target concurrent path. Algorithm for the fit- ness function is proposed. Studies indicate that this approach provides guidance for seeking the test case covering small probability target path, and generates fitness function for each target path automatically.