Software test case design

xiaoxiao2021-03-06  42

Software test case design

Author: Wang Jinglan

Summary

A project finally presents the quality of the user, and the degree and intensity of the test execution are unparalleled. The basic purpose of the design case design is to determine a set of test data that is most likely to discover an error or a class of errors. The test case constitutes the basis of design and formulating a test process, so the quality of test cases determines the effectiveness of the test work to a certain extent. A good test case makes the effect of testing the effect of half a effort, and can find some hidden bugs as soon as possible, the design of the test case is the weight in software development.

Keywords: software testing, test case, testcase, use case design

A Test Case Is A Series of Tests Used To Determine Wraperly. OFTEN THATIS ​​TRYING The Same Operation over and over again with Little in the procedure.

A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of an application is working correctly. A test case should contain particulars such as test case identifier, test case name, objective, Test Conditions / Setup, INPUT DATA Requirements, Steps, And Expected Results.

1 Introduction

1.1 The role and significance of test cases in software products

Software products have brought great convenience to people's daily lives and work. Similarly, people have also increased the quality of the software products to a further height. With the continuous emergence of the software crisis, the status of the test is unprecedented, and people realize that the earlier the test starts, the sooner of software will be discovered, bringing the entire software. The more costs in development also decline. Software test is the primary means of discovering the defects in the software and the only effective way. The higher the emphasis on software quality, the more important software testing works during software development.

Fully override testing and requires the strength and depth of the test work and the possible operations that may occur in each reality must be correct. Many people think this seems to be contradictory. Software testing can never be exhausted testing, and want to make the efficiency of the test work up to the highest, then how to take care of the workload and efficiency, often become the bottleneck problem in the test work. How to test, what way to test, what kind of environment and what kind of conditions are tested, test workload and how to avoid repetition tests, etc. How to consider the factors that should be considered, how to coordinate and synchronize, in These issues should be fully described in the test case.

Therefore, the design requirements of the test cases in the weight in the software test work have also risen above higher levels. The test case not only constitutes the basis of design and formulating testing processes, but also a proportion of the depth of the test and the number of test cases. In general, determining whether the test is completely evaluation method is based on the coverage of the demand, and this is based on the number of test cases performed, implemented, and (or) the number of test cases, and the number of test works and test cases. Proportion; the type of test design and development and the required resources are mainly controlled by test cases. These make test cases in a more important position throughout the software development process.

1.2 Definition of test case

Test cases are a set of test inputs, execution conditions, and expected results prepared for a particular goal to test whether a program path or verification meets a particular requirement.

Robert v.binder is described in this, test example: input, execution conditions, and a collection of expected results developed for a special goal. A representation or implementation of a definition IUT (measured implementation, named) and its environment, test input, or conditions, and pre-test states of the expected results. 1.3 Elements that should be included in the test case

First, the test case should include software or project name, the scope of the project, the background, author, write time and other document information; according to the definition and purpose of the test case, the content of the test case should be: Title and Sample number, version number, modification Record, target and assumptions premise / possibly, input data / code, test steps, expected output, and error discovery methods.

1.4 Item Need to pay attention in test cases

Each test case clearly describes the use cases, use cases, test objectives, or conditions for the examples. Each test case describes the expected results and the method of evaluating the result.

For each test requirement, it is necessary to consider testing under the condition of positive testing and negative testing in the test case, or by determining two test cases, a test case represents the expected condition, which can be used to verify whether it is correct or Combine expected (positive test). Another test case represents unacceptable, abnormal or unexpected conditions, which can be used to verify whether the test demand is not performed (negatively tested) in a non-expected manner.

In general, for each requirement of the test, at least there must be a positive test case and a number of negative test cases to check whether the system can process it normally in an abnormality, or the user has wrong Friendly tips when operating, and more.

Test cases have been determined to perform all product demand behaviors in the test target, including (depending on the situation): function, data confirmation, business rules implementation, test target workflow or control, data stream, object status, performance (including Workload, configuration and intensity), security / accessibility, compatibility. Each test case will explain or / represent a unique input set or event order, which produces a unique test target behavior, reviewing the test cases that produce the same behavior and determine if they are equivalent, that is, whether they perform test targets path.

Each test case (or each set of test cases) determines the initial test target status and test data status. The test case name and / or ID is consistent with the test workpiece naming conventions.

2 Overview of design methods for test cases

According to the test method, it is divided into black box test and white box test. The design method of the corresponding test case can also be divided into the use case design for black box testing and the use case design for white box testing.

There are many test case design methods, which have been proposed today, and the following is a brief introduction to some more important, common methods.

2.1 Design method for test cases for white box test

2.1.1 logical coverage

Logical coverage includes: statement override, determination override, conditional coverage, determination-condition cover, conditional combination coverage, path coverage, simple description as follows:

The statement coverage is to design several test cases, run the test program, so that each executable statement is executed at least once.

The determination coverage is to design a number of test cases, run the test procedure, so that each judgment branch and the fake branch in the program are at least once.

The conditional coverage is to design a number of test cases, run the measured procedure, so that each of the probability of each of the programs may perform at least once.

The determination-conditional coverage is the design sufficient test case, so that all the possibilities of each of the conditions in the determination are at least once, each of which executes at least once.

The conditional combination coverage is a test case for design, running the measured procedure, so that all possible conditional values ​​of each judgments will be executed at least once.

The path test is a sufficient test case to overwrite all possible paths in the program.

2.1.2 Basic Path Test

