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

U.

V PATEL COLLEGE OF ENGINEERING


GANPAT UNIVERSITY

PRACTICAL LIST

Subject: Software Engineering


Subject Code: 2CE602/2IT602
Semester: B.Tech 6th CE/IT
Faculty: Prof. Ravi Raval, Prof. Ritesh Upadhyay
INDEX
Sr. Practical Aim Page
No. No.
1 Detailed study of various Software Development Life Cycle (SDLC) models. 1
2 Draw the Use case, Class, Activity, Sequence and state Diagram For given Case
7
Study.
3 Design Canvases for selected project definition. 8
4 Make Software requirement specification (SRS) document 11
5 To study about Structure System Analysis and Design Method (SSADM). 12
6 Study about Metrics for software project size estimation and Project Estimation techniques. 13
7 To study about software testing 16
2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical 1

Aim:- Detailed study of various Software Development Lifecycle (SDLC) Models.


Objective: To get familiar with Process Models used for software Engineering.
References: Software Engineering by Roger Pressman, Software Engineering by Ian Somerville, Software
Engineering by Rajib mall.
Pre-requisite: Knowledge of Characteristics of software process.
Summary: To solve actual problems in an industry setting, a software engineer or a team of engineers must
incorporate a development strategy that encompasses the process, methods and tools. This strategy is often
referred to as a process model or a software engineering paradigm. A process model for software engineering is
chosen based on the nature of the project and application, the methods and tools to be used, and the controls and
deliverables that are required.

1. Classical waterfall model


Block
Diagram

Description 1) Requirement Analysis & Definition: This phase is focused on possible requirements of
the system for the development are captured. Requirements are gathered subsequent to
the end user consultation.
2) System & Software Design: Prior to beginning the actual coding, it is inevitable to
understand what actions are to be taken and what they should like. The requirement
specifications are studied in detail in this phase and the design of the system is prepared.
The design specifications are the base for the implementation and unit testing model
phase.
3) Implementation & Unit Testing: Subsequent to receiving the system design
documents, the work is shared into various modules and the real coding is commenced.
The system is developed into small coding units. These units are later integrated in the
subsequent phase. Every unit is tested for its functionality.
4) Integration & System Testing: The modules that are divided into units are integrated
into a complete system and tested for proper coordination among modules and system
behaves as per the specifications. Once the testing is completed, the software product is
delivered to the customer.
5) Operations & Maintenance: It is a never ending phase. Once the system is running in
production environment, problems come up. The issues that are related to the system are
solved only after deployment of the system. The problems arise from time to time and
need to be solved; hence this phase is referred as maintenance.
Advantages  This model is simple and easy to understand and use.
 It is easy to manage due to the rigidity of the model – each phase has specific
deliverables and a review process.

CE/IT Dept., UVPCE, GNU, Kherva Page 1


2CE/IT602: Software Engineering B.Tech 5th CE/IT

 In this model phases are processed and completed one at a time. Phases do not overlap.
 Waterfall model works well for smaller projects where requirements are very well
understood.
Disadvantages  Once an application is in the testing stage, it is very difficult to go back and change
something that was not well-thought out in the concept stage.
 No working software is produced until late during the life cycle.
 High amounts of risk and uncertainty.
 Not a good model for complex and object-oriented projects.
 Poor model for long and ongoing projects.
 Not suitable for the projects where requirements are at medium to high risk of changing.
When/where  This model is used only when the requirements are very well known, clear and fixed.
to use?  Product definition is stable.
 Technology is understood.
 There are no ambiguous requirements
 Ample resources with required expertise are available freely
 The project is short.
2. Incremental Process Model
Block
Diagram

Description 1) Requirement Analysis: Requirement and specification of the software are collected
2) Design: Some high-end function are designed during this stage
3) Code: Coding of software is done during this stage
4) Test: Once the system is deployed, it goes through the testing phase
Advantages  Generates working software quickly and early during the software life cycle.
 This model is more flexible – less costly to change scope and requirements.
 It is easier to test and debug during a smaller iteration.
 In this model customer can respond to each built.
 Lowers initial delivery cost.
 Easier to manage risk because risky pieces are identified and handled during it’d
