【Test Case Design】Black Box Testing Methodology-Scenario Method

scene method

Simulate the scene when the user operates the software, mainly used to test the business process of the system.

use case scenario definition

Basic flow: an operation path implemented according to the correct business process

Alternate flow: the flow of operations that lead to an error in the program

Scenario method use case design steps

According to the requirement specification, draw the flow chart of the functional module

Based on the flowchart, describe the basic flow and alternative flow of the program

Generate different scenarios according to the alternative flow of the basic flow, and construct a list of scenarios

Generate corresponding test cases for each scenario

Re-review the generated test cases and remove redundant use cases

Determine test values ​​for each test case

Advantages and disadvantages of scene method

Advantages: It is suitable for the analysis and testing of business processes, and has a good test effect on the overall business scenario.

Cons: Lack of validation for individual feature items. It needs to be used in combination with methods such as equivalence classes and decision tables.

the case

Taobao shopping process

1. According to the requirement specification, draw the flow chart of the functional module

2. According to the flow chart, determine the basic flow and alternative flow

elementary stream

Enter Taobao → do not need to register → browse items → select items to purchase → purchase directly → become a member → fill in the verification code → pay to Alipay → wait for receipt → confirm receipt

alternate flow

Alternative flow 1: Need to register → fill in the registration information → pass the verification, return to the basic flow to browse the item step.

Alternative flow 2: Need to register → fill in the registration information → fail the verification → fill in the registration information again → pass the verification, and finally return to the step of browsing items in the basic flow.

Alternative flow 3: Add to shopping cart → no more purchases, return to the basic flow to purchase products.

Alternative flow 4: Add to the shopping cart→continue to purchase→add to the shopping cart→continue to purchase→add to the shopping cart→no longer purchase, and finally return to the basic flow to purchase products.

Alternative flow 5: Not a member → fill in the registration information → pass the verification, return to the basic flow payment verification step.

Alternative flow 6: Not a member → fill in the registration information → fail the verification → fill in the registration information → pass the verification, and finally return to the basic flow payment verification step.

3. Construct the scene according to the alternative flow of the basic flow

Scenario 1: After entering Taobao, you are already a member, and you can directly purchase products and make payment, and successfully shop. (elementary stream)

Scenario 2: After entering Taobao without registering, register an account first, and then purchase products. (basic stream + alternative stream 1)

Scenario 3: After entering Taobao without registering, register an account first, and a verification error occurs during registration, and then purchase products after re-registering. (basic stream + alternative stream 2)

Scenario 4: After purchasing the product, instead of purchasing it directly, add it to the shopping cart and pay through the shopping cart. (basic stream + alternative stream 3)

Scenario 5: After purchasing the product, add to the shopping cart, continue to purchase, add to the shopping cart, continue to purchase, and then pay through the shopping cart. (basic stream + alternative stream 4)

Scenario 6: When you are about to purchase a product, you find that you are not a member. You need to register and then verify the payment. (basic stream + alternative stream 5)

Scenario 6: When you are about to purchase a product, you find that you are not a member and need to register. A verification error occurs during the registration. After the re-registration is completed, the payment verification is performed. (basic stream + alternative stream 6)

4. Generate corresponding test cases for each scenario

use case number

test point

test steps

expected outcome

1

Successful shopping on Taobao website

Prerequisites: Logged in
1. Enter Taobao
2. Browse items
3. Select items to buy
4. Direct purchase
5. Payment verification
6. Pay to Alipay
7. Wait for receipt
8. Confirm receipt

Confirm the successful receipt of the order and complete the order

2

Unregistered Taobao account, register an account first after entering the webpage

Premise: Unregistered
1. Enter Taobao
2. Choose to register
3. Fill in the registration information

It shows that the registration is completed and the account is logged in.

3

I have not registered a Taobao account. After entering the webpage, I registered an account first, and an error was found during the registration.

Premise: Unregistered
1. Enter Taobao
2. Choose to register
3. Fill in the registration information

The registration error message is displayed, the registration is not completed, return to the registration page, and register again.

4

After purchasing the product, the product is added to the shopping cart without placing an order directly

1. Enter Taobao
2. Browse items
3. Add items to shopping cart

Display items added to the shopping cart, enter the shopping cart page, and you can see the added items.

5

After purchasing the product, without placing an order directly, the product is added to the shopping cart, and then continue to purchase

1. Enter Taobao
2. Browse items
3. Add items to the shopping cart
4. Add other items to the shopping cart

All products are added to the shopping cart, and then enter the shopping cart page, you can see all the added products.

6

When placing an order for a product, it will be checked whether it is a registered member. Non-member status must fill in the registration information

Premise: Not registered or logged in
1. Enter Taobao
2. Browse items
3. Select items to buy
4. Direct purchase

Automatically jump to the member registration and login interface, fill in the registration information to register, or log in directly. After the login is complete, enter the payment verification.

7

When placing an order for a product, it will be checked whether it is a registered member. Non-member status needs to fill in registration information, and an error occurred during registration.

Premise: Not registered or logged in
1. Enter Taobao
2. Browse items
3. Select items to buy
4. Direct purchase

Automatically jump to the member registration and login interface, fill in the registration information to register, if an error occurs, an error message will be prompted. The registration is not completed, return to the registration page and register again.

Guess you like

Origin blog.csdn.net/Yocczy/article/details/127828463