Difference and connection between black box test, white box test, Unit test, integration test, System test, acceptance test

Source: Internet
Author: User

For developers, the various test methods are often confused. Especially when it comes to integrating code, we can feel the importance of being tested. Many developers focus only on writing code, ignoring the importance of testing. The code is always written and then handed over to the Test team, and the Test team sends back the test report. And then distressed to modify their own code bug, slowly began to hate the Test team personnel. Without careful testing of their own code, not only waste other people's time more affect their own mood.

Enterprise-level project combat (with source) address: http://zz563143188.iteye.com/blog/1825168 collect five years of development information:Http://pan.baidu.com/share/home?uk=4076915866&view=share


Next, we will discuss the environment and function of various test applications.
I. Test environment and role
Black box test, white box test, Unit test, integration test, System test, acceptance test:
The scope of these tests is exactly the incremental relationship, but the role of the person being tested is different.

Black box testing, white box testing, Unit Testing: What developers have to do at different stages of development
Black box testing, integration testing, System testing: What the testers do at the level of the test cycle

Acceptance testing: Usually done in the user's side of the work

Ii. according to the different range
Tests can be divided into unit tests, integration tests, system tests, and acceptance tests.
It embodies the test process and the idea of divide and conquer from small to large, from inside to outside, and gradually.

Third, the function of testing
1. Unit test granularity is the smallest, generally by the development team using white box method to test, the main test unit is consistent with the "design."

Unit testing refers to the inspection and validation of the smallest testable unit in the software. For unit testing in the meaning of the unit, in general, according to the actual situation to determine its specific meaning, such as the C language unit refers to a function, Java unit refers to a class, graphical software can refer to a window or a menu. In general, the unit is the minimum measured function module that is artificially defined. Unit testing is the lowest level of test activity to be performed during the software development process, and the independent unit of the software will be tested in isolation from other parts of the program.

2. The integration testing community between unit testing and system testing, play a "bridge role", generally by the development team using white box and black box to test, both verify the "design", but also verify the "requirements." It is mainly used to test the interface between modules and modules, and also to test some key business functions. Integration testing (also called assembly testing, joint testing) is a logical extension of unit testing. Its simplest form is to combine two tested units into a single component to test the interface between them. In this sense, a component refers to an integrated aggregation of multiple cells. In a real-world scenario, many units are assembled into components that are then aggregated into a larger part of the program. The method is to test the combination of fragments and eventually expand into a process to test the module with the modules of other groups. Finally, all modules that make up the process are tested together. In addition, if a program consists of multiple processes, you should test them in pairs instead of testing all
Integration testing process.

3. System test particle size is the largest, generally by the independent Test team using black box method to test, the main test system is consistent with the "Requirements specification." After the test confirmation of the above stages, the system is fully simulated to test the customer environment. System testing is a confirmed software, computer hardware, peripherals, networks and other elements together to carry out a variety of information system assembly testing and validation testing, its purpose is to compare with the needs of the system, found that the development of the system and user needs inconsistent or contradictory places, thereby proposing a more complete program. Its task is to check out the errors in the program as thoroughly as possible, improve the reliability of the software system, and the purpose is to test the system "How did it go?" "。 This stage can be divided into three steps: module testing, testing each module for errors, assembly testing, testing the interface between modules is correct, confirm the test, test the entire software system to meet the requirements of user function and performance. The end of the phase should deliver a test report explaining the selection of test data, test cases, and whether the test results meet the expected results. After the test finds the problem, it is debugged to find out the cause and location of the error and correct it. is a black box class test based on the overall requirements specification of the system, which should cover all the components of the system. System testing is a test of the entire product system to verify that the system satisfies the definition of the requirements specification and to identify areas that do not conform to or contradict the requirements specification.
The object of system testing is not only the software of the product system that needs to be tested, but also the hardware that the software depends on, the peripherals even include some data, some supporting software and its interface. Therefore, the software in the system must be combined with a variety of dependent resources to test the system in its actual operating environment.

4. The acceptance test is similar to the system test, the main difference is that the tester is different, and the acceptance test is performed by the user.