iteration.
Disadvantages  Needs good planning and design.
 Needs a clear and complete definition of the whole system before it can be broken down
and built incrementally.
 Total cost is higher than waterfall.
When to use  This model can be used when the requirements of the complete system are clearly

CE/IT Dept., UVPCE, GNU, Kherva Page 2


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Model? defined and understood.


 Major requirements must be defined; however, some details can evolve with time.
 There is a need to get a product to the market early.
 A new technology is being used
 Resources with needed skill set are not available
 There are some high risk features and goals.
3. Prototype Model
Block
Diagram

Description 1) Requirements gathering and analysis: A prototyping model begins with requirements
analysis and the requirements of the system are defined in detail. The user is interviewed
in order to know the requirements of the system.
2) Quick design: When requirements are known, a preliminary design or quick design for
the system is created. It is not a detailed design and includes only the important aspects
of the system, which gives an idea of the system to the user. A quick design helps in
developing the prototype.
3) Build prototype: Information gathered from quick design is modified to form the first
prototype, which represents the working model of the required system.
4) User evaluation: The proposed system is presented to the user for thorough evaluation
of the prototype to recognize its strengths and weaknesses such as what is to be added or
removed.
5) Refining prototype: Once the user evaluates the prototype and if he is not satisfied, the
current prototype is refined according to the requirements.
6) Engineer product:The final system is evaluated thoroughly followed by the routine
maintenance on regular basis for preventing large-scale failures and minimizing
downtime.
Advantages  Users are actively involved in the development
 Since in this methodology a working model of the system is provided, the users get a
better understanding of the system being developed.
 Errors can be detected much earlier.
 Quicker user feedback is available leading to better solutions.
 Missing functionality can be identified easily
 Confusing or difficult functions can be identified Requirements validation, Quick
implementation of, incomplete, but functional, application.
Disadvantages  Leads to implementing and then repairing way of building systems.
 Practically, this methodology may increase the complexity of the system as scope of the
system may expand beyond original plans.
 Incomplete application may cause application not to be used as the full system was
designed Incomplete or inadequate problem analysis.
When to use  Prototype model should be used when the desired system needs to have a lot of

CE/IT Dept., UVPCE, GNU, Kherva Page 3


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Model? interaction with the end users.


 Typically, online systems, web interfaces have a very high amount of interaction with
end users, are best suited for Prototype model. It might take a while for a system to be
built that allows ease of use and needs minimal training for the end user.
 Prototyping ensures that the end users constantly work with the system and provide a
feedback which is incorporated in the prototype to result in a useable system. They are
excellent for designing good human computer interface systems.
4. Spiral Model
Block
Diagram

Description Planning Phase: Requirements are gathered during the planning phase.
1)
Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk and
2)
alternate solutions. A prototype is produced at the end of the risk analysis phase. If any
risk is found during the risk analysis then alternate solutions are suggested and
implemented.
3) Engineering Phase: In this phase software is developed, along with testing at the end
of the phase. Hence in this phase the development and testing is done.
4) Evaluation phase: This phase allows the customer to evaluate the output of the project
to date before the project continues to the next spiral.
Advantages  High amount of risk analysis hence, avoidance of Risk is enhanced.
 Good for large and mission-critical projects.
 Strong approval and documentation control.
 Additional Functionality can be added at a later date.
 Software is produced early in the software life cycle.
Disadvantages  Can be a costly model to use.
 Risk analysis requires highly specific expertise.
 Project’s success is highly dependent on the risk analysis phase.
 Doesn’t work well for smaller projects.
When to use  When costs and risk evaluation is important
Model?  For medium to high-risk projects
 Long-term project commitment unwise because of potential changes to economic
priorities
 Users are unsure of their needs
 Requirements are complex
 New product line

CE/IT Dept., UVPCE, GNU, Kherva Page 4


2CE/IT602: Software Engineering B.Tech 5th CE/IT

 Significant changes are expected (research and exploration)


