手动的编写测试用例既要消耗人力物力,也不能顾忌到所有测试条件,因此高效的测试用例生成是提高测试效率的必要手段。由此,对测试工具运用进化算法自动生成测试用例进行研究。其中测试用例以染色体来表示,每条染色体由对象的构造函数及其带实参的方法构成。介绍测试工具,以及优化后的进化算法在该工具中的实现和在单元测试中的应用。
Manual write test case not only consumes the human and material resources,but also fails to consider all test condi-tions. Therefore, efficient test case generation is necessary to improve the efficiency of testing. As a result, automatic generation of test cases based on evolutionary algorithm was researched. The test cases were represented by chromosomes, each chromo-some consisted of constructed functions and methods with actual parameters. The testing tool, the implementation of the opti-mized evolutionary algorithm in the tool and its application in unit testing were introduced.