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

GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY

(University School of Information Technology and Communication)

SOFTWARE ENGINEERING LAB


(IT - 652)

Submitted by :-
Name – SAHIL KUMAR SINGH
Course – MCA(SE)
Roll. No- 04016404518 Signature :..................
“INDEX”

S NO. QUESTION PAGE NO. SIGNATURE

1 Write a problem
statement on a suitable
current topic.

2 Identify the requirements


from problem statement
and categorize them into
functional and non
functional requirements.

3 Prepare an SRS for the


above problem statement.

4 Construct an entity
relationship diagram with
all mapping
cardinalities,strong
entities,weak entities and
attributes of entities.
5 Construct a context,level-1
and level-2 data flow
diagrams for the above
problem statements.
Explain the symbols used.

6 Write a program to
estimate the metrics of a
project
(1)Function points
(2)Basic cocomo model
(3)Intermediate cocomo
model

7 Construct use case


diagrams diagrams for the
above problem statement
with include and exclude
relationships.
8 Write a program to
compute cyclomatic
complexity of any
programs.
9 write a program to find
the root of quadratic
equation for a given input
value and generate
(1)Boundary value test
cases

(2)Robust test cases

(3)Equivalence class test


cases

10 Write a program to find


the roots of a quadratic
equation for giving input
value to generate.

1. Flow graph
2. DD path graph
3. Independent path
4. Cyclomatic
complexity

11 Write a program to
perform mutation testing
by creating mutants.
Question (1):-
1.Write a problem statement on a suitable current topic.
Solution :- Existing System
The present system is a manual system or a semi-automated system. Manual system involves paper work in the
form of maintaining various files and manuals. Maintaining critical information in the files and manuals is full of
risk and a tedious process.
A manual system has following disadvantages
✔ It’s a limited system and fewer users friendly.

✔ Searching of particular information is critical it takes lot of time.

✔ In the existing system students need to learn course in the class room only.

✔ In the manual system student need bare the lot of time and cost.

✔ The existing system need to travel a location in which one have to participate in the course.

✔ Conduct of examination and compilation of result is a tedious process.

✔ The existing system needs to save the information in the form of files.

✔ Limited sharing is possible if the data is in the form of paper or disk drives.

✔ The manual system gives us less security for saving data, some data may be lost due to mismanagement.

Proposed System:-

As the virtual classroom is one that aims to give the student an experience equal to or better than sort they
would find in a traditional classroom. There are obviously many advantages of As the virtual classroom is one
that aims to give the student an experience equal to or better the virtual classroom to the student, as well as the
teacher and the associated educational institution.
The system after careful analysis has been identified to be presented with the following modules:
✔ Student Registration: Admin can register a student for a specific program.
✔ Video Lectures: Student can watch and listen the class room session repeatedly which will be uploaded by the
teacher.
✔ Result: Students can get the result via this web application
✔ Attendance: It includes attendance of students for a specific class.
✔ Record Storage: The user information files should be stored in centralized database which can be maintained
by the system.
✔ Authentication: Authentication of this application will be provided for only registered members.
✔ Activities for Students: The teacher can upload assignments to the students, multimedia which a student can
download and listen when required.
✔ Administration Access: Administration would be able to keep an eye on the records of students.
✔ Library: Student helping material would be available
Question (2):-
Identify the requirements from problem statement and categorize them into functional and non functional
requirements.
Solution:-
FUNCTIONAL REQUIREMENTS :
"Functional requirement describe what a system should do." Functional requirements of our system are
explained below.
✔ Users must have valid User ID and password to login thus creating their individual profiles.
✔ Administration can register new teachers.
✔ Students can choose courses.
✔ Attend lectures either at the scheduled time or view lecture later.
✔ Video lectures facility can also be available for the students.
✔ Students can check attendance, result and assignments,.
✔ Faculties can take lectures, upload assignments, announcements, compile results and also can upload lectures
and other discussions in various formats as in videos, power point presentation etc.
✔ Notice board facility can also be available for the students from administration and teachers.
✔ Notice board can also be available for the teachers from administration.
✔ Forms and guidance can also be available for the students regarding any query.
✔ There can be platform to discuss various queries and to put up suggestions posted both by students and
teachers.
✔ Documents and media library that can help in active learning of a student.
✔ Student can send any application to the administration for any query.
✔ Administration can post upcoming events banner.

NON FUNCTIONAL REQUIREMENTS :


Requirement that specifies criteria that can be used to judge the operation of a system are called non functional
requirements. Non functional requirements of our system are mentioned below
✔ Secure access of confidential data (user’s details).
✔ Maximum time availability
✔ Better component design to get efficiency at peak time.
✔ Flexible service based architecture will be desirable for furure extension.
✔ Teacher registration is accessible for administration only.

Question (3):-Prepare an SRS for the above problem statement.


Solution:-
Software Requirements
Specification

for

<Virtual Classroom System>

Prepared by:-<Sahil Kumar Singh & Mohit Kain>

Date-<5/4/2019>
Table of Contents
1.0 Introduction
1.1 Purpose
1.2 Documents conventions
-> (Not Assigned)
1.3 Intended Audience and Reading Suggestions
-> (Not Assigned)
1.4 Scope
1.5 References
1.6 Definitions,Acronyms and Abbreviations
1.7 Technologies to be used
1.8 Overview