5. Rapid Application Process Model
Block
Diagram

Description 1) Requirement Planning: To collect the all requirements.


2) User Description: To join team of user and developers to give reviews, changes the
requirement.
3) Construction: Design+Implementation+Testing
4) Cutover: To install the software. User training will be done in this phase.
Advantages  Reduced development time.
 Increases reusability of components
 Quick initial reviews occur
 Encourages customer feedback
 Integration from very beginning solves a lot of integration issues.
Disadvantages  Depends on strong team and individual performances for identifying business
requirements.
 Only system that can be modularized can be built using RAD
 Requires highly skilled developers/designers.
 High dependency on modeling skills
When to use  RAD should be used when there is a need to create a system that can be modularized in
model? 2-3 months of time.
 It should be used if there’s high availability of designers for modeling and the budget is
high enough to afford their cost along with the cost of automated code generating tools.

LAB Assignment:
1).Write one example of software project that would be amenable to the classical waterfall model.
ANS:______________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________

2) What is the difference between incremental process model and evolutionary process model?
# Incremental Process Model Evolutionary Process Model
1

CE/IT Dept., UVPCE, GNU, Kherva Page 5


2CE/IT602: Software Engineering B.Tech 5th CE/IT

3) Which model is more suitable for your mini project? Why?


Ans:_______________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
_________________________________________________________________________________________
4) State the parameters to choose suitable life cycle model for any system.
Ans:_______________________________________________________________________________________
__________________________________________________________________________________________
_________________________________________________________________________________________

5) Which life cycle model is/are widely used in software industry nowadays?
Ans:_______________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
_________________________________________________________________________________________
6). Give the comparison of all life cycle models with the options given.

Properties of Model Water-Fall Incremental Spiral Model Rad Model


Model Model
Planning in early stage
(Yes/No)
Returning to an earlier phase
(Yes/No)
Handle Large-Project
(Yes/No)
Requirement Specifications
Beginning/Intermediate/last)
Cost
(Cost-effective/expensive)
Flexibility to change
(Easy/difficult)
Duration
(Short/long/very long)

CE/IT Dept., UVPCE, GNU, Kherva Page 6


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical 2

Aim: Draw the Use case, Class, Activity, Sequence and state Diagram For given Case
Study.
1. Book Store in Shopping Mall.
Consider a book store in a shopping mall. The customer selects the books from racks to purchase. The
customer brings selected books to cashier. The cashier scans each item with checkout system to prepare an
order. The cashier requests to customer for payment. The customer gives credit card to cashier. The verifier
and checkout system scans the card. The verifier accepts the card and payment is accepted. Customer signs
the credit card slip. The purchased books are handed over to customer.

2. Hospital Management System


Hospital management system helps in registering information about patients and handles patient’s query. A
unique ID is generated for each patient after registration. This helps in implementing customer relationship
management and also maintains medical history of patient. This system also monitors the doctor
appointments, when the ID is generated the patients receives the appointment time and number from the
receptionist and accordingly visit the doctor. This system also deals with testing appointments as and when
ID is generated the patient receives the appointment time and number and accordingly undergoes the test. It
also deals with bed allotments to various patients by checking their ID. It also undergoes various operations
by diagnosing the patients. The systems identifies whether the person is a doctor or staff and handles various
activities such as draw salary and give salary, also it adds doctor/staff information into database. This system
is responsible for handling various other activities like deleting, editing doctor/staff information into the
database. As per doctor diagnoses the patient, gives treatment and gives suggestions to patients and prescribe
laboratory tests and medicines. This system also takes care of medical equipment, doctor visit, vitals
recording, patient case sheet, diet ordering, blood requisition, transfer information and discharge information,
maintenance of wards, inter and intra wards transfers also it generates patient’s discharge summary which
includes patients health at the time of discharge, medical history, various diagnosis and drug prescriptions,
history of patients illness and course in hospital. Patient can pay bill through credit card, cash or Cheque
whose information is maintained by this system

3. Retail Store Management


