Software Testing: Test Case Design Techniques

Posted By : Harshita Tiwari | 26-Oct-2020

testing

Loading...

After reading this blog post, you will be able to:

  1. Understand the functionality of the website or software.
  2. Apply Test case design techniques to write test cases such as Equivalence class partitioning, Boundary value analysis, Error Guessing, Decision Table & State Transition Techniques.

Equivalence class partitioning: By using this technique we can get the best test coverage and save lots of testing time.

  • Equivalence class partitions, inputs to Systems, or software are partitioned into a group that anticipates showing similar behavior, so they are likely to be moved in the same way. Now the next step is to select one input from each group for designing the test cases for better results. Each and every condition of a particular partitioning works the same as others.
  • If a condition in a partition is valid so that the other conditions are also valid and If a condition in a partition is invalid so that the other conditions are also invalid.

Example: let’s assume that we have a field in the login page that has an Age field and that accepts 20 to 60 Age values.

Equivalence Class Partitioning

Invalid

Valid

Invalid

<=19

( 20 - 60 )

>=61

Now we have 1 valid and 2-Invalid conditions. Pick any data from valid class 20 to 60 to perform positive test testing, form invalid class any value from less than 19, and greater than 61.

Boundary Value Analysis:

  • These are used to pick the test cases in a structured manner.
  • It is based on testing the boundary values of valid and invalid partitionings.
  • The behavior of the edge of each equivalence partition is like enough to be incorrect than the behavior within the partition, so the boundary is an area where the test is probably to capitulate defects.
  • Every partition has its maximum and minimum values are the boundary values of a partition.
  • For a valid partition, the boundary value is a valid boundary value. And for an invalid partition, the boundary value is an invalid boundary value.
  • When Designing test cases this will test for each boundary value to be chosen for each boundary we test -1 or +1 in the least significant digit of either side of the boundary.

Example: let’s assume that we have a field that accepts Age 18 to 56 age value so the Boundary values.

Boundary Value Analysis

Invalid

Valid

Invalid

17(min-1)

( 18 ,19, 55, 56 )

(min,+min, -max,max)

57(max+1)

So we have Valid Test cases:

Enter the value 18 which we get from Min value

Enter the value 19 which we get from Min+1 value

Enter the value 55 which we get from Max-1 value

Enter the value 56 which we get from Max value

And the Invalid Test Cases are:

Enter the value 17 which we get from Min-1 value

Enter the value 57 which we get from Max+1 value

Error Guessing:

  • In Error Guessing techniques the test cases are basically used to find the bugs in a program that are established and based on the experience. In this Technique, prior testing knowledge is required so that you can guess the error as per your experience.
  • This scope of test cases usually relies on the software tester involved who uses their past experience and determines what situation commonly causes software failure.
  • In Error guessing, the technique tester doesn’t follow any specific rules they guess the error from their past experience.

Example:

  1. Submitting a form with blank data.
  2. By entering invalid values in the text field. eg: enter numeric values in the text field.

Decision Table Technique:

  • It is also known as Cause-Effect Table and It’s the Black Box test design technique.
  • This test technique is basically suitable for functionalities that have a logical relationship between their inputs.
  • And we need to give out the combinations of inputs in this technique to identify the test cases from the available decision table, here we need to consider conditions and actions so that we take as the input and output; conditions and Actions.

Example: Login page validation. When both the ‘User ID’ and ‘Password’ are correctly entered only then allow users to log in.

On the Login page we have Conditions are:

  1. Enter valid user ID.
  2. Enter a valid password.

Actions performed are:

  1. Displaying home page.
  2. Show a message ”Invalid user credentials”.

Using the conditions and actions we have test cases that are below mentioned:

ID

Conditions/ Actions

Test Case 1

Test Case 2

Test Case 3

Test Case 4

Condition 1

Valid User ID

T

T

F

F

Condition 2

Valid Password

T

F

T

F

Action 1

Home Page

Execute

-

-

X

Action 2

Show a message “Invalid User Credentials”

-

Execute

Execute

Execute

From case-2 and case-3 we could identify that if one of the conditions failed then the system will display an error message as “Invalid user credentials”. So we eliminating one of the test cases from case 2 or 3 and concluding the table as:

ID

Conditions/ Actions

Test Case 1

Test Case 2

Test Case 3

Condition 1

Valid User ID

T

T

F

Condition 2

Valid Password

T

F

F

Action 1

Home Page

Execute

-

-

Action 2

Show a message “Invalid User Credentials”

-

Execute

Execute

State Transition Technique:

  • We pick test cases from an application & software in state transition testing, where we need to test different system transitions for better results.
  • So for that, we can apply this when an application gives a different output for the same input, and that is basically depending on what has happened in the previous state of the testing.

Example: We have a real-life application Traffic Lights, Vending Machine.

Take an example of the login page of an application that locks the user name after three wrong attempts of the password.

  • As per this example, we have three pages: Login Page, Home Page, and Error Page. If the attempt is passed then it will go to the Homepage else it will ask to do another attempt until the third attempt.
  • If the first attempt is passed go to the home page, If it fails we need to do the second attempt. If the second attempt passes then go to the Home page, If it fails then go to the third attempt.
  • If the third attempt passes then go to the Home page else go to the Error page.

Determine the states and the Login page.

STATE

LOGIN

VALID

INVALID

S1

First Attempt

S4

S2

S2

Second Attempt

S4

S3

S3

Third Attempt

S4

S5

S4

Home Page

-

-

S5

Error Message

-

-

We have valid test results if the States S1, S2, S3 pass so we go to the S4 states and the Invalid test result for S1 is S2, for S2 is S3 and for S4 is S5 if in all attempts the user gets the Error message.

So that the above-mentioned are the test case designing techniques which are basically used by the Quality Assurance professionals while performing testing so that they get the better result and full coverage to test any kind of software or system.

We are an ERP development company that provides end-to-end ERP software development solutions to address cross-industry enterprise challenges. Our development team is skilled at using open-source tools and technologies to develop performance-driven software applications at cost-effective rates. For more information, contact us at [email protected].