Table of contents
1. Equivalence classes and boundary values
1. Equivalence classes and boundary values
Program requirements:
1. Name: 1-20 characters, cannot contain characters, cannot be empty
2. Age: an integer between 18-60, cannot be empty
Name:
valid equivalence classes
1-20 characters, non-numeric, non-empty
Invalid equivalence class
1-20 numbers, 1-20 spaces, 1-20 spaces, mixed characters, 1-20 mixed numbers and characters, 1-20 mixed spaces and characters, no input, more than 20 characters
Boundary value
0 characters, 1 character, 2 non-numeric non-space characters, 19 non-numeric non-space characters, 20 non-numeric non-space characters, 21 non-numeric non-space characters
age:
valid equivalence classes
An integer between 18-60
Invalid equivalence class
Non-integers between 18-60, integers less than 18, non-integers less than 18, and numbers greater than 60 are empty.
Boundary value
17、18、19、59、60、61
2. Cause and Effect Diagram
In the automatic drink vending machine, you can input 1.50 cents or 2 yuan coins. The price of a bottle of drink is 1.5. Coke, Sprite, black tea, press that drink, and which drink will come out. If you enter 2 yuan and press the corresponding drink, a 5 cent coin will be found when the drink comes out.
1) Find all input and output
Input: 1.5 yuan, 2 yuan, Coke, Sprite, black tea
Output: Coke, Sprite, black tea, 5 cent coins
2) Find the relationship between input and output
Input 1.5 yuan, press Coke, output Coke
Enter 1.5 yuan, press Sprite, and output Sprite
Input 1.5 yuan, press black tea, output black tea
Input 2 yuan, press Coke, output Coke and 0.5 yuan
Input 2 yuan, press Sprite, output Sprite and 0.5 yuan
Belongs to 2 yuan, press black tea, output black tea and 0.5 yuan
3) Draw a cause-and-effect diagram based on the relationship between input and output
4) Judgment table based on cause and effect pictures
5) Write test cases based on the decision table
Input 2 yuan, press Coke, output Coke and output 5 cents coins
Input 2 yuan, press Sprite, output Sprite and output 5 cents coins
Input 2 yuan, press black tea, output black tea and output 5 cents coins
Enter 1.5 yuan, press Coke, output Coke
Enter 1.5 yuan, press Sprite, and output Sprite
Enter 1.5 yuan, press black tea, and output black tea
Input 2 yuan, do not press the button, do not output any drinks, and exceed a certain time limit, prompt the user "Please press the drink button"
After inputting (appropriate) coins, press different drink buttons multiple times, the drink you pressed for the first time will appear and the prompt "Insert the coin once, you can only press one drink button"
First enter 2 yuan, then 1.5, the beverage machine prompts that you cannot enter multiple coins in a row.
6) Supplementary test cases
I entered 2 yuan, but there was no change in the beverage machine. The beverage machine prompted "Contact the staff"
The beverage machine is disconnected from the network and the power is cut off.
The drink machine is damaged and there is not enough drink.
3. Scenario design testing
Dangdang online book shopping
Log in - search for books - add to shopping cart - checkout - pay
1) Log in smoothly
Successfully find the target book, add the book to the shopping cart, select the book in the shopping cart, click checkout, go to the order page to pay successfully, and the book purchase is completed
2) Log in
The password you entered is incorrect and it prompts "The password you entered is incorrect, please re-enter it."
If you enter the wrong password more than three times, your account will be locked.
The user entered an error and the message "The user name was entered incorrectly, please re-enter"
Wrong password, wrong username, wrong verification code, wrong mobile phone number, username does not exist
3) Find books
Out of stock, off the shelf, no changes to the book
4) Add to shopping cart
Shopping cart reaches limit
5) Click to settle
Full discount activity (full discount in this store, can full discount coupons be stacked)
Enter order address selection
6) Payment
When switching payment methods, if the balance is insufficient, can I switch to other payment methods by default?
The payment password is wrong, choose to let others pay.
Face, fingerprint, password-free
Jingdong Baitiao, pay in installments