Chapter 4 Software Testing Process



foreword

Software testing is an important part of software engineering and an important means to ensure software quality. With the increasing complexity of software and the continuous development of the software industry, software testing has received more and more attention. This article will describe in detail the main testing tasks, main testing techniques and methods used in different software testing stages. It will be introduced and will discuss some aspects of test management and organization.


1. Overview of software testing process

The software testing process corresponds to the software engineering development process. In Chapter 2, we used a V-shaped diagram to represent the corresponding relationship between software development and software testing, and a spiral diagram can also be used to represent this relationship.
software testing process

2. Unit testing

1. Definition of unit test

Unit testing is the testing work to check the correctness of the smallest unit of software design——module, mainly to test the errors in syntax, format and logic of modules. Generally speaking, "unit" is the smallest unit in the software that can be coded independently. The basis for unit selection is as follows.
• Units must be measurable.
• The behavior or output of the unit is observable.
• Has clear definable boundaries or interfaces.
The most basic principle to determine the unit is "high cohesion, low coupling". Unit tests should test all important control paths within the module in order to detect errors within the module.

2. The importance of unit testing and unit testing principles

  1. The importance of unit testing
    (1) In terms of time: If you do a good job in unit testing, it will be very smooth during system integration and joint debugging, then it will save a lot of time; (2
    ) In terms of test results: According to past test experience , the effect of unit testing is very obvious.
    (3) In terms of testing cost: Some problems are easy to find during unit testing, but if these problems are found in later testing, the cost will increase exponentially.
    (4) Product quality: whether the unit test is good or bad directly affects the quality of the product.

  2. Principles of unit testing
    (1) The sooner the unit test is performed, the better
    (2) The unit test should be carried out according to the "Software Detailed Design Specification"
    (3) The unit test should be redone for the modified code to ensure that there is no error in the modification of the found error. Introduce new errors
    (4) When the test results of the test cases are inconsistent with the expected results on the design specifications, the testers should truthfully record the actual test results (5) The
    unit test should pay attention to the size of the software unit to be tested
    (6 ) A complete unit test description should include positive testing (Positive Testing) and negative testing (Negative Testing)
    (7) Pay attention to the use of unit testing tools

3. The main task of unit testing

The unit test tests each program module, and the main task of the unit test is to solve the test problems in five aspects, as shown in the figure.
Unit testing solves 5 aspects of testing problems

4. Establishment of unit test environment

Under normal circumstances, unit testing should be done immediately after the code is written, and unit testing should be performed after the program is written, reviewed and verified for grammatical correctness. Test case design should be combined with review work, and data selection based on design information will increase the possibility of discovering the above-mentioned types of errors.
General unit testing environment

5. Test the main technology and unit test data

  1. The main technology of unit testing
    The object of unit testing is the smallest unit of software design - module or function, and the basis of unit testing is the detailed design description. Unit testing mainly adopts white-box testing technology, supplemented by black-box testing technology, so that it can identify and respond to any reasonable and unreasonable input.

  2. Data used in unit tests
    Usually do not use real data as data used in unit tests. When creating test data, ensure that the data adequately tests the boundary conditions of the unit. When the unit under test is manipulating large amounts of data, and many units have this need, consider using a smaller representative sample of the real data.

6. Introduction to unit testing tools

At present, there are many types of unit testing tools, which can be divided into the following categories according to the scope and function of testing:
• Static analysis tools.
• Code specification review tool.
• Memory and resource checking tools.
• Test data generation tools.
• Test framework tools.
• Test result comparison tool.
• Test metrics.
• Test documentation generation and management tools.

7. Unit testers

Unit testing is generally done by developers and designers. Unit testing is generally carried out by the development team under the supervision of the team leader, and the development designer who writes the unit designs the required test cases and test data to test the unit and modify the defects. The Development Team Leader is responsible for ensuring that adequate testing is performed using appropriate testing techniques and under reasonable quality control and oversight.

