Black box test cases for software testing

Table of contents

1. Test case elements (four important elements)

2. The benefits of test cases to us

3. Design method of test case

3.1 Design of test cases based on requirements

3.2 Equivalence classes of specific design methods 

3.2 Boundary values

3.3 Judgment table

 3.4 Orthogonal table

3.4.1 How to design test cases through orthogonal tables

3.5 Scenario Design Method

3.6 Error Guessing Method

4. Past interview questions

4.1 How to use Fiddler to simulate a weak network

4.2 Interface Test

4.3 Cup test case design

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 ;

c223c22c43a9459f8311cf128f0b56a5.png

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 system
2) Use business to string together functions for testing
3) Functional consistency, interactivity (multifunctional interoperability) test
4) 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 review
7) Ease , user experience, often combined with functional testing and verification at the same time
According 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

06a80fc674d746f0bfbb1bc1187005d2.png

5e5196bb2ef14fd8ae7e21c8ad49ddbd.png

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:

0431aa12980046ce9aa9874cfedba263.png

 Valid equivalence class: 6~15 digits Invalid equivalence class: less than 6 digits && greater than 15 digits

b3bcf04f465c477c8f97fb9165a97f19.png

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)

b36e72fb689747909c2a7e63a6b69dff.png

e0925c53f0154a5186cb1f43c574d50a.png

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".

e72b9cc5c61147cea1af61c87204a86e.png

069711d96b9d432bbf4366436c6b6992.png

 3.4 Orthogonal tables

2e1bde0047ba48baa69c9d5c2d874dc5.png

✨Two important concepts: factor: input variable variable: the value of each input variable

2ce5fb7af2e044a5849c0b5e5f172ce6.png

 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

0b56e38020204f27a0289daa0eb1f8db.png

2️⃣Copy the contents of the excel table directly into the txt text

f5e0c4f5cf0e45ce9eab8d9aa8bb4bed.png

3️⃣CMD enters under the allpairs installation path

a222d991f1644a7b8b1bb0ef1f899518.png

4️⃣ Generate an orthogonal table

dfb2d277cd144d338b6be3c93c796b0a.png

Test case at this point:

133aa489200b48eb82850129a31c2fc4.png

99b4c3497385491995dfad4a4cd43436.png

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 event
The 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 designer
Designing 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 function
Tendency 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

94b160310b1b4f3bb224d3639191a765.png

 Take an ATM as an example:

3a4a15d90e19423da6c70e1a83ae13ab.png

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 example
1. 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

9d82c5b2e93b44f7b503f9fb071ad94f.png

 2️⃣ Check the network transmission rate:

fc8b49a64f874304b09d879e097799f6.png

Find BeforeRequest :

85cb9f71125e49aa9a17e65d80896885.png

bee6f5eba72e4e89bc4bf8dfc38ae909.png

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

8f6703869d6b4da49d8805b00afefbcd.png

 2️⃣Right click on an interface to copy it

58e0c18e15ef4816bd1911a38c5ebb7d.png

 3️⃣Open the Postman software and open the import:

0b70867b1be145a0818a9fd52894a040.png

4️⃣ HTTP request method, get, post, delete, test for parameters (pass all parameters, pass some parameters, pass no parameters, pass other parameters)

157088de7c944c4d92f9d473fca063c2.png

5️⃣ Performance:4c6198c19efb4afa875c6c7c52ce0433.png

4.3 Cup test case design

f5142147555843a19dce795633f3378e.png

4.4 Design Test Cases for Wechat Sending to Moments

497a9530f94049e48bff7833d7876fcb.png

 

 

 

Guess you like

Origin blog.csdn.net/m0_72161237/article/details/130273285