Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Software Testing Assignment 2: Equivalence Partitioning, Decision Tables, and Boundary Val, Assignments of Software Engineering

Learning one on software engineering assignment, this is a case study

Typology: Assignments

2020/2021

Uploaded on 03/07/2021

harsha-kumar-1
harsha-kumar-1 🇮🇳

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Software Testing Assignment 2
Q1. A program takes an angle as input within the range [0,360] and determines in which
quadrant the angle lies. Design test cases using equivalence class partitioning method on the
input and the output domain.
Q2. A university is admitting students in a professional course subject to the following
conditions:
(a) Marks in Java >= 70
(b) Marks in C++ >= 60
(c) Marks in Data Structures >= 60
(d) Total in all three subjects >= 220 OR Total in Java and C++ >=150
If the aggregate marks of an eligible candidate is more than 240, he will be eligible for a
scholarship course, otherwise he will be eligible for normal course. The program reads the
marks in the three subjects and generates the following outputs:
(i) Not Eligible
(ii) Eligible for scholarship course
(iii) Eligible for Normal course
Design test cases for this program using decision table testing.
Q3. Consider a three-input program to handle personal loans of a customer. Its input is a triple
of positive integers (principal, rate, term).
1000 <= principal <= 40000; 1 <= rate <= 18; 1 <= term <= 6
The program should calculate the interest for the whole term of the loan and the total amount
of the personal loan. The output is:
Interest = principal * (rate/100) * term
Total_amount = principal + interest
Generate boundary value and robust test cases.
Q4. Consider the program given below.
/*Program to calculate total telephone bill amount to be paid by an customer*/
#include<stdio.h>
#include<conio.h>
1. void main()
2. {
3. int custnum, numcalls, valid=0;
4. float netamount;
5. clrscr();
6. printf(“Enter customer number and number of calls:”);
7. scanf(“%d %d”,&custnum,&numcalls);
8. if( custnum>10 && custnum<20000) {
9. valid=1;
10. if (numcalls<0){
11. valid=-1;
pf3
pf4

Partial preview of the text

Download Software Testing Assignment 2: Equivalence Partitioning, Decision Tables, and Boundary Val and more Assignments Software Engineering in PDF only on Docsity!

Software Testing Assignment 2

Q1. A program takes an angle as input within the range [0,360] and determines in which quadrant the angle lies. Design test cases using equivalence class partitioning method on the input and the output domain.

Q2. A university is admitting students in a professional course subject to the following conditions:

(a) Marks in Java >= 70 (b) Marks in C++ >= 60 (c) Marks in Data Structures >= 60 (d) Total in all three subjects >= 220 OR Total in Java and C++ >=

If the aggregate marks of an eligible candidate is more than 240, he will be eligible for a scholarship course, otherwise he will be eligible for normal course. The program reads the marks in the three subjects and generates the following outputs:

(i) Not Eligible (ii) Eligible for scholarship course (iii) Eligible for Normal course

Design test cases for this program using decision table testing.

Q3. Consider a three-input program to handle personal loans of a customer. Its input is a triple of positive integers (principal, rate, term).

1000 <= principal <= 40000; 1 <= rate <= 18; 1 <= term <= 6

The program should calculate the interest for the whole term of the loan and the total amount of the personal loan. The output is:

Interest = principal * (rate/100) * term Total_amount = principal + interest Generate boundary value and robust test cases.

Q4. Consider the program given below.

/Program to calculate total telephone bill amount to be paid by an customer/ #include<stdio.h> #include<conio.h>

  1. void main()
  2. {
  3. int custnum, numcalls, valid=0;
  4. float netamount;
  5. clrscr();
  6. printf(“Enter customer number and number of calls:”);
  7. scanf(“%d %d”,&custnum,&numcalls);
  8. if( custnum>10 && custnum<20000) {
  9. valid=1;
  10. if (numcalls<0){
  11. valid=-1;
  1. if (valid==1){
  2. if (numcalls<76){
  3. netamount = 500;
  4. }
  5. else if (numcalls>75 && numcalls<201){
  6. netamount = 500 + 0.80*(numcalls-75);
  7. }
  8. else if (numcalls>200 && numcalls<501){
  9. netamount = 500 + 1.00*( numcalls-200);
  10. }
  11. else{
  12. netamount = 500 + 1.20*(numcalls-500);
  13. }
  14. printf(“ \nCustomer number: %d\ t Total Charges:%.3f”,custnum,netamount);
  15. }
  16. else if (valid=0) {
  17. printf(“Invalid customer number”);
  18. }
  19. else{
  20. printf(“Invalid number of calls”);
  21. }
  22. getch();
  23. }

(a) Find all du-paths and identify those du-paths that are definition clear. Also find all du- paths, all-uses and all-definitions and generate test cases for these paths. (b) Consider all variables and generate possible program slices. Design at least one test case for every slice

Q5. Consider the program for determination of division of a student. Consider all variables and generate possible program slices. Design at least one test case from every slice. (code already given)

Q6. Consider a program for classification of a triangle. Its input is a triple of positive integers (a,b,c) and the input parameters are greater than zero and less than or equal to 100. The triangle is classified according to the following rules: (code already given)

Right angled Triangle: c^2 = a^2 + b^2 or a^2 = b^2 + c^2 or b^2 = c^2 + a^2 Obtuse angled Triangle: c^2 > a^2 + b^2 or a^2 > b^2 + c^2 or b^2 > c^2 + a^2 Acute angled Triangle: c^2 < a^2 + b^2 or a^2 < b^2 + c^2 or b^2 < c^2 + a^2 The program output may have one of the following: [Acute angled triangle, Obtuse angled triangle, Right angled triangle, Invalid Triangle]

(a) Design equivalence class test cases for input and output domain. (b) Design test cases using decision table testing technique.

(c) List all independent paths. (d) Design test cases for independent paths.