跳转至

13-Unit Testing Object-Oriented Software

一、内容

1,Object-oriented design is centered around the concepts of classes, inheritance, and messages.类、接口、方法

Classes objects preserve state; state control is typically distributed over an entire program. State control errors are likely to occur
Inheritance dynamic binding & complex inheritance structures are prone to faults.
Message object-oriented programs typically have many small components and therefore more interfaces. Interface errors are more likely to occur.

image1

二、步骤

1,列出input,output的范围 重叠的分区,但是根据规范,它们应该被视为独立的类。 2,组合test data 3,测试

三、案例

题目: image2

源代码 image3

1,列出input,output的范围 重叠的分区,但是根据规范,它们应该被视为独立的类。 Overlapped partitions, but based on the specification, they should be treated as separate classes. image4

2,组合test data image5 3,测试 image6

四、Combinational Testing

用组合测试来处理该类问题 image7

image8

image9

五、Summary

image10