Summary of software testing methods

According to the different information of the tested object used, software testing methods can be divided into: black box testing, gray box testing, and white box testing.

1. White box testing

1) Concept: It is to test the internal control process based on the internal structure of the program under test and analyze the use cases based on the internal structure. It can completely ignore the overall functional implementation of the program, that is, the internal implementation process of the known software product can be Prove through testing whether each internal operation meets the requirements of the design specifications and whether all internal components have been inspected.

2) Thought: White box testing, also known as glass box testing, transparent box testing, open box testing, structured testing, logic-driven testing, is logic-driven testing based on program structure.

3) Test objects: functions, algorithms and data structures

4) Purpose

(1) Generally carried out in the early stage of testing, by reaching a certain logic coverage index, problems with the internal logic control structure of the software can be basically eliminated;

(2) Ensure that the internal structure reaches a certain level of coverage, which can give greater assurance to the quality of the software code;

(3) After problems are discovered in white box testing, the cost of solving them is lower.

5) Common techniques for white box testing:

(1) Static analysis: including control flow analysis, data flow analysis, and information flow analysis

(2) Dynamic analysis: logic coverage testing (branch testing, path testing, etc.), program instrumentation, etc. Logic coverage testing can be divided into statement coverage, decision (branch) coverage, condition coverage, and decision conditions according to different objects covered. Coverage, condition combination coverage, path coverage. Program instrumentation refers to inserting some print statements into the program when debugging the program. When the program is executed, the information we care about is printed out. Through this information, we can understand some dynamic behaviors of the program during execution.

6) Characteristics of white box testing:

(1) Testers need to understand the implementation of the software;

(2) Can detect every branch and path in the code;

(3) Reveal errors hidden in the code;

(4) Test the code more thoroughly;

(5) Implement code structure optimization;

(6) Large investment and high cost;

(7) Unable to detect missing paths and data sensitivity errors in the code; 

(8) Does not verify the correctness of specifications.

At the same time, I have also prepared a software testing video tutorial for everyone (including interviews, interfaces, automation, performance testing, etc.), which is below. If you need it, you can watch it directly, or you can directly click on the small card at the end of the article to get the information document for free.

Where to watch software testing video tutorials:

Bilibili Fengshen’s interface testing tutorial, complete 70 projects in 30 days (including automated testing and performance testing), you will be employed immediately after completing the course, and you will be free of charge forever!

2. Black box testing

1) Definition: Treat the test object as a black box, only considering its overall characteristics and not its internal specific implementation process. That is, the requirement specifications of the product are known, but its internal implementation is not known. Tests can be conducted to prove whether each requirement is achieved.

2) Idea: Specification-based testing and test types are derived from quality models.

3) Test objects: systems, subsystems, modules, submodules, functions, etc.

4) Commonly used black box testing methods: equivalence class division method, boundary value analysis method, cause-and-effect diagram analysis method, decision table method, state transition method, etc.

5) Purpose: Reduce the number of test cases during testing, complete the test with as few test cases as possible, and discover more problems.

6) Characteristics of black box testing

(1) For larger code units (subsystem or even system level), it is more efficient than white-box testing;

(2) Testers do not need to know the implementation details of the software, including specific programming languages;

(3) Testing is conducted from the user’s perspective and is easy to understand and accept;

(4) Helps expose any specification inconsistencies or ambiguities;

(5) Without clean and concise specifications, test cases are difficult to design;

(6) The internal execution path cannot be controlled, and there will be many internal program paths that have not been tested;

(7) You cannot directly target specific program segments, these programs may be very complex (and therefore may hide more problems)

3. Gray box testing

Using the overall characteristic information of the object under test, the black box testing method is used; using the internal specific implementation information of the object under test, the white box testing method is used; the testing method between the white box and black box testing is called gray box testing. box test.

1) Definition: If both the overall characteristic information of the object under test and the internal specific implementation information of the object under test are used, the gray box testing method is adopted. If the proportions of the two types of information are different, the corresponding gray levels will be different.

2) Applicable objects: Generally, gray box testing method is used for integration testing.

According to whether the software system being tested is running, testing is divided into static testing and dynamic testing.

1. Static testing

1) Definition: A testing technology that does not run the software system being tested, but uses other means and techniques to detect the software being tested, such as code reading, document review, program analysis, etc.

2) Commonly used technology: static analysis technology.

(1) Definition: Static analysis is a technology that analyzes a program without executing it.

(2) Function: Check whether the representation and description of the software are consistent and there is no conflict or ambiguity

(3) Purpose: to correct errors in the description, representation and specification of the software system and therefore is a prerequisite for any further testing.

(4) Static analysis technology mainly has 3 different program testing possibilities

Consider whether the program meets the coding rules and whether it is grammatically consistent and complete;
consider whether the document description is standardized, accurate, and easy to access;
consider whether the program and the documentation are consistent.

(5) Static analysis technologies include: control flow analysis, data flow analysis and information flow analysis, which are introduced one by one below:

1. Control flow analysis

(Concepts related to control flow)