The Retail Store Management System is a system designed for managing i.e. for ordering, arranging and
selling goods. The Retailer checks for the availability of goods in the store. If the stock of goods is less then
retailer places order for goods. While ordering the goods, goods area received at store, the retailer then
arranges them by product or by price, and then retailer makes payment. If the stock of goods is available then
he will arrange goods for selling. The retailer then sales the goods directly to the customer. The customer
buys the items from retailer. The retailer prepares bill for goods purchased by the customer, he receives
amount by credit or by cash from customer. The supplier supplies the goods to the store in the system. The
overall system is used to manage the goods in the store.

CE/IT Dept., UVPCE, GNU, Kherva Page 7


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical-3

Aim: To make Design Canvases for the software project


Objective: To get familiar with Design Engineering canvases used for any project development plan.
References: http://de.gtu.ac.in
Pre-requisite: Knowledge of Characteristics of software process.
Summary: Design thinking gives students a taste of the rich internal-remunerations associated with knowledge-
creation and in curiosity and problem-driven contexts. Design need to satisfy technical functions, ergonomics
functions, aesthetic functions, cost function and environment functions.

Instructions to students:

1) Make a group of maximum 4 students per group.


2) Select any unique topic for your project. The project must be unique. Register your title to your lab faculty.
3) Prepare the canvas for your selected project.

# Project Definitions # Project Definitions


1 Library Information System 31 Online bookstore
2 Library Management System 32 Gujarati literature and magazines
3 Villager telephone system 33 Online banking (Net Banking)
4 Waste Management Inspection tracking system 34 SMS Banking
5 Flight control system 35 Banking
6 Ambulance dispatching system 36 Spam Caller and Sms App
7 Hospital management system 37 Data loss and recovery
8 Academic timetable management system 38 Website builder and hosting
9 Student Management System 39 File hosting
10 Social networking Site 40 Online liquor service
11 Social networking for photos and videos only 41 Stock / inventory management
12 Environment and seismic engineering site 42 Investigative agency (FBI/CBI/CIA/MI) web portal
13 LAN Gamming 43 Indian Army
14 File sharing over Bluetooth app 44 Indian Air force
15 File sharing over wifi app 45 Indian Navy
16 LAN Chatting software 46 Ministry of human resource development
17 Bulk File sharing over wifi software 47 Software solution company
18 Online food delivery 48 Ice cream company
19 Online fuel delivery 49 Plumber, Electrician, Carpenter Near me (easyfix)
20 Online shopping 50 Maps and navigation
21 E-Mall online 51 Online Job portal
22 Online automobiles 52 Matrimonial service website
23 Online automobile spare parts and service 53 Online video hosting (like youtube)
24 Bio seeds and fertilizer service 54 Encyclopaedia
25 Krushi vikas Kendra 55 Search engine
26 Online dating 56 National Centre for missing and exploited children
27 Online spam and Fraud detection 57 Train enquiry management system
28 Enterprise resource planning 58 Gujarat State Road Transport tracking system
29 Leave management system for any Organization 59 Online hotel searching (trivago)
30 Online attendance management system 60 Anti-piracy campaign

CE/IT Dept., UVPCE, GNU, Kherva Page 8


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Students have to take printout of these blank canvases in A3 size paper only.

# Canvas Canvas Image


Name (Uploaded over intranet)
1 AEIOU
Summary
canvas

2 Empathy
Mapping
canvas

CE/IT Dept., UVPCE, GNU, Kherva Page 9


2CE/IT602: Software Engineering B.Tech 5th CE/IT

3 Ideation
Canvas

4 Product
Development
(PD) canvas

CE/IT Dept., UVPCE, GNU, Kherva Page 10


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical-4

Aim: Study about Software Requirement Specification (SRS)


Objective: To get familiar with Software Requirements of User and to explain how software
requirements may be organised in a requirements document

References: Software Engineering by Roger Pressman, Software Engineering by K.K. Aggarwal, Software
Engineering by Rajib mall.

Pre-requisite: Knowledge of Requirement Gathering Process (Requirement Elicitation, Requirement Analysis,


Requirement Document and Requirement Review).