4.0 Overall Description


2.1 Product Perspective
2.2 Product functions
2.3 User Classes and Charactertics
2.4 Operating environment
->(Not Assigned)
2.5 Design and Implementation Constraints
2.6 User Documentation
->(Not Assigned)
2.7 Assumptions and Dependencies

4.0 External Interface Requirements


4.1 User Interfaces
4.2 Software Interfaces
4.3 Hardware Interfaces
4.4 Communication Interfaces
->(Not Assigned)
3.0 System Features
3.1 System Features 1
3.2 System Features 2

5.0 Other Nonfunctional Requirements


5.1 Performance Requirements
5.2 Safety Requirements
5.3 Security Requirements
5.4 Software Quality Requirements
5.5 Business Rules ->(Not Assigned)
Software Requirements Specification

1.0 Introduction:

1.1 Purpose:

The purpose of developing this “Virtual class room system” is to keep the students and teachers connected through a
virtual platform even when they cannot reach to the physical platform. The purpose of the virtual classroom system is
to integrate the benefits of a physical classroom with the convenience of a “no­physical­bar” virtual learning
environment.It will usher in the immense flexibility and sophistication in the existing learning platform
structures,with the perfect blend of synchronous and asynchronous interaction.It provides a means of collaborative
learning for the students.

Introduction contain the following sub categories :

Existing System
The present system is a manual system or a semi-automated system. Manual system involves paper work in the
form of maintaining various files and manuals. Maintaining critical information in the files and manuals is full of
risk and a tedious process.
A manual system has following disadvantages
It’s a limited system and fewer users friendly.

Searching of particular information is critical it takes lot of time.

In the existing system students need to learn course in the class room only.

In the manual system student need bare the lot of time and cost.

The existing system need to travel a location in which one have to participate in the course.

Conduct of examination and compilation of result is a tedious process.

The existing system needs to save the information in the form of files.

Limited sharing is possible if the data is in the form of paper or disk drives.

The manual system gives us less security for saving data, some data may be lost due to mismanagement.
Proposed System :
As the virtual classroom is one that aims to give the student an experience equal to or better than sort they
would find in a traditional classroom. There are obviously many advantages of the virtual classroom to the
student, as well as the teacher and the associated educational institution.
The system after careful analysis has been identified to be presented with the following modules:
Student Registration: Admin can register a student for a specific program.
Video Lectures: Student can watch and listen the class room session repeatedly which will be uploaded by the
teacher.
Result: Students can get the result via this web application
Attendance: It includes attendance of students for a specific class.
Record Storage: The user information files should be stored in centralized database which can be maintained
by the system.
Authentication: Authentication of this application will be provided for only registered members.
Activities for Students: The teacher can upload assignments to the students, multimedia which a student can
download and listen when required.
Administration Access: Administration would be able to keep an eye on the records of students.
Library: Student helping material would be available.

Advantages for Students :


Advantages for the students are explained below
Time and Cost Saving: For students of virtual classrooms, advantages primarily concern access, time, and cost
factors compared to those incurred from attending the traditional, physical classroom.
Remove Traveling: Virtual classrooms remove the need of travel to attend the lectures.
Education at Doorstep: Our system is a platform to provide education at doorstep.

Advantages for Faculty :


Advantages for the teachers are explained below Virtual Class Room System

Flexibility for Teacher: For teachers of virtual classrooms, working part-time is a possibility because of the
flexible nature of the classroom.
Effective Communication: Another advantage to the teacher is that they have time to respond to student
communications in the virtual classroom, which gives the teacher a chance to construct the best possible
response to the student.
Independent of Location: The teacher is not required to work from an office or classroom to instruct lessons or
organize material and lessons this can be done from anywhere where they have access to a computer with an
Internet connection.
1.2 Scope:
This project has a lot of scope for future development. Developing a virtual classroom system to promote a greater
count of students to splurge into the field of Education. This Virtual Classroom System is available anytime
without any restriction that means we can access 24 hours a day. It engages students in a rich learning
experience. Data transfer rate optimization matches user connection speeds.it is real time collaboration
between a faculty and the student. It away faculties in awesome conveniences. We can share
documents, application, streaming videos and many more. It will integrate the benefits of a physical classroom with
the convenience of a ‘no-physical-bar’ virtual learning environment, minus the change hazards and expenses. This will
provide more flexibility in the existing learning platform structures. It provides a means of collaborative learning for
the students and also promotes the distance learning.

1.5 References:

http://findarticles.com/

http://en.wikipedia.org/wiki/History_of_virtual_learning_environments/ http://ezinearticles.com/

“System Analysis and Design” by Elias M. Awad


1.6 Definitions, Acronyms, and Abbreviations:

• HTML (Hyper Text Markup Language): It is used to create static web pages.

• JSP (Java Server Pages): It is used to create dynamic web content.

• J2EE (Java 2 Enterprise Edition): It is a programming platform, belonging to the


Java

platform, which is used for developing and running distributed java applications.

• HTTP (Hyper Text Transfer Protocol): It is a transaction oriented client/ server


