Test case design method
scene method
Simulate user actions as realistically as possible. For example: order, delivery, commodity status change
use case scenarios are used to describe the path flowing through the use case, and traverse all the basic flows and alternative flows on this path from the start to the end of the use case.
The scenario method is mainly based on:
business (demand) level:
in-depth understanding of the important functions, business logic, and industry background of the software under test. Business logic includes what the system does and how to implement this process.
Technical level:
based on equivalence class division, effective equivalence class - simulate the correct operation of the user; invalid equivalence class - simulate the wrong operation of the user
Core concept:
basic flow (correct flow, effective flow): simulate the correct operation of the user Process
alternative flow (error flow, invalid flow): simulate the operation flow of user error
Usage scenario: suitable for many modules and complex processes
Design ideas:
1. Find different modules and find the entry module
2. Perform scenario analysis on the entry module
3. The entry module jumps to the next module and continues to use the scenario analysis
For example:
registration process
login process
Equivalence Class Partitioning
Definition: Divide
the input into several equivalence classes according to the requirements, and select a test case from the equivalence class. If the test case passes, it means that the entire equivalence class test has passed . It is impossible to complete exhaustive testing Equivalence classes allow us to cover as much functionality as possible with fewer test cases
Classification
Divided into valid equivalence classes and invalid equivalence classes
Valid equivalence classes: a set of meaningful inputs that are legal for requirements specification
Invalid equivalence classes: a set of unsatisfied requirements
boundary value method
Definition:
Boundary value analysis is a supplement to the division of equivalence classes. Boundary values are generally used to find errors from the edge of the equivalence class.
Basic idea:
take exactly equal to, just greater than, and just less than the boundary value as test data
Special values:
0/null, N/A, null are special values, which also need to be considered when considering boundary values
For example:
WeChat red envelope: the minimum amount is 0.01, the maximum amount is 200 yuan. The
remainder of the input in a text box includes 2-255 characters
. Equivalence class division and boundary value analysis are generally applicable to the case where only one input box is considered
Examples:
1. Triangle problem
2. Mobile phone number verification
3. Email verification
4. Two-digit integer addition calculator
5. Reimbursement approval
6. Ordinary text verification
7. Number text box
8. Amount text box
9. Gender selection
10 .Commodity type selection (single-choice drop-down box)
11. Select province and city
12. Personal preference selection (check drop-down box)
Judgment table method
A tool that defines
, analyzes and expresses the response of the measured object to these inputs under several input conditions.
When encountering complex business logic, this table can be used to clarify the logical relationship (input boxes are related, such as user name and password)
Applicable For modules with strong logical relationship
Important Concepts (
1) Condition Condition stub: All inputs of
the measured object defined in the requirement specification All operations of the action item: for the action pile, the possible value of the response of the object under test
Application steps of the judgment table
(1) Understand the requirements and determine the condition piles and action piles
(2) Design and optimize the judgment table
(3) Fill in the action items
(4) According to the performance of the output results of the judgment table, merge the judgment tables (optional) , simplify the decision table; if the output is the same, in the corresponding input, there is only one conditional value that does not have any effect on the action and can be combined
cause and effect diagram
The main components of a cause and effect diagram: causes, intermediate nodes, effects
Steps to follow to design test cases using cause and effect diagrams:
- Specify which causes (inputs) and which are effects (outputs) in the specification of the analysis program, assigning an indicator to each cause and effect
- Analyze the semantics in the program specification, determine the relationship between cause and cause, cause and effect, and draw cause and effect diagrams
- Due to the limitation of the grammatical environment, some combinations of causes and causes, and between causes and effects cannot occur. For this special case, some token table names are used in the causal diagram to constrain or restrict conditions.
- Convert a cause and effect diagram into a decision table
- Design test cases according to each column of the decision table
- If you can get the decision table directly, you can design test cases directly based on the decision table (you can skip the part of drawing the cause and effect diagram)
wrong guessing
The speculative method is based on experience and intuition to speculate on various errors that may exist in the program, so as to design test cases in a targeted manner
The basic idea of error guessing:
enumerate all possible errors in the program and special cases that are prone to errors, and select test cases according to them
Basic elements:
(1) Familiar with the development habits of development
(2) Familiar with the same type of project business
Twenty-eight principle: 80% of the problems are in 20% of the modules
Orthogonal test method
Orthogonal test method is a multi-factor and multi-level test method. It uses the orthogonal table to design the test, and replaces the comprehensive test with a small number of tests. According to the orthogonality of the orthogonal table, from the comprehensive test. Select an appropriate amount of representative points for testing, these representative points have the characteristics of "evenly dispersed, neat and comparable".
If there is any infringement, please contact by email, I am sorry.
This is only for learning personal notes, and if there is any reprint, please indicate the source.
Contact Email: [email protected]
Learn to test the penguin group together (chat, water group, do not disturb advertising): 826471103
Reference:
[1]: "Software Evaluator Tutorial" - Tsinghua University Press