You are on page 1of 5

Software Quality

Assurance
[CS 303]

Course Instructor: Dr. Ali Javed


Submitted by: Laraib Fatima
Reg no: 19-CS-30
Q-1: For your selected term project, perform any five types of white box testing by designing and
executing the test cases. Also report the results in your testcase document.

Answer:

Project overview:

Title: Online Crime File management

Introduction:
The project titled as “Online Crime file Management “is a web-based application. This software provides
facility for reporting online crimes, complaints, missing persons, show most wanted person details
mailing as well as chatting. Any Number of clients can connect to the server. Each user first makes their
login to sever to show their availability. The server can be any Web Server. SMTP Server must be
maintained for temporary storage of emails and chat jar files for enable the chatting facilities.

Here we will be taking following five types of white box testing by designing and executing the test
cases:

A. Unit Testing

B. Condition Testing

C. Branch Testing

D. Domain Testing

F. Basis Path Testing

Let us discuss all these one by one:

1. Unit Testing:
Test Case for the Unit Testing:

Test Case Id Test Description Expected Actual output Status(Pass/Fail)


output
TC-01 Testing the Interface Interface was Pass
interface Should be working fine
working fine
TC-02 Invalid Boundary Loops and Loops and Fail
Conditions(loops, Conditions do Conditions contain
Conditions) not contain any any exceptional
exceptional conditions
conditions

2. Condition Testing:
Test case for Condition testing is given below in which the condition in the Predicate is checked and
based on which outputs are generated.
Test Case Predicate Inputs Expected Actual Status(Pass/Fail)
Id Output Output
TC-01 If(age>=18){ Age=18 Child Crime Child Crime Pass
Case case
Printf(“Child Crime
case ”);}
TC-02 If(age>=18){ Age=15 Child Crime Age Greater Fail
Case than 18 NOT
Printf(“Child Crime a child Crime
Case”);} case
TC-03 If(age>=18){ Age=20 Child Crime Child Crime Pass
Case Case
Printf(“Child Crime
Case”);}

3. Branch Testing:
Test case for the branch coverage is:

Test Predicate Inputs Expected Actual Status(Pass/Fail)


Case Output Output
Id
TC-01 If(Case==”302”&&Person!=Child){ 302,Adult Adult Adult Pass
Murderer Murderer
Printf(“Adult Murderer ”);}
TC-02 If(Case==”302”&&Person!=Child){ 302,Child Adult Not an Fail
Murderer Adult
Printf(“Adult Murderer ”);} Murderer
TC-03 If(Case==”302”&&Person!=Child){ !302,!Child Adult Not a Fail
Murderer Murderer
Printf(“Adult Murderer ”);}

4. Domain Testing:
Following is the test case for domain testing that will ensure

1. Age >1 and <19,Add to Missing Children list .

Test Case id Inputs Expected Actual Output Status(Pass/Fail)


Output
TC-01 Age=19 Should Add to Added to Adults Fail
Missing Children Missing List
list
TC-02 Age=34 Should Add to Added to Adults Fail
Missing Children Missing List
list
TC-03 Age=6 Should Add to Added to Missing Pass
Missing Children Children list
list

5. Basis Path Testing:


As Basis path testing is a white box technique so code is visible for a test case consider the following
code in which it is checked that a criminal has prime no of crimes or not :

int main()

int n, index;

cout << "Enter a number: " <> n;

index = 2;

while (index <= n - 1)

if (n % index == 0)

cout << "It is not a prime number" << endl;

break;

index++;

if (index == n)

cout << "It is a prime number" << endl;

Control Flow graph will be like:


Basis path Test case will be designed as:

Independent Path
Test case ID Input Number Output covered
TC-01 1 No Output A-B-F-H
TC-02 2 It is a prime no A-B-F-G-H
TC-03 3 Its is a prime no A-B-C-E-B-F-G-H
TC-04 4 It is not a prime no A-B-C-D-F-H

You might also like