protocol between a web browser and a web server.

• XML (Extensible Markup Language): It is a markup language that was designed


to

transport and store data.


• MySql: It is a database management system that provides a flexible and efficient
database platform to raise a strong "on demand" business applications.

1.7 Technologies to be used:

• J2EE (Java 2 Enterprise Edition): It is a programming platform, belonging to the


Java platform, which is used for developing and running distributed java
applications.

• Java: Application Architecture

• XML: Extension Markup Language.

• MySql: It is a database management system that provides a flexible and efficient


database platform to raise a strong "on demand" business applications.
1.6 Overview :

Overall Description :

Developing a virtual classroom system to promote a greater count of students to


splurge into the field of Education. It integrates the benefits of a physical classroom with the
convenience of a ‘nophysical­bar’ virtual learning environment, minus the commuting
hazards and expenses. It will usher in the immense flexibility and sophistication in the
existing learning platform structures, with the perfect blend of synchronous and
asynchronous interaction. It provides a means of collaborative learning for the students.

Specific Requirements :

Users of the System :


A. Students
B. Faculties
C. College Management (Dean, HODs,
Principal)
D. Administrator

E. Students :

• Students can choose courses, attend lectures, take exams, view their attendance
records, progress reports etc as per their convenience.

• Registration for multiple courses.

• Attend lectures either at the scheduled time or on request view lecture at a later
time.

• There can be forums, blogs etc to discuss various queries and to put up suggestions
posted both by students and teachers.

• Students can take up various quizzes which can help them to realize their inbuilt
talents in various fields.
Faculties :

• Faculties can take lectures, upload assignments, announcements, evaluate answer


sheets and also can upload lectures and other discussions in various formats as in
videos, power point presentation etc.

• Upload and Download of various assignments, college notices, student's notices,


journals, videos.

• There can be forums, blogs etc to discuss various queries and to put up suggestions
posted both by students and teachers.

Administrator :

• Administrator can generate reports, log files, backup/recovery of data at any time
and create user,department and courses.

Dean :
• Can view all actors details
2.0 Overall Description :

2.0 Product Perspective :


The virtual classroom system promotes a greater count of students and minus the
communicating hazards and expenses.

2.1 Product Function :


• Only Registered users can access the courses.
• Users must have valid User id and Password to access the system

2.3 User Characteristics :

Each User has a valid user name ,passwd ,User id ,which department he/she belongs
,duration
(in years) ,Age ,Grade ,User Role,etc....

2.4 Operating Environment->(Not Assigned)

2.5 Design and Implementation Constraints:

Architecture Design :

Implementation Constraints:

Hardware Constraints:
The system requires a database in order to store persistent data. The database
should have
backup capabilities.
Software Constraints:
The development of the system will be constrained by the availability of required
software such
as web servers, database and development tools.The availability of these tools will
be governed by the
Adithya Institute of Technology and Management.

2.6 User Documentation->(Not Assigned)

2.7 Assumptions and Dependencies :

Although basic password authentication and role based security mechanisms will be used
to
protect OPMS from unauthorised access; functionality such as email notifications are
assumed to be
sufficiently protected under the existing security policies applied by the University
network team.
Redundant Database is setup as the role of backup Database Server when primary
database is failure.
3.0 EXTERNAL INTERFACE REQUIREMENTS:

3.1. User Interface :

The application that will be developing will have a


user friendly and menu based interface.

Following screens will be provided:


 A login screen for entering the username and password,
so that the authorized user can have an access without any
problems.
 There will be a screen which will be displaying the major
tasks that the system will be performing i.e. view faculty
achievements, view student course, view assignments,
view exam schedule, view exam result, chat room details.
 All the major tasks mentioned above will have their
separate forms and will perform the desired actions.

3.2. Software Interface :

 Operating System : Windows XP or Higher Version


 User Interface : Html/CSS
 Client Side Scripting : Java Script
 Programming Language : Java
 Web Application : Jdbc, Servlet and Jsp
 IDE : My Eclipse 8.0
 Database: Oracle 10g
 Server Deployment : tomcat 5.x

3.3. Hardware Interface :

 Intel Pentium IV or Higher processor


 1.80 GHz
 GB of RAM

Deployment:
->Operating System Server: Window 8, Linux, UNIX

3.4. Communication Interfaces->(Not Assigned)


4.0 SYSTEM FEATURES
4.1 SYSTEM FEATURES 1:

4.1.1 FUNCTIONAL REQUIREMENTS:

"Functional requirement describe what a system should do”. Functional requirements of


our system are explained below.
 Users must have valid User ID and password to login thus creating their individual
profiles.
 Administration can register new teachers.
 Students can choose courses.
 Attend lectures either at the scheduled time or view lecture later.
 Video lectures facility can also be available for the students.
 Students can check attendance, result and assignments,.
Faculties can take lectures, upload assignments, announcements, compile results
and also can upload lectures and other discussions in various formats as in
videos, power point presentation etc.
 Notice board facility can also be available for the students from administration
and teachers.
 Notice board can also be available for the teachers from administration.
 Forms and guidance can also be available for the students regarding any query.
 There can be platform to discuss various queries and to put up suggestions posted