5. Black box test: Regardless of the program internal structure and logical structure, mainly used to test the function of the system to meet the requirements specification. Typically there is an input value, an input value, and a comparison of expected values. Black-Box testing is also known as functional testing, and it is tested to see if each feature is working properly. In the test, the program as a black box can not be opened, regardless of the internal structure of the program and internal characteristics of the case, in the program interface testing, it only checks whether the program function in accordance with the requirements of the specification of the normal use, the program can properly receive input data and produce the correct output information. Black box testing focuses on the external structure of the program, regardless of the internal logical structure, mainly for the software interface and software function testing.

6. White box test: The main application in the unit testing phase, mainly on the code level of testing, for the internal logic of the program, testing methods are: statement coverage, decision coverage, conditional coverage, path coverage, conditional combination coverage. White box testing is also called structural testing or logic-driven testing, it is in accordance with the internal structure of the program testing procedures, through testing to determine whether the internal action of the product according to the specifications of the design specification of the normal conduct, inspection procedures in each path can be as scheduled to work correctly. This method is to think of the test object as an open box, the tester designs or selects the test case according to the internal logical structure of the program, tests all the logical paths of the program, and determines whether the actual state is consistent with the expected state by checking the state of the program at different points.

The difference between system test and integration test "go"

The general small system distinction is not very large

1. Sequencing of planning and use-case preparation
From the V model, in the requirements phase of the development of the system test plan and use cases, hld the time to do integration test plans and use cases, some companies are not the same practice, but shun
The order must first do the system test plan use case, then do the integration

2. Granularity of Use cases
System test cases are relatively close to user acceptance of test cases
Integration test cases are more detailed than system test cases, and focus on the interface section, after all, to integrate modules or subsystems

3. Order of execution of tests
Perform the integration test first, after the problem of the integration test is repaired, (configuration management, Baseline), then do the system test.

4. Number of Use cases
The number of use cases in a system test is generally less than the number of use cases for integration testing, and the specific number is determined by the performance baselines of each company, and generally no such number of test cases can pass the audit

System testing this term is often used for stress testing, capacity testing, performance testing, safety testing and so on.

Integration testing is often used as a superset of detailed functional testing-designing and organizing large-grained functional tests from user needs.

System testing is the most important function testing, testing software "Requirements Specification" mentioned in the function is omitted, whether the correct implementation. Do the system test strictly in accordance with the "Requirements Specification", to it as the standard. Test methods are generally used black-box test method;
The integration test is tested before the system is tested and the system is integrated when the unit test is complete. The integration test is mainly to test the internal structure of the program, especially the interface between the programs. Integration testing requires a high level of scripting ability for testers. The test method is generally used in combination of black box test and white box test.

Integration testing: A test performed during the integration of software systems, the main purpose of which is to check whether the excuses between the software units are correct. It is based on an integrated test plan that combines modules or other units of the year into an increasingly larger system, running the system to analyze whether the system is correct, and whether the components are in tune with each other. The strategy of integration testing mainly has top-down and bottom-up two kinds. It can also be understood that in the Software Design unit, the functional module assembly, set up as a system, the application of the various parts of the system (software units, functional modules interface, links, etc.) joint testing to determine whether they can work together together, the components may be code blocks, independent applications, network client or server-side programs.


System testing: The system test is based on the software requirements of the black box test, is the integrated software system thoroughly tested to verify the correctness and performance of the software system to meet the requirements specified in its specification, check the software's behavior and output is correct, not a simple task, known as the "Prophet problem" test. Therefore, the system test should be carried out according to the test plan, and its input, output and other dynamic operation behavior should be compared with the software specification. Software system testing methods are many, mainly functional testing, performance testing, random testing and so on.

Generally speaking, a product from research and development to the factory of the project, the test is divided into three stages: unit testing, integration testing, system testing, Unit testing: The function of a module and the general error test; Integration test: After the unit test is completed, each module is tested, the interface of each module is consistent, The data flow between the modules and the control of sulfur in accordance with the design to achieve its function, as well as the correctness of the results of validation, and so on, can make the entire product integration test, can also make large module integration test; System testing: Comprehensive testing for the entire product, Includes both validation tests for each module (verifying correctness of the first two phases of testing) and functionality (product-submitted user functionality) testing, as well as testing the robustness, safety, maintainability and various performance parameters of the entire product

Difference and connection between black box test, white box test, Unit test, integration test, System test, acceptance test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.