Software testing lab file kalash
Software testing lab file kalash
EXPERIMENT – 1
AIM: Implement a program in ‘C’ for Triangle Problem using Boundary
Value Analysis technique.
Program::
#include <stdio.h>
if (!isValidTriangle(a, b, c)) {
printf("Not a triangle.\n");
return;
}
if (a == b && b == c) {
printf("Equilateral triangle.\n");
} else if (a == b || b == c || a == c) {
printf("Isosceles triangle.\n");
} else {
printf("Scalene triangle.\n");
}
int main() {
int a, b, c;
printf("Enter the sides of the triangle: ");
return 0;
}
OUTPUT::
Enter the sides of the triangle: 3 3 3.
Equilateral triangle.
Isosceles triangle.
Scalene triangle.
Not a triangle.
Not a triangle.
EXPERIMENT – 2
AIM: Implement a program in ‘C’ for Commission Problem using
Boundary Value Analysis technique.
Program::
#include <stdio.h>
return 0.0;
} else {
return sales * 0.15;
int main() {
printf("Sales\tCommission\n");
return 0;
OUTPUT::
Boundary Value Analysis Test Cases:
Sales Commission
5000 0.00
5001 250.05
10000 500.00
10001 1000.10
20000 2000.00
20001 3000.15
EXPERIMENT – 3
AIM: Implement a Program in ‘C’ for Next date using Boundary Value
Analysis technique
Program::
#include <stdio.h>
#include <stdbool.h>
switch (month) {
return 31;
return 30;
case 2:
default:
if (day < 1 || day > daysInMonth || month < 1 || month > 12 || year < 1) {
return;
day++;
} else {
day = 1;
month++;
} else {
month = 1;
year++;
int main() {
int testCases[][3] = {
};
return 0;
OUTPUT::
Boundary Value Analysis Test Cases:
EXPERIMENT – 4
AIM: Implement a program in ‘C’ for Triangle Problem using
Equivalence Class Testing technique.
Program::
#include <stdio.h>
printf("Isosceles Triangle\n");
} else {
printf("Scalene Triangle\n");
}
}
KALASH KUMAR 2100910130050 IT -1(A2)
JSS Academy of Technical Education Software Testing Lab (KIT -751A)
int main() {
// Test cases using Equivalence Class Testing
int testCases[][3] = {
{3, 3, 3}, // Equilateral
};
int a = testCases[i][0];
int b = testCases[i][1];
int c = testCases[i][2];
printf("Input Sides: %d, %d, %d -> ", a, b, c);
classifyTriangle(a, b, c);
}
return 0;
}
OUTPUT::
EXPERIMENT – 5
AIM: Implement a program in ‘C’ for Commission Problem using
Equivalence Class Testing technique
Program::
#include <stdio.h>
} else {
return sales * 0.15; // 15% commission
}
}
int main() {
// Test cases using Equivalence Class Testing
float testCases[] = {
0, // Invalid: Zero sales
-1000, // Invalid: Negative sales
3000, // Valid: No commission range
return 0;
}
OUTPUT::
Commission Calculation Test Cases:
Sales Commission
0.00 Invalid input: Sales cannot be zero.
-1000.00 Invalid input: Sales cannot be negative.
3000.00 0.00
7500.00 375.00
15000.00 1500.00
25000.00 3750.00
EXPERIMENT – 6
AIM: Implement a program in ‘C’ for Next date program using
Equivalence Class Testing technique.
Program::
#include <stdio.h>
#include <stdbool.h>
switch (month) {
return 31;
return 30;
case 2:
default:
if (year <= 0 || month < 1 || month > 12 || day < 1 || day > daysInMonth) {
return;
day++;
} else {
day = 1;
month++;
} else {
month = 1;
year++;
int main() {
int testCases[][3] = {
};
return 0;
OUTPUT::
Next Date Program - Equivalence Class Testing:
EXPERIMENT – 7
AIM: Implement a program in ‘C’ for Binary Search using Basis paths
technique.
Program::
#include <stdio.h>
if (arr[mid] == target) {
} else {
int main() {
// Test cases
int testCases[] = {
};
if (result != -1) {
} else {
return 0;
OUTPUT::
Binary Search Test Cases (Basis Path Testing):