It’s not too late to learn a must-learn software quick test method!

Foreword:

Hello everyone, I am Yifei. Recently, many friends have left messages to me: How can I quickly test software? What are the methods? Today I specifically summarized this article for everyone, hoping to help everyone.

Body:
Some quick test methods are supplemented and adjusted here, and updated to our test knowledge sharing library simultaneously, and can be flexibly added, deleted, modified and checked when used.

1. User interface

If the software is sold in an application store, the interface is likely to become an important factor in whether the user installs or purchases it

a. Navigate the user interface and find out if there is any boring interface design.

b. You can refer to the popular interface design to find out where the tested product can be improved."

2. Border

The software may make mistakes when processing numerical boundaries

a. Discover the scope and boundary of the business, test the value on the boundary and the value near the boundary

b. Test the value out of range

c. Let the numerical calculation output the value out of range

. Make one module output values ​​that other modules cannot accept. For example, the interface field can only display a 10-character string, and the tester asks the background to generate an 11-character string. The field of the back-end DB is an 8-bit integer, and the tester asked the front-end web page to pass an integer greater than 255."

3. Overflow

Integer and floating-point arithmetic may overflow, leading to calculation errors and security vulnerabilities

Pay attention to the numerical calculation of the software. If you feel that a calculation is at risk of overflow, pass in a maximum or minimum value to trigger a potential overflow

4. Calculation and operation

Some typical errors in data conversion and numerical calculation

a. Input wrong data to test the data conversion, such as the software expects to input integers, test input floating-point numbers, invalid character strings, and empty character strings

b. Divide by 0

c. Dividing a very small value very close to 0 will produce a large calculation result, which may cause the value to exceed the range or overflow

d. Forcibly assigning high-precision values ​​to low-precision values ​​may result in loss of precision and even calculation errors

e. Floating point calculations are likely to produce errors. Some small errors will accumulate serious deviations. Therefore, the test should pay attention to numerical calculations involving multiple variables or steps, and carefully check the accuracy of the results."

5. Initial state

When a program uses a variable, it may make incorrect assumptions about the state of the variable, which will cause software failure

Variables usually have 5 states. The test needs to check whether the program's assumptions about the variable state are always correct:

a. Not initialized

b. Initialized

c. Default value

d. Has been assigned the value needed for the current calculation

e. With the results of other calculations

f. The modified value

The software may not be able to detect changes in the things it depends on, which can cause errors

Set a value for a variable, make some functions depend on the variable, then modify the value of the variable, and check whether the corresponding function is correct.

eg. Use the picture application to browse pictures, switch to the OS interface to delete the picture being displayed, return to the picture application, and see how the deleted picture is displayed

6. Control flow

Unexpected jumps in control flow may expose hidden problems

The test must find ways to disrupt the control flow of the software, such as triggering an exception, inputting abnormal data, causing environmental failure, etc.

7. Sequence

Some software errors will be exposed in a long sequence of operations

Consider repeatedly doing the following:

a. Operations that generate error messages

b. Operations that cause the task to be interrupted

c. will perform recursive calculation operations

In addition, the test can write test programs, call existing automated test cases in a random order, and implement long-sequence tests."

8. Message

The communication between the software and the outside world may be interrupted

If the software interacts with network services, DB, and other software in any form, the test must disrupt the communication between them.

You can write test programs to monitor and tamper with information, or force dependent software to return error messages to test how the software handles broken messages

9. Timing and race conditions

The software may make incorrect assumptions about the timing of operations

When testing asynchronous calls, the test allows the software to start two calculations A and B successively, and let B complete the calculation first. Some software can’t handle the case that is submitted after the calculation is returned first, and it will malfunction.

The test can start multiple operations at the same time to access shared data or functions to check whether concurrent computing causes data corruption. "

10. Error handling

The error handling code of the software needs to deal with unexpected situations, it is difficult to write, so it is easy to make mistakes