both by students and teachers.
 Documents and media library that can help in active learning of a student.
 Student can send any application to the administration for any query.
 Administration can post upcoming events banner.

4.1.2 NON FUNCTIONAL REQUIREMENTS :

Requirement that specifies criteria that can be used to judge the operation of a system
are called non functional requirements. Non functional requirements of our system are
mentioned below
 Secure access of confidential data (user’s details).
 Maximum time availability
 Better component design to get efficiency at peak time.
 Flexible service based architecture will be highly desirable for future extension.
 Teacher registration facility is accessible by administration only.
4.2 SYSTEM FEATURES 2:

4.2.1 DISADVANTAGES OF EXISTING SYSTEM:

1. Not User Friendly: The existing system is not user friendly because the retrieval of is
very slow and data is not maintained efficiently. User in term administrator, faculty and
student.
2. Not Useful For E Learning Student: those student who want to continue their study
after graduation along with job can’t get any benefit because they have to attend the
class regularly.
3. Difficulty in report generating: We require more calculations to generate the report so
it is generated at the end of the session. And the student not get a single chance to
improve their attendance
4. Manual control: All calculations to generate report are done manually so there is
greater chance of errors.
5. Lots of paperwork: Existing system requires lot of paper work. Loss of even a single
register/record led to difficult situation because all the papers are needed to generate the
reports.
6. Time consuming: Every work is done manually so time is consumed.

4.2.2 CHARACTERISTICS OF PROPOSED SYSTEM:

Following characteristics can be summarized:


1. User Friendly: - The proposed system is use friendly because the retrieval and storing
of data is fast and data is maintained efficiently.Moreover the graphical user interface is
provided in the proposed system, which provides user to deal with the system very easily.
2. Very Useful for E learning Student: those student who are very poor in economic or
those who work in daytime can learn their course through internet from anywhere. There
is no need to present physically that’s why name of the paper is virtual classroom system
and there is no restriction (NR).
3. Reports are easily generated: Reports can be easily generated in the proposed system
so user can generate the report as per the requirement (monthly) or in the middle of the
session. User can give the notice to the students so he/she become regular.
4. Very less paper work: The proposed system requires very less paper work. All the data
is feted into the computer immediately and reports can be generated through computers.
Moreover work becomes very easy because there is no need to keep data on papers.
5. Computer operator control: There is no chance of errors. Moreover storing and
retrieving of information is easy.
4.2.3 ADVANTAGES OF PROPOSED SYSTEM:
1. This project can be highly beneficial for students for students who want to continue
their study from e learning programmes.
2. Regular student can check their attendance so that they get an alert for future class.
3. The ease of operation makes any user to carry out the required operation.
4. Time saving process.
5. Reduces the work load of the user.
6. Single administrator is enough to carry out
all the tasks.
7. Data is secured.

5.0 OTHER NONFUNCTIONAL REQUIREMENTS:

5.1 Performance requirements:

The proposed system that we are going to develop will be used as the Chief performance
system for help to the department in managing the whole database of the student
studying in the department. Therefore, it is expected that the database would perform
functionally all the requirements that are specified.

1. The system should be easy to handle.


2. System should give expected performance
results.
3. The response time should be small.

5.2 Security Requirements:

1. We are going to develop a secured database. There are different categories of users
namely
Administrator, Students, Restricted users who will be viewing either all or some specific
information from
the database.
2. Depending upon the category of user the access rights are decided. It means if the user
is an administrator then he can be able to modify the data,append etc. All other users
only have the rights to retrieve the information about database.
5.3 Safety Requirements:

The database may get crashed at any certain time due to virus or operating system
failure. Therefore, it is
required to take the database backup

5.4 Software Quality Attributes:

1. The application is easy to interact and communicate with user.


2. This application provides better user interface for ease of working.

5.5 Business Rules->(Not Assigned)

6.0 OTHER REQUIREMENTS:

6.1 FUTURE ENHANCEMENTS:

It is not possible to develop a system that makes all the


requirements of the user. User requirements keep changing as
the system is being used. Some of the future enhancements
that can be done to this system are:
 As the technology emerges, it is possible to upgrade the system.
 Security can be improved using emerging technologies.
 Sub admin module can be added.
 An in-built web browser can be added.

6.2 CONCLUSION:

Hence In this paper, we have done:


 Reduction of entry work.
 Easy retrieval of information
 Reduced errors due to human intervention
 User friendly screens to enter the data
 Portable and flexible for further enhance.
 Web enabled.
6.3 Specific Requirements:

Use Case Reports->

Administrator: Responsible for managing all the three types of users, viewing logs and
managing standard groups of the system.
· Manage System users:The Administrator will provide the system students,faculties and
dean the authentication to use the site.
· View Logs:Responsible for checking the logs of different system user for auditing and
maintaining the integrity of the system.
· System Reports:The Administrator is responsible to generate the system reports for the
future reference.
· View All Details:View the user’s details,Chatting Details,forum details and mark records.
· Back Up Date:The Administrator is responsible to back up all the data at a particular time
everyday.

Manage System Users:


