stqaLabFile - Garima Gupta
stqaLabFile - Garima Gupta
Cucumber is a popular automated software testing tool that supports Behavior Driven
Development (BDD), which is a software development process that implements important
acceptance test scenarios while development is in progress in order to help organizations get
most out of software testing.
While Cucumber was originally used exclusively for Ruby testing, it now supports a variety
of different programming languages through various implementations, including JavaScript,
Java, PHP, and Lua. Cucumber also features its own programming language, called Gherkin.
Used to define test cases, Gherkin was designed to be human-readable, and its purpose is
to promote BDD practices.
Cucumber is perfect for those who would like to focus on the end-user experience and
involve even those stakeholders who can’t code. It’s also free, easy to set up, and has been
downloaded over 30 million times, making it the world’s most popular automated software
testing tool for BDD.
2. Selenium
Selenium is arguably the most popular automated software testing tool among web
developers and testers. It was first released in 2004, and it has evolved considerably since
then. The latest version of Selenium consists of several components, including Selenium IDE
and Selenium WebDriver.
Selenium IDE is a complete integrated development environment (IDE) for Selenium tests,
and it’s used primarily for creating quick bug reproduction scripts and scripts to help in
automation-aided exploratory testing. On the other hand, Selenium WebDriver is a collection
of language-specific bindings to drive a browser, and it was developed to better support
dynamic web pages.
Selenium is compatible with all major web browsers and supports a number of popular
programming languages, including JavaScript, Java, Ruby, Python, PHP, and C#, just to
name a few. While Selenium makes it possible to author automation tests without any
programming skills, complex test scripts require advanced programming skills.
Considering that Selenium is free, open source, and enjoys the support of some of the largest
browser vendors, all automation testers who want to be competitive should see Selenium as a
professional investment and at the very least familiarize themselves with it.
3. Appium
Appium is an automated software testing tool for use with native, hybrid, and mobile web
apps. With mobile apps on the rise and major app stores becoming increasingly competitive,
there is an urgent need to deliver only quality apps to the consumer.
Appium has been successfully used to automate large regression tests, convert manual test
cases to automated scripts, and more. Because it supports both Android and iOS, there’s no
need to learn a new language for each platform, which saves time and aligns with the needs
of most app developers.
4. Katalon Studio
Katalon Studio is a cross-platform automation testing solution built on top of the Selenium
and Appium frameworks. It’s completely free, easy to deploy, and its active community of
over 100,000 automation testers has created a wealth of tutorials and guides that make
learning how to use Katalon Studio effortless.
Non-programmers can use Katalon Studio to record test scripts, while automation testers with
some programming knowledge can explore some of the more advanced features of Katalon
Studio and create powerful automation scripts using Groove, Java, or JavaScript.
Katalon Studio works well with popular tools in the QA process, and it can be integrated into
the CI/CD processes. There’s also a streamlined version of Katalon Studio, called Katalon
Recorder, and it can be installed in just a few seconds on both Chrome and Firefox.
5. Eggplant Functional
Eggplant Functional was conceived by Doug Simons, Jonathan Gillaspie, and John McIntosh
and first released in 2002 by Redstone Software. Unlike other automated software testing
tools on this list, Eggplant Functional uses an image-based approach to testing, as opposed to
looking at the tested application from the object perspective. This means that the technology
used to build the tested application is irrelevant, as is the system on which the application
runs.
Plug-ins for some of the most popular continuous integration and application lifecycle
management (ALM) tools are available, including IBM UrbanCode, Bamboo, HP
Application Lifecycle Management, IBM RQM, and Jenkins, among others. Because
Eggplant Functional has secured a patent for its intelligent image recognition method, it has
been able to enjoy a somewhat privileged position on the market, but its accomplishments
stand on their own.
CODE
import java.util.Scanner;
class MatrixOperations {
matrix1[i][j] = input.nextInt();
matrix2[i][j] = input.nextInt();
displayMatrix(sumMatrix);
displayMatrix(diffMatrix);
System.out.println();
}
EXPERIMENT 2.
Adhoc Testing
Adhoc testing is a type of software testing which is performed informally and randomly after
the formal testing is completed to find out any loophole in the system. For this reason, it is
also known as Random testing or Monkey testing. Adhoc testing is not performed in an
structured way so it is not based on any methodological approach. That’s why Adhoc testing
is a type of Unstructured Software Testing.
1 50 50 50 51 100 51 100
Subtraction
Subtraction
0 0
0 0
-49 0
-49 0
2. Addition Addition
50 50 50 50 100 100 100 100
2 50 50 50 52 100 52 100
Subtraction
Subtraction
0 0
0 0
-48 0
-48 0
3. Addition Addition
50 50 50 50 100 100 100 100
4. Addition Addition
50 50 50 50 100 100 100 100
5. Addition Addition
50 50 50 50 100 100 100 100
50 1 50 50 100 51 100 51
Subtraction Subtraction
0 0 0 0
0 -49 0 -49
6. Addition Addition
50 50 50 50 100 100 100 100
50 2 50 50 100 52 100 52
Subtraction
Subtraction
0 0
0 0
0 -48
0 -48
7. Addition Addition
50 50 50 50 100 100 100 100
8. Addition Addition
50 50 50 50 100 100 100 100
1. Addition Addition
Invalid Input
101 50 50 50 151 100
Subtraction
50 50 50 50 Invalid Input
100 100
Subtraction
51 0
0 0
2. Addition Addition
Invalid Input
50 0 50 50 100 50
Subtraction
50 50 50 50 Invalid Input
100 100
Subtraction
0 -50
0 0
The test case generated randomly gives correct performance when the test cases are within
the range while they give wrong results when the inputs are beyond the given range.
EXPERIMENT 3.
Boundary Value Analysis is based on testing the boundary values of valid and invalid
partitions. The behavior at the edge of the equivalence partition is more likely to be incorrect
than the behavior within the partition, so boundaries are an area where testing is likely to
yield defects.
It checks for the input values near the boundary that have a higher chance of error. Every
partition has its maximum and minimum values and these maximum and minimum values are
the boundary values of a partition.
Boundary Value Test Cases are: -
● Min value = 1
● Close to min = 2
● Nominal = 50
● Close to max = 99
● Max = 100
2. Addition Addition
2 50 50 50 52 100 52 100
4. Addition Addition
99 50 50 50 149 100 149 100
5. Addition Addition
100 50 50 50 150 100 150 100
6. Addition Addition
50 1 50 50 100 51 100 51
7. Addition Addition
50 2 50 50 100 52 100 52
8. Addition Addition
50 99 50 50 100 149 100 149
9. Addition Addition
50 100 50 50 100 150 100 150
1 50 50 50 51 100 51 100
Subtraction
Subtraction
0 0
0 0
-49 0
-49 0
2 50 50 50 52 100 52 100
Subtraction
Subtraction
0 0
0 0
-48 0
-48 0
50 1 50 50 100 51 100 51
Subtraction
Subtraction
0 0
0 0
0 -49
0 -49
50 50 50 50 100 100
Subtraction
100 100
-50 0
Subtraction
0 0
-50 0
0 0
50 50 1 50 51 100 51 100
Subtraction
Subtraction
0 0
0 0
49 0
49 0
50 50 2 50 52 100
Subtraction
52 100
0 0
Subtraction
48 0
0 0
48 0
50 50 50 1 100 51 100 51
Subtraction
Subtraction
0 0
0 0
0 49
0 49
50 50 50 2 100 52 100 52
Subtraction
Subtraction
0 0
0 0
0 48
0 48
The test cases in the Boundary Level Testing Technique gives correct output when run the
the given program.
EXPERIMENT 4.
Robustness Testing
Robustness is a measure of how well a software system can cope with invalid inputs or
unexpected user interactions. A robust system is one that continues to function correctly even
in the face of unexpected or invalid inputs. A software system that is robust is able to handle
errors and unexpected inputs gracefully, without crashing or producing incorrect results.
● Min value = 1
● Close to min = 2
● Lesser than min value = 0
● Nominal = 50
● Close to max = 99
● Max = 100
● Larger than max value = 101
0 0
4. Addition Addition
1 50 50 50 51 100 51 100
5. Addition Addition
2 50 50 50 52 100 52 100
7. Addition Addition
99 50 50 50 149 100 149 100
8. Addition Addition
100 50 50 50 150 100 150 100
9. Addition Addition
Invalid Input
101 50 50 50 151 100
Subtraction
50 50 50 50 Invalid Input
100 100
Subtraction
51 0
0 0
0 0
0 0
-50 0
1 50 50 50 51 100 51 100
Subtraction
Subtraction
0 0
0 0
-49 0
-49 0
51 0
0 -50
50 1 50 50 100 51 100 51
Subtraction
Subtraction
0 0
0 0
0 -49
0 -49
50 2 50 50 100 52 100 52
Subtraction
Subtraction
0 0
0 0
0 -48
0 -48
0 51
0 0
0 0
0 0
0 0
50 0
50 50 1 50 51 100 51 100
Subtraction
Subtraction
0 0
0 0
49 0
49 0
50 50 2 50 52 100 52 100
Subtraction
Subtraction
0 0
0 0
48 0
48 0
-51 0
0 50
50 50 50 1 100 51 100 51
Subtraction
Subtraction
0 0
0 0
0 49
0 49
50 50 50 2 100 52 100 52
Subtraction
Subtraction
0 0
0 0
0 48
0 48
47. Addition Addition
50 50 50 50 100 100 100 100
0 -51
Since the test cases in Robust Worst Case Testing Technique gives wrong answers for the test
cases generated beyond the given range, we have made corrections in the program to handle
these type of test cases.
class MatrixOperations {
boolean flag=true;
int val=input.nextInt();
if(val<1 || val>100){
flag=false;
matrix1[i][j] = val;
int val=input.nextInt();
if(val<1 || val>100){
flag=false;
matrix2[i][j] = val;
if(flag==true){
displayMatrix(sumMatrix);
displayMatrix(diffMatrix);
}else{
System.out.println("Invalid Input");
System.out.println();
}
EXPERIMENT 5.
If we reject “single” fault assumption theory of reliability, and consider cases where more
than 1 variable has extreme values, then it is known as worst case analysis.
5n = 58 = 390625 cases
We will be considering both the matrices as separate variables where values in one matrix
will be same and hence number of test cases = 5^2 = 25 test cases
1 1 1 1 2 2 2 2
Subtraction Subtraction
0 0 0 0
0 0 0 0
2. Addition Addition
1 1 2 2 3 3 3 3
1 1 2 2 3 3 3 3
Subtraction
Subtraction
-1 -1
-1 -1
-1 -1
-1 -1
3. Addition Addition
1 1 50 50 51 51 51 51
1 1 50 50 51 51 51 51
Subtraction
Subtraction
-49 -49
-49 -49
-49 -49
-49 -49
4. Addition Addition
1 1 99 99 100 100 100 100
5. Addition Addition
1 1 100 100 101 101 101 101
6. Addition Addition
2 2 1 1 3 3 3 3
2 2 1 1 3 3 3 3
Subtraction
Subtraction
1 1
1 1
1 1
1 1
7. Addition Addition
2 2 2 2 4 4 4 4
2 2 2 2 4 4 4 4
Subtraction
Subtraction
0 0
0 0
0 0
0 0
8. Addition Addition
2 2 50 50 52 52 52 52
2 2 50 50 52 52 52 52
Subtraction
Subtraction
-48 -48
-48 -48
-48 -48
-48 -48
9. Addition Addition
2 2 99 99 101 101 101 101
50 50 1 1 51 51 51 51
Subtraction
Subtraction
49 49
49 49
49 49
49 49
50 50 2 2 52 52 52 52
Subtraction
Subtraction
48 48
48 48
48 48
48 48
98 98
All Test Cases in Worst Test Cases Testing Technique generated results in the correct output
as changes were made in the program.
EXPERIMENT 6.
In robustness testing, we add two more states i.e. just below minimum value (minimum
value– ) and just above maximum value (maximum value+ ). We also give invalid inputs and
observe the behaviour of the program. A program should be able to handle invalid input
values, otherwise it may fail and give unexpected output values.
7n = 78 = 5764801 cases
{0, 1, 2, 50, 99, 100, 101} * {0, 1, 2, 50, 99, 100, 101}
We will be considering both the matrices as separate variables where values in one matrix
will be similar and hence the number of test cases = 7^2 = 49 test cases
2. Addition Addition
Invalid Input Invalid Input
0 0 1 1
Subtraction Subtraction
0 0 1 1 Invalid Input Invalid Input
3. Addition Addition
Invalid Input Invalid Input
0 0 2 2
Subtraction Subtraction
0 0 2 2 Invalid Input Invalid Input
4. Addition Addition
Invalid Input Invalid Input
0 0 50 50
Subtraction Subtraction
0 0 50 50 Invalid Input Invalid Input
5. Addition Addition
Invalid Input Invalid Input
0 0 99 99
Subtraction Subtraction
0 0 99 99 Invalid Input Invalid Input
6. Addition Addition
Invalid Input Invalid Input
0 0 100 100
Subtraction Subtraction
0 0 100 100 Invalid Input Invalid Input
7. Addition Addition
Invalid Input Invalid Input
0 0 101 101
Subtraction Subtraction
0 0 101 101 Invalid Input Invalid Input
8. Addition Addition
Invalid Input Invalid Input
1 1 0 0
Subtraction Subtraction
1 1 0 0 Invalid Input Invalid Input
9. Addition Addition
1 1 1 1 2 2 2 2
1 1 1 1 2 2 2 2
Subtraction Subtraction
0 0 0 0
0 0 0 0
1 1 2 2 3 3 3 3
Subtraction
Subtraction
-1 -1
-1 -1
-1 -1
-1 -1
1 1 50 50 51 51 51 51
Subtraction
Subtraction
-49 -49
-49 -49
-49 -49
-49 -49
2 2 1 1 3 3 3 3
Subtraction
Subtraction
1 1
1 1
1 1
1 1
2 2 2 2 4 4 4 4
Subtraction
Subtraction
0 0
0 0
0 0
0 0
2 2 50 50 52 52 52 52
Subtraction
Subtraction
-48 -48
-48 -48
-48 -48
-48 -48
50 50 1 1 51 51 51 51
Subtraction
Subtraction
49 49
49 49
49 49
49 49
50 50 2 2 52 52 52 52
Subtraction
Subtraction
48 48
48 48
48 48
48 48
Since the code was corrected after the Robust Testing Technique, all the actual output comes
out to be the same as all the expected output, hence we see no test case go fail.
EXPERIMENT 7.
Equivalence Testing
0 0
0 -51
I3. Addition Addition
Invalid Input
50 0 50 50 100 50
Subtraction
50 50 50 50 Invalid Input
100 100
Subtraction
0 -50
0 0
51 0
0 51
0 0
Output Domains
O-1={<a,b,c,d,e,f,g,h>: All valid variables gives valid addition, subtraction}
O-2={<a,b,c,d,e,f,g,h>: Invalid inputs}
EXPERIMENT 8.
Decision tables are used in various engineering fields to represent complex logical
relationships. The output may be dependent on many input conditions and decision tables
give a tabular view of various combinations of input conditions and these conditions are in
the form of True(T) and False(F).
a<1? F T T T T T T T T T T T T T T T T
CONDITION
b<1? - F T T T T T T T T T T T T T T T
c<1? - - F T T T T T T T T T T T T T T
d<1? - - - F T T T T T T T T T T T T T
e<1? - - - - F T T T T T T T T T T T T
f<1? - - - - - F T T T T T T T T T T T
g<1? - - - - - - F T T T T T T T T T T
h<1? - - - - - - - F T T T T T T T T T
a>100? - - - - - - - - F T T T T T T T T
b>100? - - - - - - - - - F T T T T T T T
c>100? - - - - - - - - - - F T T T T T T
d>100? - - - - - - - - - - - F T T T T T
e>100? - - - - - - - - - - - - F T T T T
f>100? - - - - - - - - - - - - - F T T T
g>100? - - - - - - - - - - - - - - F T T
h>100? - - - - - - - - - - - - - - F T
Invalid X X X X X X X X X X X X X X X X
Input
ACTION
Valid X
Input
EXPERIMENT 9.
Control flow testing is a software testing technique that focuses on evaluating the correctness of a
program's control flow structures. It involves designing test cases to explore different paths through
the program, including loops, branches, and decision points. The goal is to ensure that the program
executes as expected under various conditions, uncovering potential errors in control flow logic.
Performing control flow testing involves ensuring that each branch and decision point in the
code is exercised by at least one test case. The goal is to verify that the program follows the
intended control flow under various inputs, revealing any potential issues in the logic.
These examples cover the control flow of the program, including the conditional statements and the
recursive function. The goal of control flow testing is to ensure that the program behaves correctly for
different inputs and follows the intended control flow.
EXPERIMENT 10.
EXAMPLE:-
A program that takes user input for a triangle's three sides and determines whether it is an
equilateral, isosceles, or scalene triangle.
#include <iostream>
#include <cmath>
return "Invalid input. Please enter positive values for the sides.";
if (a == b && b == c) {
return "Equilateral";
} else if (a == b || b == c || a == c) {
return "Isosceles";
} else {
return "Scalene";
int main() {
// User input
cout << "The triangle is " << result << "." << endl;
return 0;
Data enters the program when the user provides input for the lengths of sides a, b, and c.
2. Data Processing:
The program processes the input data by calling the classify_triangle function, which determines
the type of triangle based on the input.
The result is the type of triangle (Equilateral, Isosceles, or Scalene), and it is printed to the console.
Input: a = 5, b = 5, c = 5
Input: a = 5, b = 5, c = 6
Input: a = 3, b = 4, c = 5
Input: a = -1, b = 2, c = 3
Expected Output: "Invalid input. Please enter positive values for the sides."
EXPERIMENT 11.
Regression Testing
Modification Algorithm
Regression testing is a black box testing techniques. It is used to authenticate a code change
in the software does not impact the existing functionality of the product. Modification
Algorithm is used to minimize and prioritize test cases based on the modified lines of source
code.
#include<bits/stdc++.h>
using namespace std;
int main() {
int t1[50][50];
int count = 0;
int candidate[50] = {0}, priority[50] = {0}, m = 0, pos[50],
found[50][50], k, t, c[50], l, num, n, index[50], i, j, modnum, nfound[50],
mod[50];
while (1) {
count = 0;
for (i = 0; i < num; i++) {
nfound[i] = 0;
pos[i] = i;
}
for (i = 0; i < num; i++) {
l = 0;
for (j = 0; j < c[i]; j++) {
if (candidate[i] != 1) {
for (k = 0; k < modnum; k++) {
if (t1[i][j] == mod[k]) {
nfound[i]++;
found[i][l] = mod[k];
l++;
}
}
}
}
}
l = 0;
for (i = 0; i < num; i++)
for (j = 0; j < num - 1; j++)
if (nfound[i] > nfound[j]) {
t = nfound[i];
nfound[i] = nfound[j];
nfound[j] = t;
t = pos[i];
pos[i] = pos[j];
pos[j] = t;
}
for (i = 0; i < num; i++)
if (nfound[i] > 0)
count++;
if (count == 0)
break;
candidate[pos[0]] = 1;
priority[pos[0]] = ++m;
cout << "\nTestcase\tMatches";
for (i = 0; i < num; i++)
cout << "\n" << pos[i] + 1 << "\t\t" << nfound[i];
for (i = 0; i < c[pos[0]]; i++)
for (j = 0; j < modnum; j++)
if (t1[pos[0]][i] == mod[j])
mod[j] = 0;
cout << "\nModified Array:";
for (i = 0; i < modnum; i++)
if (mod[i] == 0)
continue;
else
cout << setw(4) << mod[i];
}
count = 0;
cout << "\nTest case selected.....\n";
for (i = 0; i < num; i++)
if (candidate[i] == 1)
cout << "\nT" << i + 1 << "\t Priority" << priority[i] << "\n ";
if (count == 0)
cout << "\nNone";
return 0;
}
Inputs:
Outputs:
Experiment – 12
Regression Testing
Deletion Algorithm
The ‘deletion’ portion of the technique is used to (i) update the execution history of test cases
by removing the deleted lines of source code (ii) identify and remove those test cases that
cover only those lines which are covered by other test cases of the program.
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t1[50][50];
int count=0;
int
candidate[50]={0},priority[50]={0},m=0,pos[50],found[50][50],k,t,c[50],l,num,n,index[50],i,j,modnum,nfound
[50],mod[50];
cout<<"Enter the number of test cases:";
cin>>num;
for(i=0;i<num;i++)
{
cout<<"Enter the length of test case"<<i+1<<" : ";
cin>>c[i];
}
for(i=0;i<50;i++)
for(j=0;j<50;j++)
found[i][j]=0;
for(i=0;i<num;i++)
for(j=0;j<c[i];j++){
t1[i][j]=0;
}
for(i=0;i<num;i++){
cout<<"Enter the values of test case "<<i+1<<" : ";
for(j=0;j<c[i];j++){
cin>>t1[i][j];
}
pos[i]=i;
}
cout<<"\nEnter number of modified lines of code: ";
cin>>modnum;
cout<<"Enter the lines of code modified: ";
for(i=0;i<modnum;i++)
cin>>mod[i];
while(1)
{
count=0;
for(i=0;i<num;i++)
{
nfound[i]=0;
pos[i]=i;
}
for(i=0;i<num;i++)
{
l=0;
for(j=0;j<c[i];j++)
{
if(candidate[i]!=1)
{
for(k=0;k<modnum;k++)
{
if(t1[i][j]==mod[k])
{
nfound[i]++;
found[i][l]=mod[k];
l++;
}
}
}
}
}
l=0;
for(i=0;i<num;i++)
for(j=0;j<num-1;j++)
if(nfound[i]>nfound[j])
{
t=nfound[i];
nfound[i]=nfound[j];
nfound[j]=t;
t=pos[i];
pos[i]=pos[j];
pos[j]=t;
}
for(i=0;i<num;i++)
if(nfound[i]>0)
count++;
if(count==0)
break;
candidate[pos[0]]=1;
priority[pos[0]]=++m;
cout<<"\nTestcase\tMatches";
for(i=0;i<num;i++)
{
cout<<"\n"<<pos[i]+1<<"\t\t"<<nfound[i];
}
for(i=0;i<c[pos[0]];i++)
for(j=0;j<modnum;j++)
if(t1[pos[0]][i]==mod[j]){
mod[j]=0;
}
cout<<"\nModified Array:";
for(i=0;i<modnum;i++){
if(mod[i]==0){
continue;
}
else {
cout<<mod[i]<<"\t";
}
}
}
count=0;
cout<<"\nTest case selected.....\n";
for(i=0;i<num;i++)
if(candidate[i]==1){
cout<<"\nT"<<i+1<<"\tPriority"<<priority[i]<<"\n";
count++;
}
if(count==0){
cout<<"\nNone";
}
return 0;
}
OUTPUT