Summary: Requirements are descriptions of the services that a software system must provide and the
constraints under which it must operate. Requirements can range from high-level abstract statements of services
or system constraints to detailed Mathematical functional specifications. Requirements Engineering is the
process of establishing the services that the customer requires from the system and the constraints under which it
is to be developed and operated. Requirements Documents: “If a company wishes to let a contract for a large
software development project it must define its needs in a sufficiently abstract way that a solution is not
predefined. The requirements must be written so that several contractors can bid for the contract, offering,
perhaps, different ways of meeting the client organization’s needs. Once a contract has been awarded, the
contractor must write a system definition for the client in more detail so that the client understands and can
validate what the software will do. Both of these documents may be called the requirements document for the
system or Software Requirement Specification (SRS)”.

NOTE: SRS Templates and Examples are available in SE Practical list (see the link).

Practical: Develop the SRS on previously selected topic using SRS Template for following System in Group.

CE/IT Dept., UVPCE, GNU, Kherva Page 11


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical-5
Aim: To study about Structure System analysis and Design method (SSADM).
Objective: To get familiar with Structure Approach Method and learn various Techniques of SSADM to
model a System.
References: Software Engineering by Roger Pressman, Software Engineering by K.K. Aggarwal, Software
Engineering by Rajib mall.
Pre-requisite: Knowledge of Data Modeling, Functional Modeling.
Summary: Structured Systems Analysis and Design Methodology (SSADM) is a systems approach to the
analysis and design of information systems. SSADM uses a combination of three techniques:
Logical Data Modeling, Data Flow Modeling, and Entity Behavior Modeling. System analysis is
major focus on “what” the system is accomplished, not how. SSADM use the various Modeling
tools for represent the data flows, processing and data store like data flow diagrams, data
dictionary, process specification, entity-relationship diagrams.
NOTE: DFD Manual is available in SE Practical list (see the link).
Practical: Draw the Context Level Diagram (CLD) and Data Flow Diagram (DFD) (Level – 0 & Level -
1) for given Systems.

Problem:
1) Online Library Management System (LMS).
2) Online Airline Reservation System (ARS).
3) Online Railway Reservation System (RRS).
4) Online Video Library Management System (VLMS).

Lab Assignment:
(1) Write the difference between CLD and DFD
Ans:_______________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
_________________________________________________________________________________________
(2) Discuss various notations of DFD and DFD rules
Ans:
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________

Symbol Meaning Example

CE/IT Dept., UVPCE, GNU, Kherva Page 12


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical-6

Aim: Study about Metrics for software project size estimation and Project Estimation
techniques.
Objective: To get familiar with Project Estimation Techniques of Software Engineering.
Summary: Accurate estimation of the problem size is fundamental to satisfactory estimation of effort, time
duration and cost of a software project. In order to be able to accurately estimate the project size, some important
metrics should be defined in terms of which the project size can be expressed. The size of a problem is obviously
not the number of bytes that the source code occupies. It is neither the byte size of the executable code. The
project size is a measure of the problem complexity in terms of the effort and time required to develop the
product. Currently two metrics are popularly being used widely to estimate size: lines of code (LOC) and
function point (FP). The usage of each of these metrics in project size estimation has it s own advantages and
disadvantages.
Estimation of various project parameters is a basic project planning activity. The important project
parameters that are estimated include: project size, effort required to develop the software, project duration, and
cost. These estimates not only help in quoting the project cost to the customer, but are alsouseful in resource
planning and scheduling. There are three broad categories of estimation techniques: Empirical estimation
techniques, Heuristic techniques, Analytical estimation techniques.

NOTE: Perform the following Examples and Write your Answer in Precise format.
Example-1: Consider a project with the following functional units:
User inputs User outputs User enquiries User files External interfaces
Number of 25 20 45 10 08
Assume all Technical Complexity Factor and weighting factors are average. Compute the function points for the
project.
Low Average High
Input 3 4 6
Output 4 5 7
Inquiry 3 4 6
Internal Logical File 7 10 15
External Logical File 5 7 10