Name of the Use Case:View Systems users
Description: View the list of system users in the role and view the details of roles,tasks
and permissions assigned to the users.
Preconditions:
· Administrator is already logged in.
· Users have already been created and assigned some roles,tasks and permissions.

Normal Flow Of Events:


¨ The system user or the role will be selected.
¨ Query will be submitted.
¨ Relevant output will be displayed.
Alternate Flow Of Events: None
Post Condition: None

6.4 Supplementary Requirements:

• Have Hours of Operation that are 24*7:Because System Can be authenticated it


can stay open for 24 hours a day.
• Reduce the cost of sales transaction:To the extend one can automate the sales
process through this system ,one can start to reduce the sales of that sales
transaction.
• Make the existing website more Dynamic in nature:Many early web
implementation consisted of static HTML pages.This because it becomes difficult
to manage if the number of pages get too large.Application should serve dynamic
user based customized web pages to its client from server.
• Tie the existing website into the existing enterprise system:Any existing website
that relies from the manual duplication of data from another system is one that
can be improved.

6.5 APPLICATIONS:

1. This Project will be used for Our Institute.


2. After some modifications, other colleges can use this project to interact with faculty,
student and courses.
Question(4):-Construct an entity relationship diagram with all mapping
cardinalities,strong entities,weak entities and attributes of entities.

Solution:-ER DIAGRAM
Question(5):- Construct a context,level-1 and level-2 data flow diagrams for the above
problem statements. Explain the symbols used.
Solution:- Context Level Diagram

Level-1 DFD For Student


Level-1 DFD for Admin
Level-1 DFD For Faculty
Level-2 DFD for Admin

Level-2 DFD for Student


Level-2 DFD for Faculty

Question(6):- Write a program to estimate the metrics of a project


i. Function points.
Solution:
#include<iostream>
using namespace std;
class FP
{ int low;
int average;
int high;
static int UFP;
public:
FP();
void getdata();
static int get_UFP();
};
int FP::UFP = 0;
FP::FP()
{ low = 0;
average = 0;
high = 0;
}
int FP::get_UFP()
{ return UFP; }
void FP::getdata()
{ int temp;
cout << "Enter the functional complexity values:" << endl;
cout << "Low: ";
cin >> low;
cout << "Average: ";
cin >> average;
cout << "High: ";
cin >> high;
cout << "Enter the number of inputs: " << endl;
cout << "Low inputs: ";
cin >> temp;
cout << "Average inputs: ";
cin >> temp;
cout << "High inputs: ";
cin >> temp;
UFP += low * temp;
UFP += average * temp;
UFP += high * temp;
}
int main()
( FP ilf, eif, ei, eo, eq;
float CAF;
cout << "Calculating undajusted function point" << endl;
cout << "Enter data for ILF: " << endl;
ilf.getdata();
cout << "Enter data for EIF: " << endl;
eif.getdata();
cout << "Enter data for EI: " << endl;
ei.getdata();
cout << "Enter data for EO: " << endl;
eo.getdata();
cout << "Enter data for EQ: " << endl;
eq.getdata();
cout << "Enter the value of CAF now: ";
cin >> CAF;
cout << "Function point is: "<< FP::get_UFP() * CAF << endl;
}
ii. Basic COCOMO Model
Solution:
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
static const string project_types[3] = {
"Organic",
"Semi-detached",
"Embedded"
};
static const float constants[3][4] = {
{ 2.4, 1.05, 2.5, 0.38 },
{ 3.0, 1.12, 2.5, 0.35 },
{ 3.6, 1.2, 2.5, 0.32 }
};
int main()
{ double kloc, a, b, c, d, effort, dev_time, people_req;
int i;
cout << "Enter the size of your project, in kloc: ";
cin >> kloc;
for (i = 0; i < 3; ++i) {
a = constants[i][0];
b = constants[i][1];
c = constants[i][2];
d = constants[i][3];
effort = a * pow(kloc, b);
dev_time = c * pow(effort, d);
people_req = effort / dev_time;
cout << project_types[i] << endl;
cout << "Effort: " << effort << " person-months." << endl;
cout << "Development Time: " << dev_time << " months" << endl;
cout << "People Required: " << people_req << endl;
cout << "------------------------------" << endl; }
return 0; }
Question (7):-Construct use case diagrams diagrams for the above problem statement
with include and exclude relationships.
Solution:-
Use Case Model Description:
Definitions:
A Use Case specifies the behavior of a system or a part of the system and is a description
of a set of sequences of actions, including variants, which a system performs to yield an
observable result of value to an actor. Use cases provide a way for the developers to
come to a common understanding with the system's end users and domain experts.
Graphically, a use case is rendered by an ellipse. A Use Case diagram is just a special kind
of diagram and shares the same common properties as do all other diagrams – a name
and graphical contents that are a projection into a model. In a use case diagram, there is a
system boundary and the actors stay outside the boundary and the use cases are kept
inside the boundary.
Use Case diagrams commonly contain->
• Use cases
• Actors
• Dependency, generalization, and association relationships
Diagram:
Ques no- 8 Write a program to compute cyclomatic complexity of any programs.
Solution:-program
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define MAX 10