3. Integration testing

1. Definition of integration testing

Integration testing (also called assembly testing, joint testing) is a logical extension of unit testing. In its simplest form, it combines two tested units into one component and tests the interface between them.
Integration testing is mainly to test whether the combination of software units can work normally and whether it can be integrated with other modules. Finally, it is necessary to test that all combinations of modules that make up the system work properly.
Before integration testing, unit testing should have been completed, and the objects used in integration testing should be software units that have been unit tested

2. Main tasks of integration testing

The main task of the integration test is to solve the test problems in the following five aspects:
• Connect the modules and check whether the data is lost through the interface when the modules call each other.
• Combine various sub-functions to check whether each function can meet the expected requirements.
• Whether the functionality of one module adversely affects the functionality of another module.
• Whether there is a problem with the global data structure, and whether it will be abnormally modified.
• Whether the errors of a single module are accumulated and amplified to an unacceptable level.

3. The principles followed by integration testing

Integration testing should start planning for the overall design as early as possible. In order to do a good job of integration testing, the following principles need to be followed:
• All public interfaces must be tested.
• Critical modules must be adequately tested.
• Integration testing should be done at a certain level.
• The strategy selection of integration testing should comprehensively consider the relationship among quality, cost and schedule.
• Integration testing should start early and be based on the overall design.
• On the division of modules and interfaces, testers should fully communicate with developers.
• When an interface is modified, the related interfaces involved must be retested.
• Test execution results should be faithfully recorded.

4. Integration test implementation plan

There are many implementations of integration testing, such as non-incremental integration testing and incremental integration testing , sandwich integration testing , core integration testing , layered integration testing , and usage-based integration testing . Among them, non-incremental integration testing and incremental integration testing are commonly used.

  1. Non-incremental integration testing
    To sum up, non-incremental integration testing is a one-step approach to testing, that is, after individual unit testing of all modules, each module is connected according to the program structure diagram, and the connected The program is tested as a whole.

  2. Incremental integration testing
    Incremental integration testing is different from non-incremental integration testing. Unit integration is realized step by step, and integration testing is also completed step by step. It can also be said that it combines unit testing with integration testing. Incremental integration testing can be implemented in different orders, so there are two approaches, top-down incremental integration testing and bottom-up incremental integration testing.
    (1) Top-down incremental integration testing. Top-down incremental integration testing means that step-by-step integration and step-by-step testing are carried out from top to bottom according to the structure diagram, that is, the order of module integration is to first integrate the main control module (main program), and then go down according to the software control hierarchy to integrate. The modules subordinate to the main control module are gradually integrated into the structure according to the depth-first strategy (vertical) or breadth-first strategy (horizontal).
    (2) Bottom-up incremental integration testing. Bottom-up incremental integration testing starts from the bottom module, integrates and tests step by step from bottom to top according to the structure diagram. Since the integration starts from the bottom layer, when the higher-level modules are tested, the required functions of the lower-level modules are already available, so it is no longer necessary to use the called simulated sub-modules to assist the test.

  3. Other integration testing schemes
    (1) Sandwich integration testing. Sandwich integration testing is an organic combination of top-down testing and bottom-up testing, using parallel top-down and bottom-up integration methods to form an improved sandwich method.
    (2) The core system is first integrated and tested. The idea of ​​the core system first integration test method is to conduct an integration test on the core software components first, and then integrate each peripheral software component into the core system one by one on the basis of passing the test.
    (3) High frequency integration test. High-frequency integration testing refers to synchronizing with the software development process and performing an integration test on the existing code of the development team at regular intervals.

5. Test technology and integration test data for integration testing

The specific content of software integration testing includes the following aspects. (1) Functional testing.
(2) Reliability testing. According to the requirements put forward in the software requirements and design, the fault tolerance, easy recovery, and error handling capabilities of the software are tested.
(3) Usability testing. Check and test the comprehensibility, learnability and operability of the software according to the requirements put forward in the software design.
(4) Performance testing. According to the software requirements and the requirements put forward in the design, the time characteristics and resource characteristics of the software are tested.
(5) Maintenance test. The ease of modification of the software is tested according to the requirements set forth in the software requirements and design.

