Table of contents
1. Test case elements (four important elements)
2. The benefits of test cases to us
3.1 Design of test cases based on requirements
3.2 Equivalence classes of specific design methods
3.4.1 How to design test cases through orthogonal tables
4.1 How to use Fiddler to simulate a weak network
4.4 Design Test Cases for Wechat Sending to Moments
1. Test case elements (four important elements)
Test Case (Test Case ) is a set of collections provided to the system under test for the purpose of implementing the test. This set of collections includes: test environment, operation steps, test data, expected results, etc.
2. The benefits of test cases to us
1️⃣ Improve test efficiency and save test time
2️⃣The test case is before the automated test case
3. Design method of test case
3.1 Design test cases based on requirements
Designing test cases based on requirements is the basis of test design and development of test cases. The first step is to analyze the test requirements and verify whether the requirements are correct, complete, unambiguous, and logically self-consistent. On the basis of correct requirements, refine the test requirements, extract each test , and then design the test case according to each test point ;
For example: WeChat upgrade
Amount limit for sending red envelopes: 200 yuan
Time limit for receiving red envelopes on WeChat: 24 hours
Can the amount of 200 yuan be sent successfully? Can the amount be sent successfully when the amount exceeds 200 yuan?
When analyzing test requirements, it is generally divided into functional test requirements and non-functional test requirements.
Functional testing requirements :
For functional testing, functional block diagrams can be used to help us analyze the requirements of testing. In summary, functional testing requirements include the following, usually including the following aspects.1 ) Verification of each functional interface of the system2) Use business to string together functions for testing3) Functional consistency, interactivity (multifunctional interoperability) test4) Different input of the system, business data test of result output.5) The wrong operation of the function, the test of abnormal operation (belonging to the negative test)6) Algorithm verification used for function implementation, sometimes need to use code review7) Ease , user experience, often combined with functional testing and verification at the same timeAccording to specific needs, the functions of the system can be decomposed into several functional modules according to the business classification, user role (membership system of the restaurant) or user operation area, and then the test requirements analysis is performed according to the functional modules. According to the functional module division, business module division is the most common practice.
Non-functional testing requirements :
Non-functional testing requirements mainly involve performance , security, reliability, compatibility, ease of maintenance, and portability . From the perspective of test requirements analysis, each type of non-functional characteristic test needs to be analyzed separately according to the requirements. There may be mutual influence between them. For example, the higher the security, the more likely it is to bring greater challenges to ease of use and performance.
Here we take a 163 mailbox as an example of how to design test cases based on requirements
3.2 Equivalence classes of specific design methods
According to the requirements, the input (the output will be considered in special cases) is divided into several equivalence classes, and a test case is selected from the equivalence class. If this test case passes the test, it is considered that the represented equivalence class test is passed. In this way It can achieve as much functional coverage as possible with fewer test cases, which solves the problem that exhaustive testing cannot be performed.
1️⃣Effective equivalence class : a collection that satisfies the input requirements of user needs;
2️⃣Invalid equivalence class : A collection that does not meet the user's input requirements .
Equivalence class thinking design test case steps
1️⃣ Fully understand the needs
2️⃣Divide effective equivalence classes and divide invalid equivalence classes
3️⃣ Extract one of the data from the valid equivalence class to design a test case; extract one of the invalid equivalence classes to design a test case
For example:
Valid equivalence class: 6~15 digits Invalid equivalence class: less than 6 digits && greater than 15 digits
3.2 Boundary values
Boundary value analysis is a black box testing method for testing the boundary value of input or output. Usually the boundary value analysis method is used as a supplement to the equivalence class partition method. In this case, the test cases come from the boundary of the equivalence class.
Boundary value design test case steps:
1️⃣ Fully understand the needs
2️⃣ Find the boundary point
3️⃣ Design test cases for boundary points
boundary point
Upper point: boundary point
Inliers: Points inside the boundary
From point: a point near the boundary value (the point closest to the upper point outside the closed interval, and the closest point to the upper point in the open interval)
3.3 Judgment table
Decision tables are another tool for expressing logical judgments
- AND
Conditions are all true, the result is true. One of the conditions is false, the result is false - OR
If one of the conditions is true, the result is true. If all the conditions are false, the result is false - Not
Condition is true, result is false. Condition is false, result is true - Identity If
the condition is true, the result is true. If the condition is false, the result is false
How to design test cases:
1️⃣Analyze all possible inputs and outputs
2️⃣Find out the correspondence between input and output
3️⃣Design decision table
4️⃣Correspond decision table to each test case
For example: Assume that the processing rule of the business document is: "Taobao 618 event, the order has been submitted, the total amount of the order is greater than 300 yuan or there is a red envelope, then enter the discount".
3.4 Orthogonal tables
✨Two important concepts: factor: input variable variable: the value of each input variable
Each number appears the same number of times in each column. Each pair of ordinal numbers appears the same number of times in any two columns
3.4.1 How to design test cases through orthogonal tables
Fully understand the requirements ----> / determine the factors, determine the level ----> draw the orthogonal table ----> supplement the orthogonal table ----> convert the orthogonal table into a test case
Case: Continue to take registration as an example (similar tools can use Microsoft's PICT tool):
Factors: name, email, password, confirm password, verification code
Level: filled, not filled
allpairs draw an orthogonal table
1️⃣ Put the factors and levels into the excel table
2️⃣Copy the contents of the excel table directly into the txt text
3️⃣CMD enters under the allpairs installation path
4️⃣ Generate an orthogonal table
Test case at this point:
3.5 Scenario Design Method
Almost all current software uses event triggers to control the process. The scene when the event is triggered forms a scene, and different triggers of the same eventThe sequence of events and processing results form an event stream. This method can vividly describe the situation when the event is triggered, which is beneficial to the test designerDesigning test cases makes the test cases easier to understand and execute.A typical application is to use business flow to string together isolated function points to create an overall business feeling for testers, so as to avoid falling into the functionTendency to make mistakes while ignoring details of business process points
How to design test cases by scenario testing method:
Fully understand the requirements ----> determine the main event flow ----> determine the secondary event flow ----> each event flow is a test case
Take an ATM as an example:
3.6 Error Guessing Method
The error guessing method is a method of understanding the design of the tested software, past experience and personal intuition, inferring possible defects in the software, and then designing test cases in a targeted manner.
This method emphasizes the understanding of the requirements of the tested software and the details of the design and implementation, as well as personal experience and intuition.
The wrong guessing method is consistent with the basic idea of the currently popular "exploratory testing method". This type of method has a high input-output ratio in the agile development mode and is widely used in testing.
The disadvantage of this method is that it is difficult to systematize and relies too much on individual abilities.
Take registration as an example1. How to deal with special characters and spaces in verification?2. What is the case in the password verification?3. Special characters in the name?4. Whether the password is sent in plain text
4. Past interview questions
4.1 How to use Fiddler to simulate a weak network
Open Fidder and make sure that the mobile device and notebook IP are in the same network segment
1️⃣Open weak network settings
2️⃣ Check the network transmission rate:
Find BeforeRequest :
4.2 Interface Test
What interfaces does a page have? We can see the interface directly by pressing F12
1️⃣ Open the browser and press F12 directly
2️⃣Right click on an interface to copy it
3️⃣Open the Postman software and open the import:
4️⃣ HTTP request method, get, post, delete, test for parameters (pass all parameters, pass some parameters, pass no parameters, pass other parameters)
5️⃣ Performance:
4.3 Cup test case design
4.4 Design Test Cases for Wechat Sending to Moments