void main()
{
FILE *fp;
int row,col,i,j,edges,nodes;
char ch;
int mat[MAX][MAX];

clrscr();

fp=fopen("matrix.txt","r");

row=col=0;

while(fscanf(fp,"%c",&ch)!=EOF)
{
if(ch==' ')
col++;
else if(ch=='\n')
{
row++;
col=0;
}
else
mat[row][col]=ch-48;
}

fclose(fp);
printf("\nThe given adjacency matrix is : \n");

for(i=0;i<=row;i++)
{
for(j=0;j<=col;j++)
printf("%d\t",mat[i][j]);
printf("\n");
}

nodes=row+1;
printf("\nNumber of nodes = %d",nodes);

edges=0;

for(i=0;i<=row;i++)
{
for(j=0;j<=col;j++)
{
if(mat[i][j]==1)
edges++;
}
}
printf("\nNumber of edges = %d",edges);
printf("\n\nCyclometic Complexity of graph = edges-nodes+2p\n");
printf("\t\t\t\t= %d - %d + 2",edges,nodes);
printf("\n\t\t\t\t= %d",edges-nodes+2);

getch();
}

Ques no-9 write a program to find the root of quadratic equation for a given input
value and generate
I) Boundary value test cases
II) Robust test cases
III) Equivalence class test cases
Write a program in C/C++ to find the root of a quardatic equaltion and perform the
following on it: Boundary Value Analysis (BVA).

Consider the program for the determination of nature of roots of a quadratic equation.
Its input is a triple of postive intergers a,b,c and values may be from interval [0,100].
The program output may have one of the following words: Not a QE, Real Roots,
Imaginary Roots or Equal Roots.

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
cout<<"The Quadratic equation is of the type a(x^2)+bx+c=0"<<endl;
cout<<"Enter the value of a: "<<endl;
cin>>a;
cout<<"Enter the value of b: "<<endl;
cin>>b;
cout<<"Enter the value of c: "<<endl;
cin>>c;
d=(b*b)-4*a*c;
if((a<0)||(b<0)||(c<0)||(a>100)||(b>100)||(c>100))
cout<<"Invalid input"<<endl;
else if(a==0)
cout<<"Not a quadratic equation"<<endl;
else if (d==0)
cout<<"Roots are equal"<<endl;
else if(d<0)
cout<<"Imaginary roots"<<endl;
else
cout<<"Real Roots"<<endl;
getch();
}

Output of the above program:

The quadratic equation is of the type a(x^2) +bx +c = 0


Enter the value of a:
50
Enter the value of b:
50
Enter the vaule of c:
0
Real roots
The quadratic equation is of the type a(x^2) +bx +c = 0
Enter the value of a:
50
Enter the value of b:
50
Enter the vaule of c:
50
Imaginary roots

The quadratic equation is of the type a(x^2) +bx +c = 0


Enter the value of a:
10
Enter the value of b:
40
Enter the vaule of c:
40
Roots are equal

The quadratic equation is of the type a(x^2) +bx +c = 0


Enter the value of a:
0
Enter the value of b:
50
Enter the vaule of c:
50
Not a quadratic equation

Boundary Value analysis: The basic idea of boundary value analysis is to use input
variable at their manimum, just above manimum, normal value, just below maximum
and maximum.

In this program, we consider the value as 0 (minimum), 1(just above minimum), 50


(normal), 99 (just below maximum) and 100 (maximum).

Test case ID a B c Expected


output
1. 50 50 0 Real roots
2. 50 50 1 Real roots
3. 50 50 50 Imaginary roots
4. 50 50 99 Imaginary roots
5. 50 50 100 Imaginary roots
6. 50 0 50 Imaginary roots
7. 50 1 50 Imaginary roots
8. 50 99 50 Imaginary roots
9. 50 100 50 Equal roots
10. 0 50 50 Not a QE
11. 1 50 50 Real roots
12. 99 50 50 Imaginary roots
13. 100 50 50 Imaginary roots

write a program in C\C++ to find the area of a Triangle, Square, Rectangle and a Circle.
Perform Equivalence class testing on it.