6. Integration testers

Since integration testing is not performed in a real environment, but in a development environment or an independent testing environment, integration testing is generally completed by testers and developers selected from the development team. In general, the pre-test of integration testing is done by developers or white-box testers, and after passing the pre-test, it is completed by the testing department. The entire integration testing work is carried out under the leadership and supervision of the test team leader, who is responsible for ensuring that adequate integration testing is performed using appropriate testing techniques under reasonable quality control and supervision

4. System testing

1. Definition of system test

System testing refers to the testing of the software system that has passed the integration test, as an important part of the computer system, combined with other system elements such as computer hardware, peripherals, and some supporting software systems. Compare the requirements definition of the system to find out where the software does not conform to or contradict the system definition. System testing is a thorough test of the integrated software system to verify whether the correctness and performance of the software system meet the requirements specified by the requirements analysis.

2. Preparations before system testing

Before testing, the following preparatory work needs to be done:
• Collect software specifications as the basis for system testing.
• Collect various software manuals as a reference for system testing.
• Carefully read the software test plan, it would be better if there is an independent system test plan, as the basis for system testing. If there are already compiled system test cases, collect them together.

Read all the above documents, if there are no ready-made system test cases, it will take a lot of work to write test cases. From the above documents, you first need to find the following:
• A description of the various functions of the system.
• The data processing and transmission rate required by the system.
• Requirements for system performance.
• Requirements for backup and recovery.
• A description of compatibility.
• A description of the configuration.
• Safety requirements, etc.

3. Test technology and system test data of system test

  1. The main test technology of system test
    system test completely adopts black box test technology, because at this time there is no need to consider the implementation details of component modules, but mainly to check whether the software meets the functions, behaviors, performance and system coordination according to the standards determined during requirements analysis sexual demands.

  2. Test Data for System Testing
    Because a major goal of system testing is to establish confidence that the software system will pass acceptance testing, the data used for system testing must be as accurate and representative as possible of real data.

4. System tester

In order to conduct system testing effectively, the project team should try to form a productive system testing team. The members of the system testing team mainly include the following types of personnel.
• Testers from the agency's independent testing department, if one exists.
• Part of the developers of this project.
• Invite developers from other projects to participate in system testing.
• Institutional quality assurance personnel.

5. Acceptance test

1. Definition of Acceptance Test

Acceptance testing is the last quality inspection activity carried out after the software development is completed and before the user puts the software product into practical application. It needs to answer the question of whether the developed software product meets the expected requirements and whether the user can accept it. Acceptance testing is mainly to verify the correctness of software functions and compliance with requirements.

2. The main content of the acceptance test

The main testing tasks that software acceptance testing should complete include configuration review , legality check , document check , software consistency check , software function and performance test and test result review , etc.

3. Test technique and acceptance test data for acceptance test

  1. The main test technology of acceptance test
    Since the acceptance test is mainly completed by user representatives, the user representatives mainly test the software system by performing their typical tasks when using the system, and analyze and verify whether the software satisfies the functions, behaviors, and performances according to business requirements. And system coordination requirements, so the acceptance test does not need to care about the internal details of the software, so the acceptance test completely uses black box testing technology.

  2. Data used in acceptance testing
    Whenever possible, real data should be used in acceptance testing. When real data contains confidential or security information, and this data is visible in partial or overall acceptance tests, steps must be taken to keep the data safe.
    In cases where real data is not used (perhaps because of risks to real systems and other applications that use real data, or because the data is confidential or for reasons of secrecy) consideration should be given to using a replica of the real data. The quality, precision and volume of replicated data must represent the real data as closely as possible.

4. α, β test

