Design a "perfect" test case, user login module instance...

foreword

A good test case must be a complete set, which can cover all equivalence classes and various boundary values, regardless of whether defects can be found

What are the characteristics of a good test case

Overall completeness: it must be a complete whole, which is a collection of valid test cases that can completely cover the test requirements.
The accuracy of equivalence class division: for each equivalence class, it can be guaranteed that as long as one of the input tests passes, the other input The page must pass
the completeness of the equivalence class set: it is necessary to ensure that all possible boundary values ​​and boundary conditions have been correctly identified

The three most commonly used test case design methods

Equivalence class division:
Divide all possible input data into several subsets;
if any input data is valid, it constitutes an effective equivalence class; if
the input data has the same effect on disclosing potential errors in the program, it constitutes an invalid equivalence class;
In the future, as long as a value is arbitrarily selected from each equivalence class for testing, a small number of representative test inputs can be used to obtain better test coverage results;

Boundary value analysis:
select input and output boundary values ​​for testing;
boundary value analysts supplement equivalence class division;

Error inference method:
Based on the understanding of the design of the tested software system, past experience and personal intuition, the possible defects of the software are speculated, and the test case method is designed in a targeted manner. The emphasis is on the understanding of the requirements of the software under test and the details of the design and implementation

Examples of wrong guesses

C1

How to design good test cases

Example: Test the GUI test for end users
The core test point: Verify that the software satisfies the requirements

How to do it: Get involved in the requirements analysis phase and technical design phase

Achievements: Design an end-to-end test case set considering end-user usage scenarios, mainly to verify whether each business requirement is met, based on a black-box test design method

Key point: When designing a specific use case, you must first figure out the multiple software function requirement points corresponding to each business requirement, then analyze the multiple test requirement points corresponding to each software function requirement point, and finally target each test Requirement point design test case

Design test cases with "user login" function

[User login] function mapping diagram

key point:

Starting from software functional requirements, it is very important to identify test requirements comprehensively and without omission, which will directly affect the test coverage of use cases. For example, if you do not identify the security testing requirements of the user login function, then the subsequent design of the test cases will not involve security at all, which will eventually cause important test loopholes.

To identify each test requirement point, it is necessary to comprehensively design test cases by comprehensively using equivalence class division, boundary value analysis and error guessing methods.

Take the functional requirements of user login as an example

First, divide the two input boxes of "username" and "password" into equivalence classes, and use the error guessing method for the identification of invalid equivalence classes (for example: the username contains special characters); then supplement the boundary value of the input
box Use cases, such as: empty, the length of the username is just greater than the limited length;

Advanced experience in designing test cases

In-depth understanding of the architecture of the tested software, discovery of system boundaries and potential errors in system integration
must have a clear understanding of the internal architecture, such as: database connection mode, database read-write separation, message middleware configuration, cache system level Distribution, integration of third-party systems

It is necessary to have a deep understanding of the design and implementation details of the software under test. The internal processing logic
is only designed according to the test points. The test cases can only cover the "surface" layer, and often the internal processing flow and branch processing cannot be completely covered; in practice, you can pass the code Coverage metrics to find possible test gaps

test case design

Generally divided into two
explicit functional requirements: refers to the specific functions that the software itself needs to implement, such as "successful login", "wrong password", etc.

Non-functional requirements: mainly involve the three dimensions of [security], [performance], and [compatibility]. Often non-functional requirements are the key factors that determine software quality

Test case for user login
Please add a picture description

 

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you! Partners can click the small card below to receive

Guess you like

Origin blog.csdn.net/okcross0/article/details/132187844