Black box test

Source: Internet
Author: User
Tags subdomain

The concept of test cases
    • test Case Values the input values required to complete an execution of the tested software
    • expected results when and only if the program satisfies its expected behavior, the result of executing the test
    • The prefix value puts the software in the appropriate state to accept any necessary input for the test case value
    • suffix value when a test case value is sent, any input that needs to be sent to the software

validation Value: View the value to use for test case value results
End Command: the value to be used to terminate the program or return to a stable state

    • Test Case Value: Phone number
    • Expected Result: on (or not connected)
    • Prefix value: The phone opens and enters the dial-up interface
    • Suffix value: Press the "call" or "Cancel" button
Requirements for test case design

Test Case Design

    • Representative and typical
    • Seeking weaknesses in system design and functional design
    • Both correct input and error or abnormal input
    • Consider many of the user's actual usage scenarios
Black Box Test Technology

black box test is to see the test object as a black box, regardless of the internal logic structure and internal characteristics of the program, only according to the requirements of the program specification, check the function of the program is consistent with its function description.

Equivalence class Partitioning

equivalence class partitioning is to divide the input domain into as few sub-domains as possible, requiring each subdomain 22 to be disjoint in the partition, each subdomain is called an equivalence class.

    • Equivalence class partitioning for the same input field may not be unique
    • Simply select one input from each equivalence class as the test case
    • For the same equivalence class division, the set of test cases selected by different testers may be different
Equivalence class type

The effective equivalence class is a set of meaningful and reasonable input data, which can verify whether the program realizes the pre-defined function and performance of the specification.

The invalid equivalence class is a collection of meaningless and unreasonable input data for specification, to check whether the program has some fault tolerance.

equivalence classes of variables

Value range: a valid equivalence class and two invalid equivalence classes can be determined if the input condition specifies a range of values.

string: a valid equivalence class (conforming to a rule) and several invalid equivalence classes (violating the rules from different angles) can be determined in the case of rules that require the input data to be followed.

For example , a name is a non-empty string with a length of not more than 20 and is composed only of letters, and numbers and other characters are illegal.

1 Valid equivalence classes: A string that satisfies all of the above conditions

3 Invalid equivalence classes:

  • Empty string
  • String of more than 20 length
  • A string containing a number or other character (not more than 20 in length)

enumeration: If the input data is specified as a set of values (assuming N), and the program is to process each input value separately, it can determine the n valid equivalence class and an invalid equivalence class.

Example: A program according to the different degrees of education to calculate the post wages, which can be a professional, undergraduate, master, doctoral, and other four types.

4 Valid equivalence classes: Specialist, undergraduate, master, PhD
1 Invalid equivalence classes: other qualifications

Array : An array is a set of elements of the same type, and the array length and its type can be used as the basis for equivalence class partitioning.

Example: Suppose the input of a program is an integer array int oper[3]

1 Valid equivalence classes: An array of all legal values, such as { -10,20}

2 Invalid equivalence classes:

  • Empty array
  • All arrays greater than the expected length, such as { -9,0,12,5}

If there are other additional constraints on the array element, such as the range of values for the Oper element is [ -3,3], then the corresponding equivalence class needs to be added.

composite data type: A composite data type is an input data containing two or more independent attributes, which is required to consider the legal and illegal value of each attribute of the input data when doing equivalence class partitioning.

Example:

The equivalence classes of each element in the composite data type are divided, and then the equivalence classes are combined to form the division of the whole input field of the software.

Equivalence class combinations

Test case Generation: test object usually has more than one input parameter, how to combine these parameter equivalence classes to ensure the coverage of equivalence class, is the first problem that test case design needs to consider.

The representative values of all valid equivalence classes are integrated into the test case, which overrides all combinations of valid equivalence classes. Any combination will be designed as an effective test case, also known as a positive test case.

The representative value of an invalid equivalence class can only be combined with the representative values (discretionary) of other valid equivalence classes. therefore, each invalid equivalence class will produce an additional invalid test case, also known as a negative test case.

Example: Judging the type of triangle

Boundary value Analysis

Boundary value Analysis is a method of testing the boundary value of an input or output, which is usually supplemented by equivalence class partitioning, in which case the test case comes from the boundary of the equivalence class.

    • Define the boundary first: the boundary of the input or output equivalence class is usually the boundary that should be tested.
    • Select a value that is exactly equal to, just above, or just below the boundary as the test data, instead of picking a typical value or any value in an equivalence class.

Practice shows that most failures often occur on the boundary of the input definition field or the output range, not the interior.
Therefore, designing test cases for various boundary conditions usually results in a good test result.

Basic idea: faults tend to appear near the boundary values of the program's input variables

    • The boundary value analysis method is based on the hypothesis of " single fault " in the theory of reliability, that is, when two or more faults occur at the same time, there are few cases that result in failure.
    • Repeat for each variable in the program: Keep one variable at a time, let the rest of the variables take normal values, and the reserved variables take min, min+, nom, max-, and Max in turn.
Robustness Testing

Robustness Testing is a simple extension of boundary value analysis, in addition to the 5 boundary value analysis of variables, but also to add a value slightly greater than the maximum value (max+) and slightly less than the minimum value (min-), check the situation of the system when exceeding the limit value.

Error-guessing method

error-guessing is a method by which people can systematically write test cases that examine these errors by guessing the various errors that may exist in the program based on experience or intuition.

      • Software defects have spatial aggregation, and 80% of defects often exist in 20% of the code. Therefore, it is important to keep in mind that frequent "lots" of code are more likely to find defects.
      • Enumerates all possible errors in the program and special cases prone to errors, selecting test cases based on possible error conditions.

Black box 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.