Alpha testing is a kind of acceptance test under the operating environment of the simulated software system in the software development company, that is, the software development company organizes internal personnel to simulate various user behaviors to test the upcoming software products (called alpha version) in an attempt to Find and fix bugs.

A software product that has undergone alpha testing and adjustments is called a beta version. The following beta test refers to the actual use of the beta version by typical users in all aspects of the organization of the software development company in their daily work, and requires users to report abnormal situations and put forward criticisms, generally including functionality, safety and reliability, and ease of use. , scalability, compatibility, efficiency, resource occupancy, user documentation, etc., and then the software development company will correct and improve the β version.

5. Acceptance testers

Acceptance testing is generally performed by user representatives with the assistance of the test team. In some organizations, acceptance testing is performed by the development organization (or its independent testing group) together with representatives of the end-user organization; in others, acceptance testing is performed entirely by the end-user organization, or by the end-user organization Select people to form an objective and unbiased team to carry out.

6. Regression testing

Regression testing refers to the re-testing after the software system is modified or expanded (such as system function enhancement or upgrade). Regression testing is repeated testing to ensure that no new errors are introduced after the software is modified. Whenever new functions are added to the software, or defects in the software are corrected, these changes may affect the original functions and structures of the software. In order to prevent unforeseen side effects from software changes, it is necessary not only to test the content, but also to repeat the tests that have been carried out in the past to prove that the modification has not caused unexpected consequences, or to prove that the modified software can still meet the actual requirements. need.

1. Regression testing testing techniques and regression testing data

Regression testing generally uses black-box testing techniques to test the high-level requirements of the software without considering the implementation details of the software. It may also use some non-functional tests to check whether the enhancement or expansion of the system affects the performance characteristics of the system, and the relationship with other systems. interoperability and compatibility issues.

The important principle of designing and introducing regression test data is to ensure that the factors that may affect the test in the data are as consistent as possible with those factors when testing on the original software that has not been modified and expanded. Otherwise, it is necessary to determine that the observed test results are due to the data. Changes are still difficult.

2. Scope of regression testing

In the selection of the scope of regression testing, one of the simplest methods is to execute all the tests established in the previous testing stage for each regression to confirm the correctness of the problem modification and not cause adverse effects on other functions. Clearly, the cost of such a return is high. Another way is to selectively execute previous test cases. At this time, only a subset of the previous test cases is executed during regression. Whether the selection of this subset is reasonable and representative will directly affect the effect and efficiency of the regression test. Commonly used use case selection methods can be divided into the following three types.
(1) Tests limited to the scope of modification.
(2) Regression within the range of affected functions.
(3) Select a regression test according to a certain coverage index.

3. Regression testers

Since regression testing is generally associated with system testing and acceptance testing, it is the responsibility of the test team leader to ensure that appropriate techniques are selected and used and that adequate regression testing is performed with reasonable quality control.

7. System troubleshooting

The task of system troubleshooting is to find out the cause and specific location of the errors found during the test, and make corrections. Troubleshooting goes hand in hand with successful testing. A successful test is the discovery of errors. Determining the cause and exact location of errors based on the signs of errors and correcting them mainly rely on troubleshooting techniques. Debugging work is mainly carried out by program developers, that is to say, whoever develops the program is responsible for debugging.

Commonly used troubleshooting methods and strategies are as follows:

  1. Primitive Class Troubleshooting
  2. Backtracking
  3. Inductive and Deductive

Summarize

The above is what I will talk about today. This article only briefly introduces the basic concepts of software testing. I hope it can be helpful to you who are reading. If you are also interested in software testing, just follow me to learn.

If you think my writing is not bad, please give me more likes and encouragement. Your support is also the biggest motivation for me to keep moving forward. At the same time, you are welcome to share this article with your friends and learn together. Finally, everyone is welcome to discuss with me the problems encountered in the learning process in private messages and comments, so that everyone can make progress together.

Guess you like

Origin blog.csdn.net/qq_50564231/article/details/130839489