INTRODUCTION :
An important phase in developing a software is its testing phase. Software testing is performed to not only determine the quality of a product, but to also enable developers to modify and upgrade the product in terms of end-user friendliness and usability.
In this article, we will address the fundamental principles of various types of test case design techniques.
- ERROR GUESSING :
Here, the Test Engineer needs to guess the error and derive more number of scenarios:
1. It depends upon analytical thinking of each and every Test engineer
2. Here, the Test Engineer will only enter invalid /negative inputs and guess the error.
Example :
First Name :-
Requirement : Text Field should accept 4-10 characters.
Inputs | Expected Result |
AA | Error message should be displayed. |
R12 | Error message should be displayed. |
Man@12&&&### | Error message should be displayed. |
@@@@@@@@@@@@ | Error message should be displayed. |
NOTE : Error Guessing is best used for >> After more formal techniques have been applied.
2.EQUIVALENCE PARTITIONING / EQUIVALENCE CLASS PARTITIONING :
In this Test Case technique, we have two categories :
1.Pressman Rule
2.Practice Method
1.Pressman Rule :
- Rule 1 :
If the input is ‘range of values’, then design the test case for one valid and two invalid inputs/values.
- Example : AMOUNT
Test Case :-
1.Valid :(2500) 2.Invalid :(5001)
3.Invalid :(99)
Requirement :-
1.It should accept 100-5000 amounts.
2.It should accept positive integers.
Rule 2 :If the input is a set of values, then design the test case for one valid and two invalid input /values.
Example : Flipkart >> Customer >> Requirement.
Product | P-ID |
Perfume | 34 |
Fossil watch | 41 |
Bat | 2000 |
Ball | 24 |
Search >> 33 >> Perfume.
Rule 3 :
If the input is ‘boolean condition’, then design the test cases for both true and false boolean values.
Pressman rule 3 >> boolean.
True/False
Drawbacks of Pressman Rule.
Customer >> Requirement >> Amount >>> 2000 >> Transfer.
Requirement :
It should accept between 100 to 5000.
Valid – 2000
Invalid – 99
Invalid – 5001
if amount >=100 && amount <=2000) >> there is deviation
{
—-
—-
input
}
else if (amount >=2001 && amount <=4000) >> not intersected peace of code.
{
—-
—-
input;
}
else
{
—-
—- (99,5001)
}
In order to overcome the drawbacks of pressman rule we go for practice methods.
If (amount >=100 && amount <=5000) >>> there is no deviation.
{
____
____
____
Input:
}
else
{
___
___
___
error
}
Note:
1)If there is a deviation in between the range of values then we have to go for a practice method.
2)If there is no deviation in between the range of values then we have to go for the pressman rule.
3)By looking into the requirements, the Test Engineer will get to know if there is a deviation in between the range of values or not.
Practice method :
Definition/what?
If the inputs is range of values then divide the range into equal number and test for all those values and at least test for two invalid values this is called practice method
Ex:
Customer>> requirement >> amount (2000—>transfer—>cancel)
It should accept between 100 to 5000.
100 -5000
99 >> invalid.
1000 2000 – Valid 3000 4000 |
5001 >>invalid
3. Boundary Value Analysis (BVA):-
If the input is a range of values from A to B, the design test cases for A, A+1,A-1 and B,B+1,B-1.
EX:
Amount >> Requirement — It should accept between 100(A) to 5000(B).
A > >100(Vald)
A+1 >>101(Vald)
A-1 >>99(Invalid)
B-5000 >>(Vald)
B+1 >>5001(Vald)
B-1 >>4999(Invalid)
4. Decision table technique :
In this technique, we will check for multiple conditions,combinations and rule criterias.
Formula = 2^no of conditions= Total no of rules or scenarios.
Example :
HDFC Bank Credit Card
Conditions :
1) Assume that you are a new customer. If you get a new credit card, you will get a 15% discount from your purchase.
2) Assume that you are an old customer. If you already have a credit card, you will get a 10% discount on your purchases.
3) If you apply a coupon code, you will get a discount of 20% on your purchase.
Note: If you apply a coupon code (New customer) with the discounts, the highest discount will be applicable
- Decision Table technique
Discount conditions | Rule 1 | Rule 2 | Rule 3 | Rule 4 | Rule 5 | Rule 6 | Rule 7 | Rule 8 |
New customer (15%) | True | True | True | True | False | False | False | False |
Old customer (10%) | True | True | False | False | True | True | False | False |
Coupen code discount (20%) | True | False | True | False | True | False | True | False |
Total discount | No discount | No discount | 20% | 15% | 10 + 20 30% | 10% | 20% | No discount |
5. State transition diagram/State transition technology state diagram :
Definition:
This technique is used to check for different states/ screens/pages of a system /machine/ software.
Example : In Gmail
Login as a user A >> Compose a mail and send a mail >> check in sent items and delete the mail >> go to the trash check the mail and empty the trash >>Logout.
Open the browser Enter the URL “www.gmail.com” |
Login Page
Enter the valid User name and Password and Click on Login button. |
Home Page
Click on compose page |
Compose page
Compose page
Enter all the values for all the fields and click on send |
Home Page
Click on Sent items |
Sent items Page
Select the mail and delete |
Home Page
Click on Trash |
Trash page
Empty the trash page |
Home Page
Click on Logout |
Login Page
ADVANTAGES :
1.Increasing number of bugs.
2.Long term maintenance of the system and automation.3.Objective process of Testing.
4.Possibility to reproduce a test.
Conclusion :
The successful application of test case design techniques will render test cases that ensure the success of software testing.