Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Method of designing test cases

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Comprehensive testing strategy (universal oil)

In any case, test cases must be designed using equivalence classes and boundary values.

When there is a logical relationship and constraint relationship between conditions, the causal diagram method will be used to append the test case.

If there is state-to-state transition or state-to-state switching, the state diagram method will be used to append test cases.

If there is a business flow, use the scenario method to append the test case

Finally, the error inference method is used to append the test case.

PS: orthogonal test method is generally not applicable.

Lecture one

1. Testing idea: first consider the general direction of testing (determine the test type, method), and then subdivide.

two。 Items of the defect (properties of the defect, contents of the defect):

Pre-conditions, test environment, operation steps, expected results, actual results, status, priority, severity, attachment, use case number, defect title, defect number, discoverer, discovery date.

3. Test case meaning: a collection of test data, procedures, expected results, and actual results

4. Content of the test case:

Pre-conditions, test environment, operation steps (input data), expected results, actual results, priority, use case number, use case name, module name, pass, designer, design date.

5. The role of writing test cases

Guidance: test cases provide requirements and guidance for the testing process, reducing the ability requirements for testers

Organization: writing test cases is beneficial to the organization and management of tests

Functional coverage: writing test cases can reduce missed testing of software functions.

Repeatability: facilitates repeated testing of different versions of the software

Statistics: statistics can determine the coverage of tests and the quality of software products

6. Matters needing attention

Use the use case that is most likely to find an error

Use cases are not repetitive or redundant

Select the most effective of a set of similar test cases

During the testing process, test cases are not static and need to be constantly updated and maintained.

7. The test case is the smallest entity in the test (entity)

8. Ways to write test cases: word, excel (used more), tools

Write test cases using excel:

Prerequisites: omit repetitive steps

Use case numbering scheme: module initials + serial number:

The role of the use case number:

1) good classified management of use cases

2) unique identification and easy to find

3) defects are associated with use cases to facilitate bug location

9.Bvt testing (priority testing): tests based on the priority of the designed test case

Designing a use case can find problems that have not been found so far, and the use case is an efficient use case.

10. Test method: black box test eight methods: 1. Equivalence class 2. The boundary value is 3. Figure 4. Decision Table 5. State figure 6. Scene method 7. Orthogonal test method 8. Error inference method

Use the method of boundary value: just less than the boundary value, equal to the boundary value, just equal to the boundary value.

Lecture 2

Equivalent class division method: divide the input of the program into several parts, and select a small number of representative data from each part as test data

Write test cases according to the equivalence class table

Assign a unique number to each equivalent class in the equivalence class table

Design a test case so that it can cover as many valid equivalence classes as possible that have not been covered; repeat this step so that all valid equivalence classes are covered by the test case

Design a test case so that it covers only one invalid equivalence class; repeat this step so that all invalid equivalence classes are covered by the test case

The hypothesis of equivalence class

If a test case in an equivalence class can catch a defect, then selecting other test cases in that equivalence class can also capture the defect

If a test case in an equivalence class cannot catch a defect, then selecting other test cases in that equivalence class will not capture the defect.

The method of determining the boundary value: select the value that is exactly equal to, just greater than or less than the boundary as the test data, focusing on testing the last positive legal data and illegal data that has just exceeded the boundary.

If the range of values is defined by the input condition, the values inside and just beyond the boundary should be used as the test case.

If the number of values is defined, the maximum number, the minimum number, 1 greater or less than the maximum number, 1 greater or less than the minimum number should be used as test cases respectively.

For output conditions, the two principles mentioned above can also be applied to test case design.

If the input mentioned in the requirements specification is an ordered set, you should pay attention to selecting the first and last elements of the ordered set as test cases.

Lecture 3

Boolean logical operator

Identity

Vs.

Or

Non

And non

Or not

Constraint relation

E constraint: the reason cannot be true at the same time, but it can be false at the same time

I constraint: one of the reasons is always true, or it can be true at the same time, but not false at the same time.

O constraint: there are and only one of two reasons is true

R constraint: when reason an is true, reason b must also be true; otherwise, it is not true.

M constraint: if the result an is true, the result b must be false; if the result an is false, the state of the result b is uncertain

Using causality diagrams to design test case steps

Analyze the application under test and determine the cause (input) and result (output)

Determine the logical relationship of causality

Determine the constraint relationship

Convert the causality diagram into a decision table

Simplify the decision table according to the constraint conditions, and give the results.

Design test cases according to the decision table

Advantages of using causality diagrams to design use cases:

The mutual combination and mutual restriction of multiple inputs are considered.

This paper provides a test case design method for the system with input combination conditions.

Lecture 4

Orthogonal test method

Number of L rows (horizontal ^ factor)

L: the code name of orthogonal table

Number of rows: the number of rows in an orthogonal table, that is, the number of trials

Standard orthogonal table: number of rows = number of factors * (level-1) + 1

Mixed orthogonal table: number of rows = ∑ (factor * (level-1)) + 1

Number of factors: the number of columns in an orthogonal table, that is, the function point of the test

Level: the maximum number of values that can be obtained by a single factor

Two characteristics of orthogonal table

Neat comparability

Equilibrium dispersion

The steps of designing Test cases by orthogonal Test method

Judge what factors there are.

What are the levels of each factor?

Choose an appropriate orthogonal table

The number of rows selected is greater than or equal to the actual number of rows

The number of selected factors is greater than or equal to the sum of the actual factors.

The number of selected levels is greater than or equal to the actual maximum number of levels

The least number of rows

Map the entered values to the table

Take the combination of factors and levels of each row as a test case

Plus combinations that are suspicious and do not appear in the table

Benefits of using orthogonal tables

Ensure that all inputs are combined in pairs

Generate a set of efficient and concise test cases to effectively improve the testing efficiency

All the paired combinations generated are evenly distributed, that is, the tests for each input are balanced.

The design of test cases directly against the orthogonal table is simple and not easy to make mistakes.

It is easy to develop a test case tool based on orthogonal table strategy and generate test cases automatically.

Lecture 5

Minimum requirements for designing test cases according to state diagrams

Test cases must cover all states

The workflow commonly used by users must design test cases.

The least commonly used branches between test states

Test all states and their return values

Steps to design test cases using the state diagram method

List the input events of the system under test

Add all possible inputs to the idle state to determine which new states are generated

Add all possible inputs to each new state generated in the previous step to determine which new states are generated

The loop performs the third step until no new state is generated

List all states and design test case tables according to the system flow (minimum requirements must be met)

Convert a test case table into a test case

Basic design steps using the scene method

According to the instructions, describe the basic flow of the program and the alternative flows

Generate different scenarios according to the basic flow and the alternative flows

Generate corresponding test cases for each scenario

Review all the generated test cases, get rid of the redundant test cases, and determine the test data value for each test case after the test case is determined.

Basic flow: the easiest path through the use case

All other flows are alternative flows, and an alternative flow may start with the basic flow, execute under certain conditions, and then rejoin the basic flow, or it may originate from another alternative flow, or terminate the use case and no longer join a stream

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report