Example-2: An application has the following:


low external inputs = 12
high external outputs = 23
low internal logical files = 25
high external interface files = 35
average external inquiries = 10,
a value of complexity adjustment factor or TCF = 1.32.
What are the unadjusted and adjusted function point counts?
Example-3: Consider a project with the following parameters.

Low Average High


External Inputs 11 13 14
External Outputs 8 - 18
External Inquiries 8 9 4
Internal logical files - 4 3
External interface files 15 - -

CE/IT Dept., UVPCE, GNU, Kherva Page 13


2CE/IT602: Software Engineering B.Tech 5th CE/IT

In addition to above, system requires


i. Significant data communication
ii. Performance is very critical
iii. Designed code may be moderately reusable
iv. System is not designed for multiple installations in different organizations.
Other complexity adjustment factors (TCF) are treated as average. Compute the function points for the project.

Example-4: Considering your immense expertise in software development, The Absolute Beginners Inc. has
recently allotted you a mega project. The goal of the project is to create a database of all Hindi films released
since 2000. The software would allow one to generate a list of top ten hit films, top ten flop films, best comedy
films, and so on. Using your prior experience you have decided the approximate sizes of each module of the
software as follows:
 Data entry (0.9 KLOC)
 Data update (0.7 KLOC)
 Query (0.9 KLOC)
 Report generation and display (2 KLOC)

Also take into consideration the following cost drivers with their ratings:
 Storage constraints (Low)
 Experience in developing similar software (High)
 Programming capabilities of the developers (High)
 Application of software engineering methods (High)
 Use of software tools (High)
(All other cost drivers have nominal rating).

Now answer the following:


 Applying intermediate COCOMO estimate the minimum size of the team you would require developing this
system.
 Assuming that your client would pay Rs. 50,000 per month of development, how much would be the likely
billing?
Learning Objectives:
1. Identify type of a project as per COCOMO
2. Prepare an estimate of required effort and cost
Limitations: Values presented here are arbitrary and doesn't relate to real life
Example-5 (Analytical Technique-Halstead Software Science)

Example 5: Identify the unique operators and operands from the following snippet of code:
int x,y, sum;
main(int argc, char **argv)
{
int x = 10;
int y = 20;
sum = x + y;

printf("Sum of %d and %d is: %d\n", x, y, sum);


return 0;
}

Calculate the following based on unique operators and operands


1. Programming length (N)
2. Program Volume (V)
3. Potential Minimum Volume (V*)
4. Program Level (L)

CE/IT Dept., UVPCE, GNU, Kherva Page 14


2CE/IT602: Software Engineering B.Tech 5th CE/IT

5. Program Difficulty (D)


6. Effort (E)
7. Development Time (Note: S=18)

Lab Assignment: Differentiate followings:

Sr. No. Basic COCOMO Model Intermediate COCOMO Model

Sr. No. Function Points (FP) Lines Of Code (LOC)

Program evaluation & review technique


Sr.No. Critical Path Method (CPM)
(PERT)

CE/IT Dept., UVPCE, GNU, Kherva Page 15


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Practical-7
Aim: To study about software testing
Objective: To get familiar with Software Testing Methodology and Design the various Test cases based on
software testing approaches.

References: Software Engineering by Roger Pressman, Software Engineering by K.K. Aggarwal, Software
Engineering by Rajib mall.
Pre-requisite: Knowledge of Software Requirement Specification, Application Functionalities and Testing
Process.
Summary: Testing is the process of evaluating a system or its component(s) with the intent to find that whether
it satisfies the specified requirements or not. This activity results in the actual, expected and difference between
their results. In simple words testing is executing a system in order to identify any gaps, errors or missing
requirements in contrary to the actual desire or requirements. According to ANSI/IEEE 1059 standard, Testing
can be defined as “a process of analyzing a software item to detect the differences between existing and required
conditions (that is defects/errors/bugs) and to evaluate the features of the software item”.
Software testing, depending on the testing method employed, can be implemented at any time in the
software development process. Traditionally most of the test effort occurs after the requirements have been
defined and the coding process has been completed, but in the agile approaches most of the test effort is on-
going. As such, the methodology of the test is governed by the chosen software development methodology.
NOTE: Testing Tutorials and Materials are available. (See the link).
Practical: Design the various Test cases using Testing Methodology.

