TEST CASE DESIGN TECHNIQUES

  

TEST CASE DESIGN 

Test case design refers to how you set-up your test cases. It is important that your tests are designed well, or you could fail to identify bugs and defects in your software during testing.

There are many different test case design techniques used to test the functionality and various features of your software. Designing good test cases ensure that every aspect of your software gets tested so that you can find and fix any issues.

A basic example of test case design:

Title: Login to the website or app
Description: User should be able to successfully log in to their account on the website/app
Preconditions: User must already be registered and use their correct login details
Assumptions: They are using a supported device or browser to log in
Test Steps:

  1. Open website or app
  2. Enter the username and password in the appropriate fields
  3. Click “login”

Expected Result: The user should log in successfully.

Introduction to Software Test Design Techniques

What is a Technique?

An efficient way of doing or achieving something.

What is Test Design Technique?

A test design technique is used to select a good set of tests from all possible tests for a given system.

Why do we need to use Test Design Techniques?

Exhaustive Testing is not possible, so we need to use Test Design Techniques in order to reduce the size of the input.

Exhaustive Testing is a Test approach in which the test suite comprises all combinations of input values and preconditions.

Exhaustive Testing is not recommendable due to Time and Budget considerations.

Categories of Test Design Techniques?

There are two main categories of Test Design Techniques, They are:

a. Static Techniques
b. Dynamic Techniques

STATIC TECHNIQUES 

Testing of the software documents manually or with a set of tools but without executing the Software.

Two types of static testing techniques

i) Reviews (Manual Examination)

ii) Static Analysis (Automated Analysis)


i) Reviews

In static testing, the review is a technique or a process implemented to find the possible bugs in the application. We can easily identify and eliminate faults and defects in the various supporting documents such as SRS [Software Requirements Specifications] in the review process.

In other words, we can say that a review in Static Testing is that where all the team members will understand about the project's progress.

In static testing, reviews can be divided into four different parts, which are as follows:

a) Informal Review
b) Walkthrough
c) Technical Review
d) Inspection

  • Informal reviews
    In informal review, the document designer place the contents in front of viewers, and everyone gives their view; therefore, bugs are acknowledged in the early stage.
  • Walkthrough
    Generally, the walkthrough review is used to performed by a skilled person or expert to verify the bugs. Therefore, there might not be problem in the development or testing phase.
  • Peer review
    In Peer review, we can check one another's documents to find and resolve the bugs, which is generally done in a team.
  • Inspection
    In review, the inspection is essentially verifying the document by the higher authority, for example, the verification of SRS [software requirement specifications] document.

ii) Static Analysis

Static analysis tools are typically used by developers, Compilers offer some support for Static analysis,

Another Static Testing technique is static analysis, which is used to contain the assessment of the code quality, which is established by developers.

We can use the different tools to perform the code's analysis and evaluation of the same.

In other words, we can say that developers' developed code is analyzed with some tools for structural bugs, which might cause the defects.

The static analysis will also help us to identify the below errors:

  • Dead code
  • Unused variables
  • Endless loops
  • Incorrect syntax
  • Variable with undefined value

In static testing, Static Analysis can be further classified into three parts, which are as discuss below:

Data Flow: In static analysis, the data flow is connected to the stream processing.

Control Flow: Generally, the control flow is used to specify how the commands or instructions are implemented.

Cyclomatic Complexity: It is the measurement of the program's complexity, which is mostly linked to the number of independent paths in the control flow graph of the program.

Tools used for Static Testing

In static testing, we have several tools in the market, but here we are discussing the most commonly used tools, which are as follow:

  • CheckStyle
  • SourceMeter
  • Soot

CheckStyle

It is a development tool that is used to help the developers write Java code, which follows a coding standard. The CheckStyle tool automates the process of checking Java code.

It is a highly configured tool, which is made to support almost any coding standard. The Google Java Style, Sun code conventions are those configuration files, which is supported by CheckStyle.

Feature of CheckStyle

Following are the most common features of CheckStyle:

  • It can check various characteristics of our source code.
  • The CheckStyle code has the capability to verify the code layout and formatting issues.
  • It can also help to identify the method design problems, class design problems.

SourceMeter

It is an advanced tool for the specific static source code analysis of various programming languages such as C/C++C#Java, Python, and RPG projects.

With the SourceMeter tool's help, we can easily identify the vulnerable spots of a system under development from the source code.

The free version with partial functionality of SourceMeter can be accessible for all programming languages.

In SourceMeter, we can use the output of the analysis, the quality of the analyzed source code to enhance and developed both the short and long term in a directed way.

Feature of SourceMeter

The most commonly used features of the SourceMeter tool are as follows:

  • It provides the most precise coding error detection.
  • The SourceMeter tool will provide a deep static code analysis.
  • It improved the user interface with the help of third-party integration.
  • It will provide platform-independent command-line tools.

Soot

It is a Java optimization framework, which means that it is a framework for analyzing and transforming Java and Android applications where we can test the following aspects:

  • Named module and modular jar files.
  • Automatic modules, which means the modules are repeatedly created from jars in the module-path.
  • Exploded modules
  • Resolving modules in Soot's
