Software testing techniques

Tram Ho

1. What is software testing technique?

Software testing techniques help you design better test cases. Because comprehensive testing is not possible, manual testing techniques will help reduce the number of test cases executed while increasing the scope of the test. They help identify difficult to identify test conditions.

The following are common types of testing techniques

  • Equivalent Partition (Equivalence Class Partitioning)
  • Boundary Value Analysis (BVA)
  • Decision Table based testing
  • Guess the Error (Error Guessing)

2. Partitioning equivalent

Equivalent partitioning allows you to divide a set of test conditions into a partition that should be considered the same.

This software testing method divides the program’s input domain into data layers from which test cases should be designed.

With the input values ​​divided into equivalent regions:

  • Valid equivalence region: set of test values ​​that meet the conditions of the system
  • Invalid equivalence region: A set of test values ​​that describe the other state of the system: false, missing, incorrect, …

Purpose: Significantly reduce the number of test cases that need to be designed because for each equivalent class we only need to test on representative elements.

Test-case design by equivalent classification is carried out in 2 steps:

  • Identify equivalent classes
  • Identify test cases

Rule:

  • 1 layer of larger values
  • 1 layer of smaller values
  • n class valid values

Example : Designing a testcase for a text box only allows integers with a length of characters belonging to [1-10] or [20-30]

With the above requirement we have the areas:

  • <1: invalid region
  • [1-10]: valid region
  • greater than 10 and less than 20: invalid region
  • [20-30]: valid region
  • Enter non-integer characters: invalid region

So there are cases:

  • Valid case:
    • Enter 5 characters
    • Enter 25 numeric characters
  • Invalid case:
    • Do not enter the field
    • Enter 15 characters
    • Enter the decimal number
    • Enter text characters: Vietnamese, English, Full-size, Half-size
    • Enter special characters, space, characters Enter
    • Enter SQL injection, HTML, XSS statements

3. Analysis of marginal value

Analysis of boundary values ​​is based on testing at the boundaries between partitions. We will focus on boundary values ​​rather than testing the entire data. Instead of selecting multiple values ​​in the equivalence class to represent, analyzing the boundary value requires selecting one or several values ​​that are the edges of the equivalence class as test conditions.

We often see that a large number of errors occur at the boundaries of defined input values ​​instead of middle values, also known as boundary values. From there make a selection of test cases that perform input values ​​of boundary values.

This test case design technique complements the equivalent partition. This software testing technique is based on the principle: If a system works well with boundary values, it will work well for all values ​​between the two boundary values.

The boundary value analysis will select the values:

  • Value is right below the smallest value
  • Smallest value
  • Value is right above the smallest value
  • Value is right below the maximum value
  • Greatest value
  • The value is immediately above the maximum value

For example : For the above example we have the following cases:

  • Do not enter any characters (Value is immediately below the smallest value in region 1)
  • Enter 1 character (smallest value in field 1)
  • Enter 2 characters (the value is immediately above the smallest value in area 1)
  • Enter 9 characters (the value is immediately below the largest value in region 1)
  • Enter 10 characters (the largest value in zone 1)
  • Enter 11 characters (the value is immediately above the largest value in region 1)
  • Enter 19 characters (the value is immediately below the smallest value in area 2)
  • Enter 20 characters (minimum value in zone 2)
  • Enter 21 characters (the value is immediately above the smallest value in area 2)
  • Enter 29 characters (the value is immediately below the largest value in zone 2)
  • Enter 30 characters (the largest value in zone 2)
  • Enter 31 characters (the value is immediately above the largest value in zone 2)

=> Combining partitioning technique equivalent to boundary value analysis, we have the following cases:

  • Do not enter any characters
  • Enter 1 character
  • Enter 5 characters
  • Enter 10 characters
  • Enter 11 characters
  • Enter 91 characters
  • Enter 20 characters
  • Enter 21 characters
  • Enter 25 characters
  • Enter 30 characters
  • Enter 31 characters
  • Enter the decimal number
  • Enter text characters: Vietnamese, English, Full-size, Half-size
  • Enter special characters, space, characters Enter
  • Enter SQL injection, HTML, XSS statements

4. Decision table

The decision table is also called the Cause-Effect table.

This software testing technique is used for functions that require a combination of event inputs.

For example , the Submit button must be enabled if the user has entered all the required fields.

The first is to determine whether the function’s output is dependent on the combination of inputs. If there are large sets of input combinations, then break it up into smaller sets that are useful for decision table management.

For all functions, it is necessary to create a table and list all the corresponding input and output combinations. This helps identify conditions that are missed by the tester.

Steps to create a decision table:

  • Enter the input in rows
  • Enter all the rules in the column
  • Fill the board with the combination of input
  • In the last row, output notes compared to the input combination.

For example , the Submit button is only enabled when all inputs are entered by the end user.

5. Guess the error

Error prediction is a software testing technique based on guessing that bugs can dominate the code. This is an experience-based technique in which test analysts use their experience to guess the problematic or faulty part of a test application.

The technique identifies a list of possible errors or situations that are likely to occur. Then, testers write test cases to look for those errors. To design test cases based on this software testing technique, the analyst can use past experience to determine the conditions.

How to guess the error:

  • Tester should use previous experience to test similar applications
  • Knowledge of the system under test
  • Knowledge of typical execution errors
  • Remember the complicated functions before
  • Evaluate data history and test results

Conclude

Above, I have introduced some techniques commonly used to design test cases, while saving time and increasing the coverage of test cases). Depending on the spec of each system to apply the appropriate techniques

References

https://www.guru99.com/software-testing-techniques.html

Share the news now

Source : Viblo