The test attempts to trigger the error message of the software, and then repeatedly performs the operation that caused the error message to check whether the error handling code has caused a resource leakage problem.

Vigorously test the software to check whether the error handling code restores the software to the correct state. "

11. Failure handling

Software failure recovery may include errors, making the loss worse

The test should check the correctness of the failure handling code. For example, after the document crashes and restarts, whether to display the user's latest editing results, to avoid or reduce the user's loss.

12. File system File system abnormalities will affect the operation of the software

a. Use debugging tools to make the OS file read and write API return errors, which can simulate abnormal conditions such as disk damage

b. Delete the file being used

c. Delete the file to be used

d. Lock the file to be used

e. Steal the file handle held by the software

f. Modify a file that requires higher permissions to modify

g. Make the length of the file name and file path exceed the maximum path length supported by the OS

h. Make the file name contain characters prohibited by the OS

i. Modify the file name suffix to uppercase or other invalid suffixes

j. Modify the file name to words that have special meaning to the OS

k. Read and write files of huge size

l. Write the file to a read-only disk

m. Write files to a disk whose capacity is about to run out

n. Write the file to the network disk, and disconnect the network during the writing process

o. Write the file to the mobile hard disk, during the writing process, unplug the mobile hard disk

2. Try various inputs to trigger all error messages of the software

1. There are three common ways for software to handle incorrect input:

a. Input filter: filter out wrong data

b. Input check: check input and report errors

c. Exception handling: When a fault occurs in the wrong input, the exception handling code will catch the exception and remedy it.

Correctly writing the above code requires careful thought and repeated testing, and a little carelessness may introduce defects."

Use limit value test, boundary value test, illegal value test, stress test and other methods to test user input

Second, force the software to use default values

Different modules are written by different programmers and they may expect different default values. This inconsistency can lead to errors

a. Accept all default values ​​and submit

b. Use null

c. Change the default value to another value, and then change it back

d. Change the default value to another value, and then change to a null value"

Three, explore allowed character sets and data types

common problem:

a. Character set: Some software only supports character sets with specific encodings, inputting characters with other encodings will cause errors

b. Programming language: Some software will execute user input as a program, which causes many problems, such as SQL injection

c.OS: The OS will prohibit the creation of files with specific names. Some software cannot display Chinese characters correctly on Western OS

Test to understand the software, programming language, implementation technology, OS's expectations and restrictions on character sets and data, and then use character strings or data with special meaning for them to ***

Four, make the input buffer overflow

The software does not take into account the situation that the input value is too long or too large, which leads to numerical calculation overflow or buffer overflow.
Common test ideas:

a. Enter a very long string, the string should be similar to "Chinese Chinese number 1234567 Chinese..." to help locate the length that caused the error

b. Enter maximum values ​​(for addition and multiplication calculations), negative maximum values ​​(for subtraction calculations), values ​​very close to 0 (for division calculations), etc."

==5. Test the value group of a group of related variables

When multiple programmers jointly develop a piece of code, the values ​​generated by their code may not work properly.

In addition, programmers also use complex nested if statements to check multiple variables. These codes are not easy to write and are more prone to errors during maintenance.

Testers investigate software requirements and implementations to identify the truly relevant variables. They usually belong to the same data structure or participate in the same calculation.

Then, design Cases based on how the software uses them.

You can also use a combination test tool to generate a case

Six, repeat input many times

The software may not understand its limitations in space and time. When repeated operations exhaust its resources, it will fail

The test repeatedly executes some operations that consume more resources, or repeatedly executes some operations with a large amount of data. For example, when testing an online shopping mall, the test continues to add items to the shopping cart, creating a "super order" containing many items. This order may result in a failure to submit or make future order processing difficulties.

supplement:
It’s not too late to learn a must-learn software quick test method!

Guess you like

Origin blog.51cto.com/15086761/2620510