1) Using STATEMENT COVERAGE Testing Methodology, Develop the Test sets such that all statements
are executed at least once for following Program.
Program-1.1
#include<stdio.h>
Void main(argc, argv)
{
int no_number;
float mean;stdev;
int I, total;
int numbers(100) /*the actual numbers*/;
printf(“\nenter the number of numbers\n);
scanf(“%d%”,&no_numbers);
for(i=0;i<no_numbers;i++);
{
scanf(“%d”,&numbers[i]);
total+=numbers[i];
}
mean=total/no_numbers;
total=0;
for(I=0;i<no_numbers;i++)
{
total+=((mean-numbers[i])*(mean-numbers[i])}
}
stdev=total/no_numbers;
printf(“\nThe standard deviation is %d\n”,stdev);
return(0)
}

CE/IT Dept., UVPCE, GNU, Kherva Page 16


2CE/IT602: Software Engineering B.Tech 5th CE/IT

Program-1.2
#include<stdio.h>
#include<conio.h>
void main()
{
char opt[1];
int x, y, z, total, value;
float pct, tmp;
clrscr();
total=0; value=0;
printf(“\n enter option”);
scanf(“%c”, opt);
if(opt==’s’)
{
printf(“\n the s option”)
x=6; y=10; z=2; value= x+y+z; total=20; tmp=value;
printf(“\n no of statements covered by this option is %d”,total);
pct = (value/total)*100.0;
printf(“\n percentage line covered by this option is %6.2f”,pct);
}
else
{
printf(“\n the non S option”);
pct =value/total*100.0;}
printf(“\n the end of program”); getch();
}
2) Find out PATH COVERAGE for given program which is written in C and Draw the Control Flow
Graph. Generate the Test Cases of all linear independent PATHS and Test it during execution of
Program.
#include<stdio.h>
#include<conio.h>
void main()
{
char opt[1];
int x, y,z, total, value;
float pct,tmp;
clrscr();
total=20; value=10;
printf(“\n enter option”);
Ssanf(“%c”, opt);
if(opt==”s”)
{
printf(“\n the s option”);
x=6; y=10; z=2; value= x+y+z; total=20; tmp=value;
printf(“\no of statements covered by this option is %d”, total);
}
pct (value/total)*100.0;
printf(“\n percentage line covered by this option is %10.2f”, pct);
printf(:\n the end of program”);
getch();
}

CE/IT Dept., UVPCE, GNU, Kherva Page 17


2CE/IT602: Software Engineering B.Tech 5th CE/IT

3) Consider a simple program to classify a triangle. Its inputs is a triple of positive integers (say x, y, z)
and the date type for input parameters ensures that these will be integers greater than 0 and less than
or equal to 100. The program output may be one of the following words:

[Scalene; Isosceles; Equilateral; Not a triangle]

Design the BOUNDARY VALUE TEST cases in Tabular Format.

[Note: With single fault assumption theory, 4N+1 test case can be designed where N= number of input
parameters]

4) Design test cases using path coverage technique such that it can cover maximum paths for given
segments of programs:
switch(pos)
{
Case cashier:
If(emp_yr > 50)
bonus = 1;
Else
bonus=0.7;
Break;
Case manager:
Bonus=1.5;
If (emp_yr>56)

Bonus=1.2*bonus;
Break;
}
Printf(“bonus=%d”,bonus);

5) Write a program to determine the nature of roots of a quadratic equation. Its input is triple positive
numbers and value may be from interval [0, 100]. The output may have any one of the following
words:
“Real roots”, “Imaginary roots”, ”Equal roots”.
[A] Draw Control Flaw graph for this program.
[B] Find out independent paths for above flow graph.
[C] Find out Cyclomatic Complexity for the same program.

CE/IT Dept., UVPCE, GNU, Kherva Page 18

You might also like