5. Design (black box) test cases (2) Orthogonal Table Method & Scenario Design Method & Error Guessing Method

Directory

1. Orthogonal table

1.1 Concept

1.2 Orthogonal table method design test case

1.2.1 Steps

1.2.2 Examples

2. Scenario Design Method

2.1 Concept

2.2 Scenario design method to design test cases

2.2.1 Steps

2.2.2 Examples

3. Wrong Guessing

3.1 Concept

3.2 Example

4. Case

4.1 Simulate Weak Network

4.2 cd linux command test

4.3 Testing an interface

5. Test case design

5.1 Water cup test case design

5.2 Design of Test Cases for Wechat Sending to Moments

6. A mobile phone software has the function of exporting data from a TF card, please write down the idea of testing this function


In the last article, we learned how to design test cases based on requirements, and design black-box test cases through equivalence classes, boundary values, and decision tables. In this article, we will introduce how to design black-box test cases through the orthogonal table method, scenario design method, and error guessing method.

1. Orthogonal table

1.1 Concept

What is an orthogonal table?

Among the above concepts, the following points need to be noted:

  • Number of rows (Runs): the number of rows in the orthogonal table, that is, the number of trials, represented by N.
  • Factors (Factors): The number of columns in the orthogonal table, represented by C.
  • Factor: variable.
  • Level: The value of the variable.

Orthogonal experimental design
It is a design method for studying multi-factors and multi-levels. According to the orthogonality, selects some representative points from the combination of all levels of the experimental factors for experiment. The analysis of this part of the test results understands the situation of the comprehensive test and finds out the optimal level combination. Orthogonal test design is a high-efficiency, fast and economical test based on orthogonal tables.

Two properties of orthogonal tables:

  • Each number appears the same number of times in each column.
  • Each pair of ordinal numbers occurs the same number of times in any two columns.

1.2 Orthogonal table method design test case

1.2.1 Steps
  1. fully understand the needs
  2. determine the level
  3. draw orthogonal table
  4. Supplementary Orthogonal Table
  5. Convert an orthogonal table into a test case
1.2.2 Example

Take the user registration requirement as an example:

Name, email address, password, confirmation password, and verification code must all be entered to register.

Factors: name, email, password, confirm password, verification code

Level: fill/don’t fill

We use allpairs to design the orthogonal table:

allpairs design orthogonal table steps:

  1. Fill in the factors and levels into the excel form
  2. Copy excel content to txt file
  3. cdm into the allapirs installation path
  4. Generate an orthogonal table by command

Next, let’s implement it in detail:

First fill in the following form in excel (fill in both the factors and levels):

Press ctrl + A and ctrl + C to select all the content in the table and copy it to a text file:

Name it 20230715.txt and save it to the download path of allpairs.

Click windows + r to open the command line window, enter cmd:

Next, enter the allpairs path in the command line window:

You can see that the result file is generated after execution:

Open the file to see that the test case is generated, we only need to pay attention to the test case TEST CASES part:

~ Indicates that the current value can be filled or not filled.

Next, we need to supplement the generated test cases, such as adding test cases that do not fill in.

Finally, let’s take a look at how to design test cases through the mind map.

2. Scenario Design Method

2.1 Concepts

What is a scene? A scene is a specific environment.

Current software almost uses event triggering to control the process. The scene when the event is triggered forms a scene, and the different trigger sequences and processing results of the same event form an event flow. This method can vividly describe the situation when the event is triggered, which is beneficial to the test designer to design the test case, and makes the test case easier to understand and execute.

Main event flow: Scenes that users frequently operate (for example, ordering food through Meituan).

Secondary event stream: Based on the primary event stream (e.g. phone dies while ordering food).

2.2 Scenario design method to design test cases

2.2.1 Steps
  1. Determine the main event flow
  2. Identify secondary event streams
  3. Convert these events into test cases (one scenario corresponds to one test case)