And a Soot can also produce possibly transformed code in the various output formats such as Android bytecode, Java bytecode Jasmin, and Jimple.

Advantages of Static Testing

The advantages of static testing are as follows:

  • Improved Product quality
    Static testing will enhance the product quality because it identifies the flaws or bugs in the initial stage of software development.
  • Improved the efficiency of Dynamic testing
    The usage of Static testing will improve Dynamic Testing efficiency because the code gets cleaner and better after executing Static Testing.
    As we understood above, static Testing needs some efforts and time to generate and keep good quality test cases.
  • Reduced SDLC cost
    The Static Testing reduced the SDLC cost because it identifies the bugs in the earlier stages of the software development life cycle. So, it needs less hard work and time to change the product and fix them.
  • Immediate evaluation & feedback
    The static testing provides us immediate evaluation and feedback of the software during each phase while developing the software product.
  • Exact location of bug is traced
    When we perform the static testing, we can easily identify the bugs' exact location compared to the dynamic Testing.

DYNAMIC TECHNIQUES 

What are the types of test case design techniques?

The main purpose of test case design techniques is to test the functionalities and features of the software with the help of effective test cases. The test case design techniques are broadly classified into three major categories.

  1. Specification-Based techniques
  2. Structure-Based techniques
  3. Gray box Testing 
  4. Experience-Based techniques

1. Specification-Based or Black-Box techniques

This technique leverages the external description of the software such as technical specifications, design, and client’s requirements to design test cases. The technique enables testers to develop test cases that provide full test coverage. The Specification-based or black box test case design techniques are divided further into 5 categories. These categories are as follows:

Boundary Value Analysis (BVA)

This technique is applied to explore errors at the boundary of the input domain. BVA catches any input errors that might interrupt with the proper functioning of the program.

Equivalence Partitioning (EP)

In Equivalence Partitioning, the test input data is partitioned into a number of classes having an equivalent number of data. The test cases are then designed for each class or partition.  This helps to reduce the number of test cases.

Decision Table Testing

In this technique, test cases are designed on the basis of the decision tables that are formulated using different combinations of inputs and their corresponding outputs based on various conditions and scenarios adhering to different business rules.

State Transition Diagrams

In this technique, the software under test is perceived as a system having a finite number of states of different types. The transition from one state to another is guided by a set of rules. The rules define the response to different inputs. This technique can be implemented on the systems which have certain workflows within them.

Use Case Testing

A use case is a description of a particular use of the software by a user. In this technique, the test cases are designed to execute different business scenarios and end-user functionalities.  Use case testing helps to identify test cases that cover the entire system.

2. Structure-Based or White-Box techniques

The structure-based or white-box technique design test cases based on the internal structure of the software.  This technique exhaustively tests the developed code. Developers who have complete information of the software code, its internal structure, and design help to design the test cases. This technique is further divided into five categories.

Statement Testing & Coverage

This technique involves execution of all the executable statements in the source code at least once.  The percentage of the executable statements is calculated as per the given requirement. This is the least preferred metric for checking test coverage.

Decision Testing Coverage

This technique is also known as branch coverage is a testing method in which each one of the possible branches from each decision point is executed at least once to ensure all reachable code is executed.  This helps to validate all the branches in the code. This helps to ensure that no branch leads to unexpected behavior of the application.

Condition Testing

Condition testing also is known as Predicate coverage testing, each Boolean expression is predicted as TRUE or FALSE.  All the testing outcomes are at least tested once.  This type of testing involves 100% coverage of the code.  The test cases are designed as such that the condition outcomes are easily executed.

Multiple Condition Testing

The purpose of Multiple condition testing is to test the different combination of conditions to get 100% coverage.  To ensure complete coverage, two or more test scripts are required which requires more efforts.

All Path Testing

In this technique, the source code of a program is leveraged to find every executable path. This helps to determine all the faults within a particular code.

3. Gray Box Testing

Gray box testing is a combination of white box and Black box testing. It can be performed by a person who knew both coding and testing. And if the single person performs white box, as well as black-box testing for the application, is known as Gray box testing.

4. Experience-Based techniques

These techniques are highly dependent on tester’s experience to understand the most important areas of the software.  The outcomes of these techniques are based on the skills, knowledge, and expertise of the people involved. The types of experience-based techniques are as follows:

Error Guessing

In this technique, the testers anticipate errors based on their experience, availability of data and their knowledge of product failure.  Error guessing is dependent on the skills, intuition, and experience of the testers.

Exploratory Testing

This technique is used to test the application without any formal documentation.  There is minimum time available for testing and maximum for test execution.  In exploratory testing, the test design and test execution are performed concurrently.

Test Case Software for managing Test Cases

test case software can help in writing better test cases and managing them. It also enables you to report bugs from any failed step. A tool provides robust reports generated through built-in filters which also gives you actionable insights. 

ReQtest is a test case software preferred by Test Managers in 20+ countries across the globe. 

Conclusion

The successful application of test case design techniques will render test cases that ensure the success of software testing.