The main concern of software testing is the behavior of the program, in all possible behavior of the program, part of the specification description of the behavior described (in the set S), part of the program ultimately implemented behavior (expressed in set P), Figure 1 shows the existence of the relationship between the two. In this Venn diagram, some of the prescribed procedural behavior is not implemented, and we call it "omission defect"; Some implementations are not specified in the specification, we call it "fault defects"; only the part where the set S and p intersect is "correct", i.e. the desired behavior implemented. Testing, then, is the process of determining the scope of the program's behavior as specified.
Figure 1 The relationship between the expected behavior of the program and the implementation behavior
Testing is a test case to trigger the behavior of the program, the test case corresponding to the program behavior (denoted by the set T) and the above behavior is shown in relation to 2, the overlap between the three formed 7 parts. Where zone 1 is the intersection of three sets, representing the implemented defined behavior covered by the test case, and Region 2 represents the implemented behavior that is not covered by the test case, and Zone 3 represents the implemented unspecified behavior covered by the test case; Zone 4 represents the non-implemented behavior covered by the test case Region 5 represents a defined behavior that is not covered by the test case and is not implemented, and region 6 represents an implemented, unspecified behavior that is not covered by the test case; Zone 7 represents the non-implemented and unspecified behavior that is covered by the test case.
Figure 2 The relationship between the expected behavior of the program, the implementation behavior, and the test behavior
In the above Venn diagram, if some specified behavior does not have a corresponding test case, then the test is incomplete, if there is a test case corresponding to the non-specified behavior, it is possible that the test case is not designed properly, or the specification is insufficient, Or is the tester deliberately trying to confirm that the behavior that the rules should not have happened? Obviously, testers should do everything possible to maximize the intersection of all behavior sets (that is, area 1), so how do you do that? A valid path is to use test methods to construct test cases.
Venn diagram of software testing