2.2.2 Example

ATM withdrawal

The above process is the main event flow.

Next, based on the main event flow, you need to think about what are the secondary event flows.

3. Wrong Guess

3.1 Concepts

The error guessing method is a method of understanding the design of the tested software, past experience and personal intuition, inferring possible defects in the software, and then designing test cases in a targeted manner.

This method emphasizes the understanding of the requirements of the tested software and the details of the design and implementation, as well as personal experience and intuition.

wrong guessing and current popular

exploratory testing method

The basic idea is the same, this kind of method has a high input-output ratio in the agile development mode, and is widely used in testing.

The disadvantage of this method is that it is difficult to systematize and relies too much on individual abilities.

3.2 Example

Take registration as an example

1
, Processing of special characters and spaces in verification
?

2
, The case in the password verification?

3
, Special characters in names?

4
、Whether the password is sent in plain text

4. Case

4.1 Simulation weak network

Many tools can be used to simulate weak networks. Here we use Fiddler to simulate weak networks.

First, turn on the weak network settings in Fillder:

Next, click on the user-related rule:

Press and hold ctrl + F to search, search for BeforeRequest :

Scroll down from here, and find the modification as shown in the figure below:

if (m_SimulateModem) {
            // Delay sends by 300ms per KB uploaded.
            oSession["request-trickle-delay"] = "300";
            // Delay receives by 150ms per KB downloaded.
            oSession["response-trickle-delay"] = "150";
        }

Therefore, we modify the numbers to simulate a weak network.

4.2 cd linux command test

cd a folder in the current path

cd file (not a directory error)

cd previous path

cd path

zip is a command, as well as a visual PC terminal. When testing, you can design test cases from aspects such as interface, function, and performance.

4.3 Testing an interface

Interface request method: get, post…

The request can be successful by using get, but not successful by using post.

Test it in postman:

Do the same to change GET to POST:

After modifying the GET request to a POST request, it is found that the content cannot be returned normally, and the prompt information indicates that the POST request method is not supported.

Likewise, parameters can also be tested.

Fill in all the parameters, do not fill in all the parameters, and fill in part of the parameters.

Parameter type: the parameter type that conforms to the interface, and the parameter type that does not conform to the interface.

5. Test case design

Universal formula for test cases: interface, performance, usability, security, compatibility, functionality.

5.1 Water cup test case design

Interface Entity: From the outside, whether Beautiful
Performance

Cup service life

drop resistant water cup

High temperature and low temperature durable water cup

Ease of Use

Is the cup comfortable to hold?

The water cup is easy to carry

Whether the water cup can be folded

Security

Considering the material of the water cup, whether the material of the water cup is safe

When the water glass is filled with some chemicals. Will produce toxic substances

Compatible Is it possible to hold other items in addition to water
Function

what is the cup used for

with scale

5.2 Design of Test Cases for Sending WeChat to Moments

It should be noted that when you get a test topic, don’t directly mention the test points, but first classify the test cases (interface, performance, usability, security, compatibility, function).

6. A certain mobile phone software has the function of exporting data from TF card, please write down the idea of testing this function

Consider direction

Checkpoint Description of test ideas

Forward

Export data correctness Export data and verify Data correctness
Reverse

Validity of exported data

Is the export function correct when there is no data

Boundary capacity

TF
Insufficient card space

Can only hold part of the data

Boundary capacity

TF
Card capacity is full

fault tolerance

TF
card write protection

fault tolerance

TF
card not recognized

fault tolerance

human interruption

Unplug when exporting
TF
Card

fault tolerance

Power outage, shutdown, etc. while exporting

After restarting, check whether it can be exported correctly

performance

Export multiple times in a row

Script implementation, massive export, check whether the data is correct

performance

Check export speed

compatibility

Different brands and capacities

compatibility

different partition formats
FAT,FAT32,
NTFS

Do not use the mobile phone
T
Card Formatting Function