ST Assignment 1 (19011598-026)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

SOFTWARE ENGINEERING DEPARTMENT

ASSIGNMENT 1

SUBMITTED TO:
Miss Uzma
SUBMITTED BY:
Muhammad Hammad (19011598-026)
SEMESTER:
7th SEMESTER
SECTION:
A
COURSE NAME:
Software Testing
DATE:
December 19, 2022
1. Consider the quadrilateral problem given in chapter 2 (Section 2.6.1 page 30). Create robust
boundary value test cases for quadrilateral problem

Ans. As given conditions:

c1. 1 ≤ a ≤ 200 (top)


c2. 1 ≤ b ≤ 200 (left side)
c3. 1 ≤ c ≤ 200 (bottom)
c4. 1 ≤ d ≤ 200 (right side)

Test Case ID a b c d
TC1 0 30 40 20
TC2 1 30 40 20
TC3 2 30 40 20
TC4 105 105 105 105
TC5 199 30 40 20
TC6 200 30 40 20
TC7 201 30 40 20
TC8 30 0 40 20
TC9 30 1 40 20
TC10 30 2 40 20
TC11 30 199 40 20
TC12 30 200 40 20
TC13 30 201 40 20
TC14 30 40 0 20
TC15 30 40 1 20
TC16 30 40 2 20
TC17 30 40 199 20
TC18 30 40 200 20
TC19 30 40 201 20
TC20 30 40 20 0
TC21 30 40 20 1
TC22 30 40 20 2
TC23 30 40 20 199
TC24 30 40 20 200
TC25 30 40 20 201

2. Perform Boundary Value Testing for the following:


Course ID—three alpha characters representing the department followed by a six-digit integer
which is the unique course identification number. The possible departments are:

PHY – Physics EGR – Engineering ENG – English


LAN - Foreign languages CHM – Chemistry MAT – Mathematics
PED - Physical education SOC - Sociology
Test Case Department Course ID Expected Output
TC1 PHY 100000 Valid
TC2 EGR 100001 Valid
TC3 ENG 550000 Valid
TC4 LAN 999999 Valid
TC5 CHM 999998 Valid
TC6 MAT 000000 Invalid
TC7 PE 998067 Invalid
TC8 SOC 7699 Invalid

3. Consider a program for the classification of a triangle. Its input is a triple of positive integers
(say, a, b and c) from the interval [1, 100]. The output may be one of the following words
[scalene, Isosceles, Equilateral, Not a triangle]. Create equivalence classes and design weak
normal, strong normal, weak robust and strong robust test cases accordingly

Ans. The Equilateral classes are as follows:

 Equilateral
 Scalene
 Isosceles
 Not a Triangle

Week Normal

a b c
5 5 5
4 5 5
4 5 6
2 3 7

Week Robust

a b c
-1 5 5
5 -1 5
5 5 -1
205 5 5
5 205 5
5 5 205

Strong Normal

a b c
5 5 5
5 6 6
5 5 6
5 6 5
4 5 6
2 6 10
6 2 10
10 2 6

Strong Robust

A B C
-1 5 5
5 -1 5
5 5 -1
-1 -1 5
5 -1 -1
-1 -1 -1
201 5 5
5 201 201
201 201 5
201 201 5
5 201 201
201 201 201

4. Consider the quadrilateral problem given in chapter 2 (Section 2.6.1 page 30). Create
equivalence classes and design weak normal, strong normal, weak robust and strong robust test
cases accordingly

There are 7 equivalence classes for quadrilateral problem

 Square / Rhombus
 Kite
 Quadrilateral
 Rectangle / Parallelogram
 Trapezoid

Square and Rhombus are combined because its all sides are equal.

Rectangle and Parallelogram are combined because (a = c & b = d)

Week Normal

a b c d
6 6 6 6
6 6 4 4
5 7 3 9
6 4 6 4
4 6 2 6
Week Robust

a b c d
-1 6 6 6
6 -1 6 6
6 6 -1 6
6 6 6 -1
201 6 6 6
6 201 6 6
6 6 201 6
6 6 6 201

Strong Normal

a b c d
6 6 6 6
6 6 4 4
6 4 7 3
6 4 6 4
4 6 3 6
4 6 6 6
2 4 6 6
6 6 3 2
6 6 6 3
6 7 6 6
6 6 4 6
6 2 6 3
2 6 6 9

Strong Robust

A B X d
-1 6 6 6
-1 -1 6 6
-1 -1 -1 6
-1 -1 -1 -1
6 -1 -1 4
6 -1 -1 -1
6 6 -1 6
6 -1 6 6
201 6 6 6
6 201 6 6
6 6 201 6
6 6 6 201
6 6 201 201
6 201 201 201
6 201 201 201
201 201 201 201
201 201 6 6
201 201 201 8

5. If you use a compiler for a strongly typed language, discuss how it would react to robust
equivalence class test cases

Ans. A compiler for a strongly typed language would react to robust equivalence class test cases by
ensuring that the code is correctly typed and that the data is of the correct type for the operations it is
being used for. It would also ensure that the code adheres to the language’s syntax rules, and that any
data being used has the correct structure and format. In addition, it would also check that any function
calls or API calls are valid and that the parameters being passed in are of the correct type and format.
Finally, it would ensure that any loop conditions are valid, and that any branching logic is valid as well.

6. Consider the following problem and determine how you can perform the black box testing for
this problem. Create the test case using appropriate test design technique. Also give the
reasoning for the chosen technique.

Ans. I will use decision table design technique. Because in this statement there are some conditions, So I
will use decision table technique.

Following conditions are as follows:

 Matric ≥ 90 %
 Inter ≥ 90 %
 Admission Test ≥ 90 %
 Marks 90 % ≤ 85 %
 Need base
 Kinship

Decision Table

Matric ≥ 90 T F T T T T T
%

Inter ≥ 90 % T DC F T T T T

Admission T DC DC F F F F
Test ≥ 90 %

Marks 90 % DC DC DC F T F T
≤ 85 %

Need base DC DC DC DC F DC T
Kinship DC DC DC F DC T DC
100 % 🗸
75 % 🗸
50 % 🗸
25 % 🗸
0% 🗸 🗸 🗸

7. If you use a compiler for a strongly typed language, discuss how it would react to robust
equivalence class test cases

Mon 1 = {m: month has 30 days}

Mon 2 = {m: month has 31 days}

Mon 3 = {m: February Month}

…….

Year 1 = {y: year is leap year}

Year 2 = {y: not a leap year}

Decision Table:

Month Mon 1 Mon 2 Mon 3 Mon 4


Year DC DC Year 1 Year 2
Output 28 🗸
Output 29 🗸
Output 30 🗸
Output 31 🗸

8. Determine equivalence classes for Previous Date program, make a decision-table and specify
the test cases.

Mon 1 = {m: month of 30 days}

Mon 2 = {m: month of 31 days}

Mon 3 = {m: month is January}

Mon 4 = {m: month is march}

Day 1 = {d: day between 2 ≤ 31}

Day2 = {d: day is 1}


Year 1 = {y: Leap year}

Year 2 = {y: Not a leap year}

Decision Table

Month Mon 1 Mon 2 Mon 3 Mon 4 DC Mon 4


Year DC DC DC Year 1 DC Year 2
Day Day 2 Day 2 Day 2 Day 2 Day 1 Day 2
Decrement 🗸
Day
Decrement 🗸 🗸 🗸 🗸
Month
Decrement 🗸
Year
Reset 🗸
month
Reset Days 🗸 🗸 🗸
Set Day 29 🗸
Set Day 28 🗸

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy