Software testing is coming~ It's a beautiful thing to see how much this blogger writes

content

opening

software testing model

V model

W model

Model X

H model

testing method

white box testing

black box testing

grey box testing

 Types of black box testing methods

Equivalence Class Division

Classification of Equivalence Class Tests

Boundary value method

Boundary value analysis test method

decision table method

Test method for decision table


opening

hello! Hello everyone, let's take a look at software testing in this article.

First of all, what is software testing? What is the purpose of software testing?

Software testing technology is an active process of verifying and confirming software products, and its purpose is to find problems in software products as soon as possible, including errors, defects, and inconsistencies in user-defined requirements.
 

What is the life cycle of software testing?

Problem definition - requirement analysis - system design - coding implementation - software testing - operation and maintenance
Software testing takes 45% of the development phase.

 

software testing model

V model

When it comes to software testing, the V model shows the most widely known model. as the picture shows. The V-Model process goes from left to right and describes the basic development process and testing behavior. The value of the V-model is that it clearly identifies the different levels in the testing process and clearly describes the correspondence between these stages of testing and the development process.

W model

The model of the W model is proposed by Evolutif Company. Compared with the V model, the W model is more scientific. The W model emphasizes testing, which accompanies the entire software development cycle. The test object is not only the program requirements, functions and designs, but also tests. The testing and development are carried out simultaneously, which is conducive to earlier detection of problems. as the picture shows.

Model X

The X model is also an improvement over the V model. The X-model aims to propose the separation of individual program fragments from each other. Coding and testing then go through frequent handoffs, and finally synthesize executable programs through integration.

H model

The software testing process activities in the H model are completely independent and run concurrently with other processes throughout the entire product cycle. When a test point is ready, you can move from the test preparation phase to the test execution phase. Software testing can be carried out as early as possible and can be carried out hierarchically according to the different objects under test.

The H model reveals the principle that software testing is an independent process that runs through the entire life cycle of a product and is concurrent with other processes. Run the model, pointing out that software testing should be prepared as early as possible and executed as soon as possible.

测试用例 = 输入 + 输出 + 测试环境。

testing method

According to the test method, it is divided into: white box testing, black box testing, gray box testing

white box testing

White-box testing is also called structural testing or logic-driven testing. White-box testing refers to knowledge of the internal logic of an application's code. It is necessary to cover all the code, branch, path, and conditional tests , but also to check whether each path in the program can work correctly according to the predetermined requirements. To protect its function, the main methods of white box testing are logic driving, base road testing, etc.

black box testing

Black box testing is usually understood as I don't need to know how the program code is implemented, I just need to know. Where did the program go wrong? From the user's point of view. Black-box testing focuses on the external structure of the program, regardless of the internal logical structure, and mainly tests the software interface and software functions.

grey box testing

Gray box testing is a test between white box testing and black box testing. Gray box testing focuses on the correctness of the output for the input . Grey box testing combines elements of white box testing and black box testing. It takes into account the user side, specific system knowledge and operating environment.

The black box testing process is shown in the figure.

 Types of black box testing methods

Equivalence Class Division

Equivalence class division, dividing the program input and into several disjoint subsets, which are called equivalence classes. The so-called equivalence class refers to a subset of the input domain, and the union of all equivalence classes is the entire input domain.

Equivalence class is divided into two cases, valid equivalence class ( is a set of meaningful, reasonable input data ) and invalid equivalence class ( is a set of unreasonable or meaningless input data ).

As an example:

A student is allowed to take 5 to 8 courses. And gates 5 to 8 are valid equivalence classes. Less than five or more than eight are invalid equivalence classes.

Classification of Equivalence Class Tests

Weak compositional form : The test case only needs to satisfy the full coverage of the valid equivalence classes.

Here it is assumed that f implements a program. Enter the boundaries of the variables X1 and X2 and the interval within the boundaries.

a <= X1 <= d , the interval is [a, b), [b, c), [c, d]

e <= X2 <= g, the interval is [e, f], [f, g]

Then the valid equivalence classes for X1: [a, b), [b, c), [c, d]

Then the invalid equivalence class of X1: (negative infinity, a), (d , positive infinity)

Then a valid equivalence class for X2: [e, f], [f, g]

Then the effective equivalence class of X2: (negative infinity, e), (g , positive infinity)

Then the weak general equivalence class test. At least three test cases are required to satisfy the testing requirements of the equivalence class. as the picture shows.

Strong compositional form: The test case not only satisfies the following complete coverage of pairs, but should also cover all combinations of equivalence classes.

Strong means that the test case needs to cover all possible combinations of classes that are valid for both inputs. X-a has three valid equivalence classes, and xa has two valid equivalence classes, so at least six equivalence test classes are needed to satisfy the test requirement of the strong general equivalence class, that is, 3×2.

General equivalence class testing : Only valid equivalence classes are considered.

Robust equivalence class testing : Consider valid and invalid equivalence classes .

Here we give an example, here is a triangle problem

Equivalence class for triangle problems . As shown in the figure:

Cover the invalid equivalence class test case , as shown in the figure:

Boundary value method

The boundary value can be understood as a rule that is close to the edge under a certain condition. As an example. A text with 1~255 characters allowed. Then 1 and 255 characters are legal periods. is also a boundary value. 254 characters can also be added as a legal test.

But if you enter 0 characters and 256 characters. Then it is an illegal interval.

Another example. In C language there is an array of ten elements. Then when assigning a value, use the for loop to input " for(int i = 1; i <= 10; i ++) " to assign a value, then it is obvious that the subscript exceeds the limit. This is a typical boundary value problem (out of bounds).

Boundary value analysis test method

We have two variables here, X1 and X2 two programs, where X1 belongs to the a, b interval, X2 belongs to the c, d interval, then the boundary value analysis uses the minimum value of the input variable, slightly larger than the minimum value, any value in the interval, the maximum value and slightly max. Then the use case diagram of the input space of the two variable programs and the boundary value analysis program of the two programs is as follows.

Then a robustness test case for a two-variable program.

decision table method

What decision table?

Decision table, also called decision table. Of all the functional testing methods, the decision table based testing method is considered to be the most rigorous because of the logical rigor of decision tables.

Decision tables usually consist of four parts. Conditional pile (lists all the conditions of the problem. Except that the order of the problems has specific requirements, the order of the conditions listed here is usually irrelevant.) Condition items ( all possible options listed for the conditions given by Qiao Jianzhuang value.) Action stubs ( given that the problem specifies possible operations, the order of these operations is generally unconstrained, but for ease of reading, they can also be properly ordered.) Action items ( closely related to conditional equipment, in the various Action to be taken in case of melody)

There are two or more rules in the table with the same action, and there is a very similar relationship between the conditions. Managed to merge it.

As shown, the two rules are merged into one.

Test method for decision table

First, the triangle problem

1. List all conditions and action stubs

conditional pile

C1: a, b, c form a triangle

C2:a = b?

C3:a = c?

C4:b = c?

action pile

A1: Non-triangle

A2: scalene triangle

A3: Isosceles triangle

A4: Equilateral triangle

A5: Impossible

2. Determine the number of rules

3. List all conditional and action stubs

4. Fill in the condition items

5. Fill in the action items

6. Simplify decision tables

as the picture shows.

It is obvious here that the most prominent advantage of decision comparison is that it can list complex problems according to each possible situation. Concise and understandable while avoiding omissions.

(please pay attention) Continuing to update...

Guess you like

Origin blog.csdn.net/aasd23/article/details/124107241