2-2 Software Testing Phase

Classification by test method

According to visibility: black box testing, white box testing

According to status: static test, dynamic test

Depending on how the tests are executed: manual testing, automated testing

1. Black box testing

In fact, in the test, the system or software under test is regarded as a box that cannot be opened, and the program is tested through the relevant exposed interfaces without considering the internal structure and internal characteristics of the program.

Black box testing only checks whether the function of the program can be used normally as specified in the requirements specification, whether the program can properly accept input data and produce correct output information.

Black box testing focuses on the external structure of the program and does not consider the internal logic. Generally speaking, it tests the interface or visible functions outside the software.

Doing black-box testing is more about from the user's point of view, through different data and event-driven systems, and through output results to make judgments.


(1) Advantages and disadvantages of black box testing

Advantages: 1) Easy to implement, no need to pay attention to the internal implementation.

           2) It is closer to the user's use angle. The scenarios for testing and verification are closer to the scenarios actually used in the system.

Disadvantages: 1) The test coverage is low, generally only covering less than 40% of the code. (because the system black box is not visible; many logical branches are unclear)

          2) For automated testing of black boxes, the reuse rate is low and the maintenance cost is high. (Because black-box testing focuses on functions, and software products change most often in the process of R&D iterations; especially for interface UI products or Internet products, there will be frequent changes, so automated testing for functions is required. The use case repetition rate is low, and the maintenance cost of the script is relatively high because the words change frequently)

(2) What is the main test of black box testing?

    1) Are there any incorrect or missing functions (in software implementation)

    2) On the interface, can the input be accepted correctly? Can it output the correct result?

    3) Are there data structure errors or external information (such as data files) access errors

    4) Whether the performance can meet the requirements (the difference between function and performance: what is the purpose of a function; performance is how well it performs in specific operations)

The performance of a system is an important aspect of black box testing.

Generally speaking, black box testing is used more in the system testing phase (it does not mean that other phases do not use it).

(3) The main design method of black box testing


Equivalence class division: There are many input conditions for the program, equivalence class division is to classify all the inputs into one class, and finally form several typical representative inputs. Test case design is carried out with these typical data.

Boundary value analysis method: special equivalence class division, focusing on boundary conditions (open interval, closed interval, etc.). When developers write programs, boundary values ​​are prone to mistakes.

Error guessing method: Judging possible errors in the program based on experience or intuition, so as to design use cases specifically (for example, special characters are considered for interface input, and files that do not exist or are too large are considered for processing files).

Cause and effect diagram method: Get the program requirements specification, regard each input and output as the cause and effect, and set specific identifiers for the input and output. Finally, according to the semantic description of the specification, a judgment table is formed, and test cases are designed according to the judgment table.

Orthogonal experiment method: a design method that selects typical representative data from a set of data through orthogonality. Mainly used to filter input data.

State transition diagram method: Design test cases by sorting out the state transition relationship of software function points. For example, the software has an approval function, which is submitted for approval, pending approval, rejected, approved, returned, approved, etc., and draws a transition diagram to design test cases.

Process analysis method: sort out the logical execution path of the program to design test cases.

2. White box testing

The tester has a good understanding of the internal structure and the logical structure is visible to the tester. Random white box testing is also known as structured testing, transparent box testing.

White-box testing is to design test cases for the logical structure of the program, and use the logical coverage to measure the integrity of the test.


(1) The main logical unit


Statement coverage: After the test case is executed, each statement of the program is guaranteed to be executed at least once.

Decision coverage: guarantees that each branch is executed at least once.

Condition Coverage: Covers conditional expressions, all expressions are evaluated at least once.

Path coverage: Every possible path in the program is executed at least once. (A branch is part of a path)

(2) Advantages and disadvantages of white box testing

advantage:

    1) Force testers to think carefully about the implementation of the software and understand the principles (requires a deep understanding of the system)

    2) Can detect every branch and path in the code

    3) Reveal bugs hidden in the code.

    4) Test the code thoroughly

shortcoming

    1) Expensive. To achieve high coverage, the workload is very large.

    2) Unable to detect missing paths and data sensitivity errors in the code (some paths are written less in the code, there are problems with statements, etc.)

    3) The correctness of the requirements cannot be directly verified

(3) The main test methods of white box testing


Code detection method: mainly to check the consistency of code and design

Static structure analysis: analyze the system structure, data structure, and internal control logic of the source code to design test cases

Static Quality Metrics: Standard quality models are used as the basis to construct quality metric models for evaluating software.

Logic coverage method: the coverage method introduced above, the combined coverage method of statement, condition, condition combination, branch, decision, path, condition and decision.

Basic path test method: Based on the program control flow graph, by analyzing the cyclomatic complexity of the control structure, the basic executable path set is derived to design test cases. A control flow graph is a way of describing the control flow of a program.

3. Grey box testing


4. Static testing


The program is not run, just look at the document or code directly, you can manually or automated tools to find the deficiencies of the program

Method of static testing


Mutual review: programmers check each other's code (informal)

Walkthrough: Form a group and look at a program or document collectively

Meeting: Hold a formal meeting, minutes. (formal)

5. Dynamic testing


Some methods in black box testing are mainly dynamic testing

White box testing is generally static testing

6. Manual testing


Crowdsourced testing, exploration is testing.

7. Automated testing



Unit testing, structural testing, performance testing, etc.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325708344&siteId=291194637