基于规格说明的测试可以在不需要了解软件程序代码的情况下对软件进行功能测试.判定是形式规格说明中用于描述前、后置条件的主要形式.分析了基于规格说明的逻辑覆盖测试准则,针对已有的决定性逻辑覆盖测试准则的不足,提出了掩盖性逻辑覆盖测试准则,并对其进行了详细分析.提出了掩盖性逻辑覆盖测试准则的一个可行的测试生成算法.根据该准则生成的测试用例能够发现条件的掩盖性带来的错误.然后,从判定的结构入手,分析了条件之间的约束关系、复杂判定的分解与合成、判定之间的关系.这些分别能够阐明逻辑覆盖中条件间的耦合性问题、同一个条件在判定中的多次出现问题以及判定在程序中的位置问题.继而提出了全真判定覆盖、全假判定覆盖、完全子判定覆盖、唯一条件真覆盖以及唯一条件假覆盖等测试准则.满足这些测试准则的测试用例集能检测出不同类型的错误.最后,给出了这些测试准则之间的包含关系图,并建议了不同测试准则适用的应用场景.
The specification-based testing can be used to test software functions without knowing program code. Decisions are the main form of the pre- and post-conditions in formal specifications. This work analyzes logic coverage testing criteria for specification-based testing. It proposes and analyzes in detail masking logic coverage testing criteria, to solve the problems that the existent determinant logic coverage testing criteria can not solve. A feasible test case generation algorithm based on the masking logic coverage testing criteria is presented. The test cases satisfying the masking logic coverage testing criteria can detect those errors caused by the masking property of conditions. It also analyzes the constraints among conditions, how to decompose and compose a complicated decision, and the relationship among decisions. These can respectively clarify the coupling problem among conditions, the multiple occurrences of a condition in a decision, and the position problem of decisions in a program Additionally, test criteria including full true decision coverage, full false decision coverage, all sub-decisions coverage, unique condition true coverage and unique condition false coverage are proposed. The test sets satisfying these criteria can detect respectively different types of errors. Finally, the subsumption relation graph among these testing criteria is presented and different applicable scenarios for different testing criteria are suggested.