On the different functions of black box test and white box test in Software Testing _ White box test

Source: Internet
Author: User
Tags square root

With the maturity of the software market, people's expectation of the function of software is more and more high, China's software enterprises have become more and more aware of the importance of software testing, and gradually increase the software testing in the entire software development of the proportion of the project.

Software testing is not a single "error-finding" process in traditional sense, but it runs through the process of software, and is a scientific quality control process. And for any engineering product can be used in one of the following two ways to test, that is, black box test and white box test.

The function of black-box test in software testing

Black-Box testing is also called functional testing, behavior testing or data-driven testing, in the test, the program as a black box can not be opened, the tester completely regardless of the internal logic structure and internal characteristics of the program, only according to the requirements of the program specifications, check the function of the program to meet its function description, So black-box testing is a basic test. For example: We write "calculator" applications in C #, and if we enter 7 and press the SQRT key, we get a result of 2.645751311. Use the Black box test method, regardless of "square root" to go through how many complex operations, only concerned about his running results.

Black-Box testing methods are mainly used for software validation testing, such as equivalence class division, boundary value analysis, and error inference. The black box method focuses on the external structure of the program, does not consider the internal logic structure, and tests the software interface and software functions. The "black box" method is exhaustive input test, only if all the possible input is used as test conditions, in order to detect all errors in the program in this way. In fact there are infinitely many tests, and people have to test not only all the legitimate inputs but also the illegal but possible input. The main flaw in black-box testing is that it is difficult to measure the integrity of the system, and white-box testing is the perfect remedy for this flaw.

"Black box" means that the things inside the box, meaning that the black box test does not care about the software design and implementation of the program, only concerned about external performance, that is, through the observation of input and output can know the results of the test. Anyone can perform a black box test based on software requirements. Black-Box testing focuses on the functional requirements of the testing software, focusing on the external structure of the program, regardless of the internal logic structure, mainly for the software interface and software functions to test, many applications in the later stages of the testing process. It is a design document based on the requirements of the software, Simulate the actual test of the customer scenario with the system. This test technique covers every aspect of the test, it is mainly for the discovery of the following types of errors: whether there are functional errors or omissions, whether the correct input and output on the interface, whether there is a data structure error or external database access error, performance can meet the requirements, whether there is initialization or termination of the error Miss.

So the black box test is actually checking to see if the following requirements are met:

1, C correctness (correctness): The results of the calculation, naming and so on.

2, D availability (usability): Whether it can meet the requirements of the software description.

3, E boundary condition (boundary Condition): The boundary value of the input part, is to use the Equivalence class division, try the maximum minimum and illegal data and so on.

4, F Performance (performance): The performance of the program depends on two factors: the speed of operation and the need to consume system resources. If you find a performance problem during testing, fixing it is very difficult because it often means that the program's algorithm is bad, poorly structured, or has a design problem. Therefore, in the beginning of product development, the performance of the software should be considered.

5, G pressure test (Stress): Multi-user situation can consider the use of stress testing tools, the proposed combination of pressure and performance testing. If you have load balancing, also open the Monitoring tool on the server side, view the server CPU utilization, memory footprint, if necessary can simulate a large number of data input, the impact of the hard disk and so on information.

6, h Error Recovery (Error Recovery): Fault handling, page data validation, including sudden power outages, input error data.

7, I Security Test (safety): In particular, some business sites, or with money, or the company's secrets related to the web is the need for this test.

8, J Compatibility (compatibility): Different browsers, different application versions in the implementation of the performance of the function.

Using black-Box testing techniques, you can design a set of test cases that meet the following criteria:

(1) The Designed test cases can reduce the total number of test cases designed to achieve reasonable testing;

(2) The test cases designed can tell us whether there are certain types of errors, not just the existence of errors related to a particular test.

The function of white-box test in software testing

White-Box testing, also known as structural testing or logic-driven testing, is a software testing technique that is based on understanding the internal structure of software and the way in which it is run, and usually needs to track what processing an input has undergone and how it is handled correctly. This approach is to treat the test object as an open box that allows testers to design or select test Cases to test all logical paths of the program, using the logical structure and information within the program.

White Box testing is concerned about the internal condition of the object being tested, and needs to keep track of the source code running. By checking the logic structure inside the software, the logic path in software is covered and tested, the checkpoints are set up in different parts of the program, and the status of the program is checked to determine whether the actual running state is consistent with the expected state. White-Box testers must understand the internal design and program implementation of the software, and can write test drivers, which are typically performed by developers as testers. In many testers, especially junior testers, white-box testing is a test that only a senior tester with a very good understanding of program code can do. Familiarity with the implementation of code structures and functions is of course a great help for testing, but some white-box tests do not require testers to understand every line of code. If we have the following procedure:

......

This article is reproduced from the 51Testing Software test Network, view the full text: http://www.51testing.com/html/35/n-828735.html

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.