Preface:

Hello everyone, I’m Yifei. Recently, many friends left me messages: How can I test software quickly? What are the methods? Today, I summarize this article specially for you, hoping to bring help to you.

Body:

Some quick test methods, here to supplement and adjust, and synchronous update to our test knowledge sharing library, can be flexibly added, deleted, changed and checked.

1. User interface

If software is sold in the app store, the interface is likely to be an important factor in whether users install or buy it

A. Wander through the user interface to see if there are any annoying interface designs.

B. Refer to popular interface designs to find improvements to the product under test.”

2. The boundary

Software can make errors in handling numerical boundaries

A. Discover the scope and boundaries of the business, and test the values on and near the boundaries

B. Test for out-of-range values

C. Let the numerical calculation produce values out of range

. Make one module output values that other modules cannot accept, for example, interface fields can only display 10-character strings, and the tester makes the background generate 11-character strings. The field in the background DB is an 8-bit integer, and the tester asked the foreground page to pass integers greater than 255.”

3. The overflow

Integer and floating-point operations can overflow, leading to calculation errors and security vulnerabilities

Pay attention to the software’s numerical calculations, and pass in a maximum or minimum value to trigger a potential overflow if a calculation is considered at risk of overflow

4. Calculation and operation

There are some typical errors in data conversion and numerical calculation

A. Input wrong data to test data conversion, such as the software expects an integer, test input floating point, invalid string, empty string

B. division by 0

C. Dividing the minimum value very close to 0 will produce a large calculation result, which may lead to the value out of bounds or overflow

D. Forcing a high-precision value to a low-precision value may cause precision loss or even calculation errors

E. Floating-point calculations are prone to errors, and small errors can add up to big ones, so focus on numerical calculations involving more than one variable or step 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 can lead to software failures

A variable usually has five states. Tests check that the program’s assumptions about the state of a variable are always correct:

A. Not initialized

B. The system has been initialized

C. the default values

D. The value has been assigned to the current calculation

E. With the results of other calculations

F. Modified value

Software may not detect that something it depends on has changed, leading to errors

Set a value for a variable so that some function depends on it, then modify the value of the variable and check that the function is correct.

Eg. Browse pictures with the picture application, switch to the OS interface to delete the picture being displayed, and return to the picture application to see how the deleted picture is displayed

6. Control flow

Unexpected jumps in control flow can expose hidden problems

Testing tries to disrupt the control flow of the software, such as triggering exceptions, entering abnormal data, causing the environment to fail, etc

Sequence of 7.

Some software bugs are exposed over a long sequence of operations

Consider doing the following repeatedly:

A. Operations that generate error messages

B. Operations that interrupt tasks

C. Perform recursive calculations

In addition, tests can write test programs that invoke existing automated test cases in random order to perform long sequences of tests.”

News 8.

Communication between software and the outside world may be interrupted

If the software has any kind of interaction with network services, DB, or other software, the test breaks the communication between them.

Can a test program be written to listen for and tamper with information, or to force dependent software to return error messages to test how the software handles broken messages

9. Timing and race conditions

Software may make incorrect assumptions about the timing of operations

When testing an asynchronous call, the test tells the software to start calculations A and B first, and let B finish the calculation first. Some software fails to handle postcommitted cases that return first in calculation.

Tests can start multiple operations simultaneously to access shared data or functionality to check whether concurrent computations cause data corruption.

10. Error handling

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

The test tries to trigger an error message in the software, and then repeatedly performs the action that caused the error message to check if the error-handling code is causing a resource leak problem.

Hard tests the software to see if the error-handling code restores the software to the correct state.

11. Handle the failure

Software recovery failures may contain errors that make losses worse

Tests check the correctness of failure handling code. For example, after the document crashes and restarts, whether the latest editing results of users are displayed to avoid or reduce the loss of users.

12. File system A file system exception affects software running

A. Use a debugging tool to make the OS file read/write API return an error, which can simulate disk damage and other exceptions

B. Delete the file that is being used

C. Delete the file to be used

D. Lock the files to be used

E. Steal file handles held by the software

F. Modify a file that requires a higher permission

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

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

I. Change the file name suffix to uppercase or invalid

J. Change the file name to a word that has special meaning for the OS

K. Read and write large files

L. Write the file to a read-only disk

M. Write files to the disk whose capacity is about to be used up

N. Write the file to the network disk. During the writing process, disconnect the network

O. Write the file to the mobile disk. During the writing process, remove the mobile disk

Try various inputs to trigger all error messages in the software

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

A. Input filtering: Filter out incorrect data

B. Input check: Check input and report errors

C. Exception handling: When a fault occurs with incorrect input, the exception handling code catches the exception and fixes it.

Writing the above code correctly requires careful thought and repeated testing, and the slightest mistake can introduce bugs.”

Limit value test, boundary value test, illegal value test, pressure test and other methods are used to test user input

Force software to use default values

Different modules are written by different programmers who may expect different defaults, and this inconsistency can lead to errors

A. Accept all defaults and submit

B. Use a null value

C. Change the default value to another value and then back again

D. Change the default value to another value, and then to null”

Explore permitted character sets and data types

FAQ:

A. Character set: Some software only supports the character set of a particular encoding. Entering characters of other encoding 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 forbids the creation of files with specific names. Some software cannot display Chinese characters correctly on western OS

Tests understand the software, programming language, implementation technology, OS expectations and limitations on character sets and data, and then attack with strings or data that have special meaning to them

Make the input buffer overflow

The software does not consider the case that the input value is too long or too large, resulting in numerical calculation overflow or buffer overflow

Common test ideas:

A. Enter a long string similar to Chinese digits 1234567 Chinese… Helps locate the length that caused the error

B. Input maxima (for addition and multiplication), negative maxima (for subtraction), values close to zero (for division), etc.”

5. Test a set of values of related variables

When multiple programmers work together on a piece of code, the numbers produced by their code may not work together properly.

In addition, programmers check multiple variables with complex nested IF statements, which are not easy to write and more prone to maintenance errors.

Testers investigate software requirements and implementations to identify truly related variables, often belonging to the same data structure or participating in the same calculation.

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

You can also use composite testing tools to generate cases

Six, repeat the input many times

Software may not understand its limitations in space and time, and it will fail when repeated operations exhaust its resources

Tests repeatedly perform some operations that consume a lot of resources, or repeatedly perform some operations that consume a lot of data. For example, when testing an online mall, the test keeps adding items to the shopping cart, creating a “super order” of many items. This order may cause the submission to fail or make future order processing difficult.

Supplement: