1. Make down the menu
1.1 First select a column, then click on the data
1.2 The setting values are "passed" and "failed". Note that there is a comma in the middle! ! !
2 When setting the cell value to a certain value, the background color changes
2.1 First select the column, and then click start
2.2 Set the color change when the cell value is equal to a certain value
3. Set up automatic statistics of the execution ratio of your own case, insert the countif function (note that the double quotes are English double quotes)
3.1 Number of passes
3.2 Failed number
3.3 Execution ratio (number of passes + number of failures)/total
In our testing work, most of the use case design methods used by testers are black box use case design methods, among which the most used methods are the equivalence class division method and the boundary value analysis method, which are also the most common of all use case design methods. Simple, but there is a disadvantage that if we don't pay attention to it, it will cause data omissions. This article will mainly analyze how to use these two methods to design test cases in a reasonable and efficient manner.
How to write test cases
1. The components of the test case
Use case number
Use case title
Function module name
Precondition
Input data
Steps
expected outcome
priority
Results of the
editor
Executor
Other supplementary items
The items listed above do not need to be completely written in our use cases, but like the use case number, use case title, preconditions, input data, operation steps, expected results, priority, and execution results are necessary for each test case element.
2. Use case title
Can't have too many words
Generality-only need to look at the title to know what this use case is written in
Resolutely eliminate ambiguity
3. Characteristics of test cases
Clear steps
There must be very clear steps. If you don’t know how to write, just follow the steps to execute the test and write them step by step. For example, we have a QQ login use case, so you can write the steps like this:
1. Click on the QQ application
2. Enter the correct username
3. Enter the correct password
4. Click to log in
The only result
Each test case can only have one unique test result; each test case can only contain one test point; each test case allows multiple check points; there can be no ambiguous or ambiguous words in the expected results.
Strong operability
To ensure that different testers or different test platforms, the final results are the same.
Note: Whether it is the title of the use case or the expected result, try not to use ambiguous sentences
Use case design method
1. Equivalence class division method
The equivalence class division method is to divide the input value of the input domain into equivalence, and then take a small amount of value that can represent the equivalence domain in each equivalence domain as the input data of the test case. According to whether each equivalence class value has an effect on the program, it is divided into effective equivalence class and invalid equivalence class.
Effective equivalence class: The values in this class are meaningful and reasonable for the program that we execute the use case, and can effectively check whether the program achieves the functions and properties specified in the requirements specification.
Invalid equivalence class: The value in this class is just the opposite, which is unreasonable and meaningless for the program. Entering this type of median value program cannot achieve the corresponding function and performance, but it does not mean that the program will not treat this type of median value. In response, considering the robustness of the program, the program should also respond correctly to the values in this class.
The principle of equivalence class division:
1. Divided by interval
When the input conditions have specified the value range or the number of values, we can basically determine one valid equivalence class and two invalid equivalence classes.
2. Divided by data collection
In the case where the input condition specifies the set of input values or the condition of "how it must be", a valid equivalence class and an invalid equivalence class (other than the valid value of the set) can be established
3. Divided by data Boolean value
When the input condition is a Boolean value, a valid equivalence class and an invalid equivalence class can be determined
4. Divided by value
To specify a set of values of input data (assuming n), and the program needs to process each input value separately, n valid equivalence classes and one invalid equivalence class can be established
5. Divided by restrictions or rules
In the case of stipulating the rules that the input data must comply with, one valid equivalence class (conforming to the rule) and several invalid equivalence classes (violating the rule from different perspectives) can be established
6. Equivalently divided by subdivision
In the case that it is known that the equivalence class has been divided, the way each element is processed in the program is different, the equivalence class should be further divided into smaller equivalence classes
After we divide the input fields of the input fields according to the above principles, we can select a small number of representative values in each equivalence field as the input data for program execution, and start designing test cases. In fact, when designing test cases, we must consider not only the input domain, but also the output domain. The equivalence class division of the output domain and the division of the input domain are the same.
Methods of designing test cases:
1) Design new test cases to cover as many valid equivalence classes as possible, and repeat this step until all valid equivalence classes are covered
2) Design a new test case to cover only one invalid equivalence class that has not been covered, and repeat this step until all invalid equivalence classes are covered
Note: A very important point is that there is only one invalid equivalence class in a test case, just as we often say that a test case contains only one test point. If you cannot distinguish between valid and invalid equivalence classes at the beginning, you can output the equivalence class table first, and then output the test cases according to the equivalence class table.
2. Boundary value analysis method
The boundary value analysis method is generally used to supplement the equivalence class division method, but it is also essential. The reason is that many errors in the program occur on the boundary of the input or output range, rather than at the boundary of the input or output range. The inside of the input range, so the design of test cases for various boundary conditions usually has a good test effect.
The so-called boundary refers to some specific situations in the input domain that are slightly higher than or the regional boundary value. The boundary value analysis must consider not only the input conditions, but also the test situation when the value is empty. Spaces, nulls, "", etc. are all special cleaners, and you need to pay special attention to them when designing test cases.
Value of boundary value analysis
Interior point: any point in the domain is an interior point
Upper point: refers to the point on the boundary, regardless of whether the domain is open or closed at this time, the upper point is the upper limit and lower limit of the domain
Leaving point: refers to the point closest to the upper point. This is related to the closed interval or the open interval. If it is an open interval, then the away point is within the domain; if it is a closed interval, then the away point is outside the domain (open Closed inside and outside)
For example: the input data range of the input box is 3-6 (including 3 and 6), the inner point is 4,5; the upper point is 3,6; the out point is 2,7.
Principles of boundary value analysis:
If the input conditions specify the value range, the value that has just reached the boundary of this range and the value that has just exceeded the boundary of this range should be used as the test input data (inner point, upper point, out point)
If the input condition specifies the number of values, use the maximum number, minimum number, one less than the minimum number, and one more than the maximum number as the test data
If the input field or output field given by the program specification is an ordered set, the first element and the last element of the set should be selected as test cases
If an internal data structure is used in the program, the value on the boundary of this internal data structure should be selected as the test case
Analyze specifications to find other possible boundary conditions
The boundary value analysis method can not only analyze the value in the input box, but also analyze the drop-down box and space.
There are many black box use case design methods in addition to the above two. Testers do not need to mandate which method to use when writing test cases, and in the process of writing use cases, they generally need to be co-written with multiple design methods to meet The maximum coverage of the requirement specification by the test case.
Software testing exchange group: 785128166
WeChat public account: Programmer Erhei; After paying attention, you can receive a set of video resources for free; explain in detail: python automated testing, web automation, interface automation, mobile terminal automation, interview experience and other related content, the value of learning resources depends on you Action, don’t be a "collector"
Here is a collection of selected dry goods articles for functional testing: