STQA Lab File
STQA Lab File
VISHWAVIDYALAYA, INDORE
SHRI VAISHNAV INSTITUTE OF INFORMATION TECHNOLOGY
Department of Computer Science and Engineering
Lab Manual
Program :- B-Tech ( CSE )
Semester :- V Section :- A
Subject Name :- Software Testing & Quality Assurance
Subject Code :- BTDSE512N
Submitted By :- Submitted To :-
Aniket Kumar Jha Prof. Shuchi Mandhanya
21100BTCSE09768 CSE Department
SESSION:JUL-DEC 2023
Shri Vaishnav Vidyapeeth Vishwavidyalaya
Shri Vaishnav Institute of Information Technology
Department of Computer Science and Engineering
LIST OF EXPERIMENTS
EXPERIMENT-01
❖ AIM: Design test cases using Boundary value analysis by taking quadratic equation
problem.
Boundary value analysis is a software testing (Black Box) technique in which tests are
designed to include representatives of boundary values. The idea comes from the Boundary
(topology). Given that we have a set oftest vectors to test the system, a topology can be
defined on that set. Those inputs which belong to the same equivalence class as
defined by the equivalence partitioning theory w ou ld c on s t i t ut e t he basis
(topology). Given that the basis sets are ne i gh bo ur s as defined in
neighbourhood (mathematics), there would exist boundary between them. The test
vectors on either side of the boundary are called boundary values. In practice this would
require that the test vectors can be ordered, and that the individual parameters follow
some kind of order (either partial order or total order). The expected input and output
values to the software component should be extracted from the component specification.
The values are then grouped into sets with identifiable boundaries. Each set, or partition,
contains values that are expected to be processed by the component in the same way.
• Code:
• Output:
Real roots
Equal roots
Not Quadratic
Imaginary
In Boundary Value Analysis, there will be 4N+1 test cases which means 4*3+1 = 13
test cases will be generated.
Here's an explanation of how boundary value analysis was used to design the test cases:
• For the coefficient 'a', the boundary values are a = 0 and a ≠ 0. We check if a is zero and print
an error message if it is.
• For the discriminant, the boundary values are discriminant < 0, discriminant = 0, and
discriminant > 0. We check if the discriminant is negative, zero, or positive, and print the
appropriate output for each case.
By testing these boundary values, we can ensure that the program works correctly for all possible
inputs, and that any errors or bugs are caught and handled properly.
EXPERIMENT-02
❖ AIM: Design test cases using Equivalence class partitioning taking triangle
problem.
Equivalence class partitioning is a testing technique that divides the input values into different
equivalence classes based on certain criteria. For the triangle problem, we can use the following
equivalence classes:
• Equilateral triangle: All sides are equal.
• Isosceles triangle: Two sides are equal, third side is different.
• Scalene triangle: All sides are different.
• Invalid triangle: One or more sides are less than or equal to zero, or the sum of any two
sides is less than or equal to the third side.
➢ Program:
➢ Output:
Equilateral Triangle
Isosceles Triangle
Scalene Triangle
Using these equivalence classes, we can design the following test cases:
EXPERIMENT-03
❖ AIM: Design test cases using Decision table taking date problem.
1≤month≤12
1≤day≤31
2000≤year≤2030
The possible out puts are “Previous date” and “Invaliddate”.
CODE:
#include<iostream>
using namespace std;
int leap(int year);
int main()
{
int dc, month, date, year, dm, dn, leap;
cout<<"Enter the date : ";
cin>>date;
cout<<"\nEnter the month : ";
cin>>month;
cout<<"\nEnter the year : ";
cin>>year;
cout<<"\nEntered date is : "<<date<<"/"<<month<<"/"<<year;
if(leap==0)
{
if(month==1)
dm=0;
if(month==2)
dm=31;
if(month==3)
dm=59;
if(month==4)
dm=90;
if(month==5)
dm=120;
if(month==6)
dm=151;
if(month==7)
dm=181;
if(month==8)
dm=212;
if(month==9)
dm=243;
if(month==10)
dm=273;
if(month==11)
dm=304;
if(month==12)
dm=334;
}
else
{
if(month==1)
dm=0;
if(month==2)
dm=31;
if(month==3)
dm=60;
if(month==4)
dm=91;
if(month==5)
dm=121;
if(month==6)
dm=152;
if(month==7)
dm=182;
if(month==8)
dm=213;
if(month==9)
dm=244;
if(month==10)
dm=274;
if(month==11)
dm=305;
if(month==12)
dm=335;
}
dc=dm+date;
if(dn==0)
cout<<"\nSaturday";
else if(dn==1)
cout<<"\nSunday";
else if(dn==2)
cout<<"\nMonday";
else if(dn==3)
cout<<"\nTuesday";
else if(dn==4)
cout<<"\nWednesday";
else if(dn==5)
cout<<"\nThursday";
else if(dn==6)
cout<<"\nFriday";
return 0;
}
Output:-
➢
Sr.No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
C1:Monthsi M M M M M1 M M M1 M1 M M M M M2 M
n 1 1 1 1 1 1 1 2 2 2 2
C2:daysin D1 D1 D2 D2 D3 D3 D4 D4 D5 D5 D1 D1 D2 D2 D3
C3:yearin Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1
a1:Impossi X X
ble
a2:Decrem X X X X X X X X X
entday
a3: X X
Reset
dayto31
a4: X X
Reset
dayto30
a5:
Reset
dayto29
a6:
Reset
dayto28
a7:decrem X X X X
entmonth
a8:Resetm
onthtoDec
ember
a9:Decrem
entyear
Sr.No. 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
C1:Monthsi M M M M M2 M M M3 M3 M M M M M3 M
n 2 2 2 2 3 3 3 3 3 3 3
C2:daysin D3 D4 D4 D5 D5 D1 D1 D2 D2 D3 D3 D4 D4 D5 D5
C3:yearin Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2
a1:Impossi
ble
a2:Decrem X X X X X X X X X X X X X
entday
a3:
Reset
dayto31
a4:
Reset
dayto30
a5: X
Reset
dayto29
a6: X
Reset
dayto28
a7:decrem X X
entmonth
a8:Resetm
onthtoDec
ember
a9:Decrem
entyear
Sr.No. 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
C1:Monthsi M M M M M4 M M M4 M4 M M M M M5 M
n 4 4 4 4 4 4 4 5 5 5 5
C2:daysin D1 D1 D2 D2 D3 D3 D4 D4 D5 D5 D1 D1 D2 D2 D3
C3:yearin Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1
a1:Impossi
ble
a2:Decrem X X X X X X X X X X X
entday
a3: X X X X
Reset
dayto31
a4:
Reset
dayto30
a5:
Reset
dayto29
a6:
Reset
dayto28
a7:decrem X X
entmonth
a8:Resetm X X
onthtoDec
ember
a9:Decrem X X
entyear
Sr.No. 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
C1:Monthsi M M M M M5 M M M6 M6 M M M M M6 M
n 5 5 5 5 6 6 6 6 6 6 6
C2:daysin D3 D4 D4 D5 D5 D1 D1 D2 D2 D3 D3 D4 D4 D5 D5
C3:yearin Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2 Y1 Y2
a1:Impossi X X X X X
ble
a2:Decrem X X X X X X X X
entday
a3: X X
Reset
dayto31
a4:
Reset
dayto30
a5:
Reset
dayto29
a6:
Reset
dayto28
a7:decrem X X
entmonth
a8:Resetm
onthtoDec
ember
a9:Decrem
entyear
EXPERIMENT-04
1. Cyclomatic complexity V(G) of a flow graph G is equal to the number of predicate (decision) nodes
plus one. V(G)= π +1 where π is the number Aniket Kumar Jha of predicate nodes contained in the
flow graph G.
2. Cyclomatic complexity is equal to the number of regions of the flow graph.
➢ PROGRAM:
➢ OUTPUT:
Test Cases-
EXPERIMENT-05
To design the test cases for a login page of AMIZONE(mobile app is for the students of Amity
University), we can consider the following scenarios:
• Valid login credentials - Enter the correct login credentials (username and password) and
ensure that the user is logged in successfully.
• Invalid username - Enter an incorrect username and the correct password, and ensure that the
system prompts the user to enter valid credentials.
• Invalid password - Enter the correct username and an incorrect password, and ensure that the
system prompts the user to enter valid credentials.
• Incorrect username and password - Enter incorrect login credentials and ensure that the
system prompts the user to enter valid credentials.
➢ PROGRAM:
➢ OUTPUT:
➢ INPUT:
EXPERIMENT-06
Manual testing for PAN card verification typically involves the following steps:
• Verify the format of the PAN card number: The PAN card number should be in the format
of five alphabets followed by four numbers and one alphabet.
• Verify the length of the PAN card number: The PAN card number should be exactly 10
characters long.
• Verify the first five characters of the PAN card number: The first five characters of the
PAN card number should consist of alphabets only.
• Verify the sixth to ninth characters of the PAN card number: The sixth to ninth characters
of the PAN card number should consist of numbers only.
• Verify the last character of the PAN card number: The last character of the PAN card
number should consist of an alphabet only.
➢ PROGRAM:
➢ OUTPUT:
EXPERIMENT-07
Here are the steps for ATM validation of user when cash is to be withdrawn:
EXPERIMENT-08
Rational Robot is an automated testing tool developed by IBM. The testing process using Rational
Robot typically involves the following steps:
• Planning: In this phase, the testing team defines the scope of testing, identifies the testing
objectives, and prepares the test plan. The test plan defines the testing strategy, the testing
types, and the test cases to be executed.
• Recording: Rational Robot supports two methods of recording tests - GUI Recording and
Script Recording. GUI Recording records user actions by capturing the GUI components,
while Script Recording records user actions as code. The recording process creates a test script
that can be replayed to simulate user actions.
• Enhancing: Once the test script is recorded, it can be enhanced by adding verification points,
data-driven parameters, and error-handling routines. Verification points validate the
application's output against expected values, while data-driven parameters allow the same test
script to be executed with different input values. Error-handling routines detect and handle
errors that may occur during test execution.
• Debugging: The test script is then debugged to ensure it runs without errors. Debugging
involves identifying and fixing any issues in the script, such as syntax errors, missing object
references, or incorrect verification points.
• Execution: The test script is executed against the application under test (AUT). During test
execution, Rational Robot captures the test results, including any errors or failures.
• Reporting: After test execution, Rational Robot generates a detailed test report that includes
information on the test cases executed, their pass/fail status, and any defects identified. The
test report can be used to track testing progress and to identify areas for improvement in the
application under test.
Overall, the Rational Robot testing process involves planning, recording, enhancing, debugging,
executing, and reporting. By automating these steps, Rational Robot helps to reduce testing time
and increase test coverage, while improving the quality and reliability of the application under test.
Program for testing using Rational Robot, you would typically use a scripting language such as
VBScript or JScript.