Program element: A program element is usually a condition, a simple statement or a block of statements (multiple consecutive statements).
Control Flow Relation: A program's control flow relationship describes the relationship between program elements and the order in which they execute.
Control flow graph: A graph corresponding to control flow relationships is called a control flow graph.
Control flow matrix: Obtained from the control flow graph, reflecting the sequence relationship between adjacent program elements.
(Problems that can be discovered by control flow analysis)

By analyzing the control flow information, it is ensured that the written program should not contain: labels that do not exist for redirection; useless statement labels; statements that cannot be reached after entering from the program entry; statements that cannot reach the stop statement.

2. Data flow analysis

(data flow related concepts)

Data flow analysis initially appeared as the compilation system needed to generate effective target code. This type of method is mainly used for code optimization (code optimization mainly includes: structural optimization for readability, time efficiency and space efficiency optimization, portability optimization). The key to data flow analysis is the reference and definition of data. Definition of data: If a certain statement in the program can change the value of a program variable V when executed, it is said that V is defined by the statement.

Data reference: If the execution of a statement in the program refers to the value of the variable V in the memory, then V is said to be referenced by the statement.

(Data flow analysis steps)

Obtain the data flow table based on the code.
Analyze the data flow table and find the following two errors: the variable is not defined but is referenced.
The variable is defined but is not referenced.

2. Dynamic testing

1) Definition: A testing technology that runs the software system under test according to pre-designed data and steps to detect the software under test.

2) Features: It mainly analyzes the dynamic behavior of software systems before, during and after execution in simulated or real environments.

3) Commonly used technologies: dynamic analysis technology

(1) Definition: Analysis of the operating behavior of a software system, including formal operation of a program using specific inputs in a controlled environment, and comparison with expected results to check whether the system is running correctly or incorrectly.

(2) Commonly used dynamic analysis techniques:

Path test
Branch test
Performance test

(3) Commonly used dynamic analysis tools and functions

Test coverage analysis: used to test the detection range of the code;
tracing: tracking all paths during program execution
Adjustment: measuring all resources during program execution Simulation
: simulating parts of the system

3. All testing methods can be classified into manual testing and automated testing

1. Manual testing

1) Definition: Manual testing is a traditional testing method in which testers manually write test cases, execute them, and observe the results.

2) Disadvantages: heavy testing workload, many repetitions, and regression testing is difficult to implement

2. Automated testing

1) Definition

Automated testing refers to the use of software testing tools to automatically realize all or part of the testing work: management, design, execution and reporting. Automated testing saves a lot of testing overhead and can complete some tests that cannot be achieved by manual testing.

2) The significance of automated testing

(1) Run the tests executed by the previous version on the new version of the program to improve the efficiency of regression testing

(2) More and more frequent tests can be run

(3) Can perform tests that are difficult or impossible to do manually, such as a large number of repeated operations or integration tests

(4) Make better use of resources, such as test instruments or objects under test

(5) The test is consistent and repeatable, and the steps and results of the automated test are exactly the same. The test is reusable, and the automated test toluene can be split for use by other test scripts.

(6) Software can be brought to the market faster, and efficient regression testing can be performed before software release to reduce software release time.

(7) Increase the trust of the software and improve the testing efficiency through automated testing. You can use the saved time to do more testing.

3) Limitations of automated testing

(1) It cannot replace manual testing. Automated testing can only improve testing efficiency but not test effectiveness, that is, it is impossible to find more defects.

(2) It is highly dependent on test design. If the test design is not good, problems will be missed.

(3) Automated testing has a great dependence on software development. Changes in development may cause the previous automated testing to completely fail.

(4) The tool itself does not have imagination, and the tool does not have intelligence

4) Misunderstandings in automated testing

(1) Unrealistic expectations, hoping that automation can replace manual testing

(2) Lack of practical experience in testing, manual testing cannot be done well, or insufficient experience accumulation, so it is difficult to succeed if you try automation.

(3) Automated testing is expected to discover a large number of new defects. Automation can only ensure the efficiency of test execution and ensure that existing problems will not reoccur. Finding new defects is not its purpose.

(4) Security illusion. It is believed that software that has undergone automated testing is safe and has guaranteed quality. Only manual testing is done well and the observation points of testing are clarified, and automated testing can be done well. Therefore, manual testing is automated testing. a foundation

Summarize

PS: Here is a collection of self-study tutorials for software testing. It should be very helpful for those who are developing in the testing industry. In addition to basic introductory resources, bloggers also collect a lot of advanced automation resources. From theory to practice, only by integrating knowledge and action can you truly master it. The full set of content has been packaged on the network disk, and the total content is close to 500 G.

☑ 240 episodes - a complete set of video courses from zero to mastery
☑ [Courseware + Source Code] - complete supporting tutorials
☑ 18 sets - source code of practical testing projects
☑ 37 sets - testing tool software package
☑ 268 - real interview questions
☑ 200 templates - Interview resume template, test plan template, software test report template, test analysis template, test plan template, performance test report, performance test report, performance test script case template (complete information)

These materials should be the most comprehensive and complete preparation warehouse for friends who do [software testing]. This warehouse has also accompanied me through the most difficult journey. I hope it can also help you! Everything must be done early, especially in the technical industry, where technical skills must be improved.

 

Guess you like

Origin blog.csdn.net/huace3852/article/details/133029429