The basic path test method compresses the number of coverage to a certain limit, and the cyclic body in the program is only once. It is based on the program control flow diagram, analyzes the loop complexity of the control structure, exports the basic executable path collection, design test cases. Designed test cases To ensure that every executable statement of the program is at least once in the test.

2.2 Test case design method for black box test

2.2.1 Equivalent division

The so-called equivalent class division refers to a set of values ​​that represent many possible input values, and the program is the same.

The method of equivalent class division is a method for designing the test force design after the boundary value analysis method. Division equivalence class, determine test case

Equivalent class division is a typical black box test method. When using this method, the internal structure of the program is not considered, and the test case is designed according to the specifications of the program.

The equivalent class division method divides all possible input data, ie the input domain of the program into several parts, then selects a few representative data as a test case from each part.

There are two different cases of equivalents: effective equivalents: refers to a collection of reasonable, meaningful input data.

Invalid equivalence class: means a collection of unreasonable and meaningless input data for the specification of the program.

When designing test cases, you should consider the design of effective equivalence class and invalid equivalents.

2.2.2 Boundary value analysis

When the design test case determines the input and output parameters, most cases are used by boundary value analysis methods, and test cases with boundary value analysis is the strongest.

Boundary value analysis is also a black box test method, which is a supplement to the equivalent classification method.

People have learned from long-term testing work, a large number of errors are in the boundaries of the input or output range, not inside the input range. Therefore, for various boundary conditions design test cases, you can find more errors.

2.2.3 Error estimation method

People can also rely on experience and intuitive estimation of various errors that may exist in procedures, thereby preparation examples of these errors. This is the error speculation method.

The basic idea of ​​the error speculation is to list all possible errors in the procedure and the special cases of easier errors, depending on them choose the test case.

2.2.4 Cuisine

If the program's functional description contains a combination of input conditions, you can use the causal graphics at the beginning. If various combinations of input conditions must be considered at the time of test, a combination of a variety of conditions can be used, which can be used to design a test case, which requires the utilization of the cause.

The result of finally generated in the causal figure is the determination form. It is suitable for checking various combinations of program input conditions.

3 review and maintenance of test cases

3.1 Review of test cases

Test cases need to be reviewed after design, and the contents of the review are as follows:

Is the use case complete? Is every need to have its corresponding test case to verify?

Is every design element with its corresponding test case to verify?

Can you produce a unique test target behavior?

Whether each test case explains the expected results?

Whether each test case (or each set of test cases) determine the initial test target status and test data status?

Does the test use include all a single boundary?

Does the test case include all business data flow?

Whether all test case names, IDs agree with the test workpiece namings?

Personnel who need to participate in test cases: project manager, system analyst, test designer, tester

3.2 Update Maintenance with Example Library

With the development of software projects, the data of the example library has maintained as the progress of the project, mainly includes: the modification of the case: the modification of the case, the redundancy use case is deleted, the test case is increased, and the operation performed in the note Middle school modifiers and reasons for modifying time and changes. 4 test case example

This test case is to measure the object in a B / S structure login function point, which is a black box test case. Suppose the user used the browser used to IE6.0 SP4.

The function is described as follows:

1. The user enters the corresponding address in the address bar and requires the login interface;

2. Enter the username and password, log in, and automatically verify and give the corresponding prompt information;

3. If the username or password is not entered, the system will give the corresponding prompt information after logging in;

4. The IE is automatically turned off when it is verified three times in a row.

Figure 4-1 Login Interface

Table 4-1 Login Interface Test Example

Use case ID XXXX-XX-XX Case Name System Login Sample Description System Login User Name Example, the password is correct, enter the system page information contains: page background Display Username and password entry interface, enter the data after entering the login system interface with an example entry open IE, enter the corresponding address in the address bar to enter the system login page Test case ID Scene test Steps Expected results Remarks TC1 Initial page Display From the exemption entry to enter the page element complete, display and detailed design consistent TC2 username entry - Verify input existing User: Test Input Success TC3 User Name - Fault Tolerance Verification Enter: AAAAabbbbccccdddddeeeee Enter the blue displayed character, the system rejects the input data exceeds the specified length range TC4 password - password entry input with the username: TEST input success TC5 system login - Success TC2, TC4, click the login button login system Success TC6 system login - User name, password check does not enter the username, password, click the login button system login failed, and prompt: Please check the username and password Enter if the correct TC7 system login - password verification Enter the username, no password, click the login button system login failed, and prompt: You need to enter a password TC8 system login - password validity verification Enter the username, enter the password and username Inconsistency, click the login button system login failed, and prompt: Error password TC9 system login - Enter the username, password that does not exist in the validity check, click the login button system login failed, and prompt: The username does not exist TC10 System Login - Security Verification For 3 consecutive unsuccessful system prompt: You do not use the system's permissions, please contact your administrator! ... ...

references:

[1] Zheng Renjie, Yin Nun, Tao Yonglei, Practical Software Engineering (Second Edition), Tsinghua University Press, 2001.10

[2] Yang Wenlong, Yao Shuzhen, Wu Wei, software engineering; Electronic Industry Press, 1997.11

[3] Robert V.Binder, Huaqing, Wang Binjun, Chen Li, People's Posts and Telecommunications, 2001.4

-------------------------------------------------- ---------------------------------

[About the Author]

Name: Wang Jinglan, female, graduated from Xi'an University of Electronic Science and Technology in 2002, Computer Information Management. Research direction: software test management

Email: peaceblue2001@163.com

Hobbies: listening to music, climbing mountains

转载请注明原文地址:https://www.9cbs.com/read-51792.html

New Post(0)