#include<iostream.h>
#include<conio.h>
#include<process.h>
void main()
{
clrscr();
int ch;
char c;
float b,h,a;
1: cout<<"Enter your choice";
cout<<"\n 1. Triangle";
cout<<"\n 2. Square";
cout<<"\n 3. Rectangle";
cout<<"\n 4. Circle";
cout<<"\n 5. Exit\n";
cin>>ch;
switch(ch)
{
case 1: b: cout<<"\Enter the base of the triangle (1-200)";
cin>>b;
if((b<=0)||(b>200))
{
cout<<"\n Invalid entry for base \n";
goto b;
}
h: cout<<"\n Enter the height of the triangle (1-200)";
cin>>h;
if((h<=0)||(h>200))
{
cout<<"\n Invalid height\n Enter the valid height (1-200)";
goto h;
}
a= 0.5*b*h;
cout<<"\n The area is : "<<a;
cout<<"\n Want to enter more?(y/n)";
cin>>c;
if((c=='y')||(c=='y'))
goto 1;
break;
case 2 : s: cout<<"\n Enter the side of the squre (1-200)";
cin>>b;
if((b<=0)||(b>200))
{
cout<<"\n Invalid entry for base \n";
goto s;
}
a=b*b;
cout<<"\n The area is :"<<a;
cout<<"\n Want to enter more?(y/n)";
cin>>c;
if((c=='y')||(c=='y'))
goto 1;
break;
case 3: d: cout<<"\n Enter the Base of the rectangle (1-200)";
cin>>b;
if((b<=0)||(b>200))
{
cout<<"\n Invalid entry for base \n";
goto d;
}
p: cout<<"\n Enter the height of the rectangle (1-200)";
cin>>h;
if((h<=0)||(h>200))
{
cout<<"\n Invalid Height \n Enter the height (1-200)";
goto p;
}
a=b*h;
cout<<"\n The area is :"<<a;
cout<<"\n Want to enter more?(y/n)";
cin>>c;
if((c=='y')||(c=='y'))
goto 1;
break;
case 4 : t: cout<<"\n Enter the radius of the circle (1-200)";
cin>>b;
if((b<=0)||(b>200))
{
cout<<"\n Invalid entry for radius \n";
goto t;
}
a=3.14*b*b;
cout<<"\n The area is :"<<a;
cout<<"\n Want to enter more?(y/n)";
cin>>c;
if((c=='y')||(c=='y'))
goto 1;
break;
case 5 : exit(0);
break;
default : cout<<"\n Wrong Choice:";
goto 1;
}
getch();
}

Test cases: In Equivalence class testing, we find two types of equivalence classes; input
domain and output domain;
Input domain is formed from one valid sequence and two invalid sequences. The output
domain is obtained from different types of output of a problem.

For Triagle:

Input domain:::

I1 = {h : h<=0}
I2 = {h : H>200}
I3 = {h : 1<=h<=200}
I4 = {b : b<=0}
I5 = {b : b>200}
I6 = {b : 1<=b<=200}

Test cases:
Test case ID h b Expected output
1. 0 100 Invalid input
2. 100 100 5000
3. 201 100 Invalid input
4. 100 0 Invalid input
5. 100 100 5000
6. 100 201 Invalid input

Output domain:::

O1 = {<h,b> : triangle in h > 0,b>0}


O2 = {<h,b> : Not a triangle if h<=0, b<=0}

Output screen shots for the triangle is:

Enter your choice:


1. Triangle
2. Square
3. Rectangle
4. Circle
5. Exit
1
Enter the base of the triangle (1 – 200) 0
Invalid entry for base
Enter the base of the triangle (1 – 200) 100
Enter the height of the triangle (1 – 200) 201
Invalid height
Enter the Height(1-200)
Enter the height of the triangle(1 – 200) 100
The area is 5000
Want to enter more? (y/n)y

For square:

Input domain:::

I1={s : s<=0}
I2={s : s>200}
I3={s : 1<=s<=200}

Test cases:
Test case ID S Expected output
1. 0 Invalid input
2. 100 10000
3. 201 Invalid input

Output domain:::

O1 = { <s> : square if s>0}


O2 = { <r> : Not a square if s<=0}

Output screen shots for the square is:

Enter your choice:


1. Triangle
2. Square
3. Rectangle
4. Circle
5. Exit
2
Enter the side of the square (1 – 200) 0
Invalid entry for side
Enter the side of the square (1 – 200) 201
Invalid entry for side

Enter the side of the square(1 – 200) 100


The area is 10000
Want to enter more? (y/n)y

For Rectangle:

Input domain:::

I1 = { l : l <=0}
I2 = { l : l>200}
I3 = { I : 1<=l <=200}
I4 = { b : b<=0}
I5 = { b : b>200}
I6 = { b : 1<=b<=200}

Test cases:

Test case ID l b Expected output


1. 0 100 Invalid input
2. 100 100 10000
3. 201 100 Invalid input
4. 100 0 Invalid input
5. 100 100 10000
6. 100 201 Invalid input

Output domain:::

O1 = {<l,b> : rectangle if l > 0,b>0}


O2 = {<l,b> : Not a triangle if l<=0, b<=0}

Output screen shots for the Rectangle is:

Enter your choice:


1. Triangle
2. Square
3. Rectangle
4. Circle
5. Exit
3
Enter the length of the rectangle (1 – 200) 0
Invalid entry for length
Enter the length of the rectangle (1 – 200) 201
Invalid entry for length
Enter the length of the rectangle(1 – 200) 100
Enter the breadth of the rectangle (1 – 200) 100

The area is 10000


Want to enter more? (y/n)y

For Circle:

Input domain:::

I1 = {r: r<=0}
I2 = {r : r>200}
I3 = { r: 1<=r<=200}

Test cases:
Test Cases r Expected output
1. 0 Invalid input
2. 100 31400
3. 201 Invalid input

Output domain:

O1 : {<r>: Circle if 1<=r<=200}


O2 : {<r>: not a circle if r<=0}

Output screen shots for the Circle is:

Enter your choice:


1. Triangle
2. Square
3. Rectangle
4. Circle
5. Exit
4
Enter the radius of the circle (1 – 200) 0
Invalid entry for radius
Enter the radius of the circle (1 – 200) 201
Invalid entry for radius
Enter the radius of the circle(1 – 200) 100
The area is 31400
Want to enter more? (y/n)y
Q-10 Write a program to find the roots of a quadratic equation for giving input value to
generate.

