等价类结和判定表的软件测试方法应用
2012-04-29杨悦
杨悦
摘要:软件测试的类型通常分为白盒测试和黑盒测试,其中基于等价类的划分法与基于判定表的测试法都是较为典型和实用的黑盒测试技术方法。在实际工作中,为了使测试用例的覆盖更加全面,测试目的更加明确,通常不仅仅局限于某一种测试手段。针对等价类和判定表这两种方法各自的特点,可以将两者有机结合,通过对输入条件进行等价类划分,对输出行为进行判定表列举,用综合的手段进行软件测试工作,从而达到使测试用例的设计覆盖全面、条理清晰的目的。
关键词:等价类;判定表;软件测试
中图分类号:TP311文献标识码:A文章编号:1009-3044(2012)05-1194-03
The Application of The Software Testing Method Combining Equivalence Partition with Decision Table
YANG Yue
(The Software Testing Center of Shanghai Academy of Spaceflight Technology, Shanghai 201109, China)
Abstract: The types of software testing are usually sorted as white box testing and black box testing.The testing methods based on equiva? lence partition and decision table are both typical and practical black box testing skills.In practical working,to make the coverage of testing more comprehensive and to make the purpose of testing more specific,the usual thought is to use not only one certain way to do the test. According to the individual characteristics of these two methods,it is feasible to combine these two methods together,by partitioning the equivalence of input conditions and listing the dicision table of output activities of the testing program module.This combining method can make the designing of testing cases more comprehensive and distinct.
Key words: equivalence partition; decision table; software testing
1概述
软件测试的类型一般来说,可以划分为白盒测试类型和黑盒测试类型。黑盒测试针对的主要是软件功能的正确性和完整性。黑盒测试的理念,是将程序内部的逻辑结构看成一个黑盒子,单纯依据给定的软件需求规格说明中约定的功能要求,设计测试输入数据,观察测试输出结果,通过结果的正确性来验证软件的正确性。黑盒测试的方法比较多,其中较为典型的是等价类划分法和判定表驱动法,实际工作中可以将两种方法有机结合进行软件测试。
2等价类划分法
等价类划分法的一般定义,是依据程序的实际情况,把测试输入划分成具有代表性的几种分类,类与类之间彼此不相交;然后从每个分类中选取部分数据作为测试用例的输入。这其中选取的输入数据在测试中的作用等价于该类中的其他数据,因此对每一个特定的类来说,不需要将该类中所有的输入都作为测试输入,仅选取本类中具有代表性的输入即可覆盖某一方面的验证,大大减少了测试用例的数量,提高了测试效率。……