5. Flow graph
6. DD path graph
7. Independent path
8. Cyclomatic complexity

#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,validinput=0;
printf("Enter the side ‘a’ value");
scanf("%d",&a);
printf("Enter the side ‘b’ value");
scanf("%d",&b);
printf("Enter the side ‘c’ value");
scanf("%d",&c);
if((a>0)&&(a<100)&&(b>0)&&(b<100)&&(c>0)&&(c<100))
{
if(((a+b)>c)&&((c+a)>b)&&((b+c)>a))
{
validinput=1;
}
}
else
{
validinput=-1;
}
if(validinput==1)
{
if((a==b)&&(b==c))
{
printf("The triangle is equilateral");
}
else if((a==b)||(b==c)||(c==a))
{
printf("The triangle is isosceles");
}
else
{
printf("The triangle is scalene");
}
}
else if(validinput==0)
{
printf("The value do not constitute the triangle");
}
else
{
printf("The input belongs to invalid range");
}
getch();
return 1;
}

1. Flow Graph: It shows that how the control and data is flow from one node to
another node. The flow graph for the following program is given below:
2. DD path graph:

Flow Graph DD Path Graph Corr. Nodes Remarks


Nodes
1 to 9 A Sequential
10 B Decision
11 C Decision
12,13 D Sequential
14 E Two edges are joined here
15,16,17 F Sequentian nodes
18 G Decision nodes plus joining of two
edges
19 H Decision nodes
20,21 I Sequential nodes
22 J Decision nodes
23,24 K Sequential nodes
25,26,27 L Sequential nodes
28 M Three edges combined here
29 N Decision nodes
30,31 O Sequential nodes
32,33,34 P Sequential nodes
35 Q Three edges comibined here
36,37 R Sequential nodes with exit node

3. Independent path : It is a path in the flow graph that has at least one edge that
has not been traversed before in other path.

1. ABFGNPQR
2. ABFGNOQR
3. ABCEGNPQR
4. ABCDGINOQR
5. ABFGHIMQR
6. ABFGHJKMQR
7. ABFGHJLMQR

4. Cyclomatic complexity: To calculate the cyclomatic complexity we calculate the


following formula:
V(G) = e – n + 2P
Here : e = 23
n = 18 and
p=1
so the total no of independent paths are 23 – 18 + 2 = 7

The output for the above program is :

Enter the side ‘a’ value: 12


Enter the side ‘b’ value: 12
Enter the side ‘c’ value: 12
The triangle is Equilateral

Enter the side ‘a’ value: 45


Enter the side ‘b’ value: 45
Enter the side ‘c’ value: 23
The triangle is isosceles
Q-11 Write a program to perform mutation testing by creating mutants.

ANSWER- Mutation testing:


• Mutation testing is a technique that focuses on measuring the adequacy of test
data (or test cases).
• The original intention behind mutation testing was to expose and locate
weaknesses in test cases.
• Thus, mutation testing is a way to measure the quality of test cases, and the
actual testing of program units is an added benefit.
• Mutation testing is not a testing strategy like control flow or data flow testing. It
should be used to supplement traditional unit testing techniques.
• The mutations introduced to the source code are designed to imitate common
programming errors.
• A good unit test suite typically detects the program mutations and fails
automatically.
• Mutation testing is used on many different platforms , including Java, C++, C#
and Ruby.
• Mutation testing facilitates the following advantages :
1. Program code fault identification
2. Effective test case development
3. Detection of loopholes in test data
4. Improved software program quality
5. Elimination of code ambiguity
• Mutant: A mutation of a program is a modification of the program created by
introducing a single, small, legal, syntactic change in the code. A modified
program so obtained is called a mutant.
• Killed mutant: A mutant is said to be killed when the execution of a test case
causes it to fail and the mutant is considered to be dead.
• Equivalent mutants: Some mutants are equivalent to the given program, that is,
such mutants always produce the same output as the original program.
• Killable or stubborn mutants: The result of executing a mutant may be different
from the expected result, but a test suite does not detect the failure because it
does not have the right test case. In this scenario, the mutant is called killable or
stubborn, that is, the existing set of test cases is insufficient to kill it.
• Mutation Score :
A mutation score for a set of test cases is the percentage of non-equivalent
mutants killed by the test suite.The test suite is said to be mutation adequate if its
mutation score is 100 %.
Mutation Score is given by :
Mutation Score = 100 * D/(N-E)
Where D is the dead mutants, N is the total number of mutants and E is the
number of equivalent mutants.
• The following example illustrates the concept of mutation testing:
Program to find the greatest of three numbers:
inta,b,c ;
if( a>b && a > c)
{
System.out.println (“ The greatest number is “ +a);
}
else if ( b>c)
{
System.out.println (“ The greatest number is” +b);
}
else
{
System.out.println(“ The greatest number is “ +c);
}
The following table identifies the killed and killable mutants for the above program:
**D: NO OF MUTANTS KILLED
N: Total no of mutants
E: No.of equivalent mutants**
Mutation Score
= 100 * D/(N-E)
=100 *5/(5-0)
=100

You might also like