Professional Documents
Culture Documents
Software Engineering Practical Handbook
Software Engineering Practical Handbook
Software Engineering Practical Handbook
Class diagram is a static diagram. It represents the static view of an application. Class
diagram is not only used for visualizing, describing, and documenting different
aspects of a system but also for constructing executable code of the software
application.
Class diagram describes the attributes and operations of a class and also the
constraints imposed on the system. The class diagrams are widely used in the
modeling of objectoriented systems because they are the only UML diagrams, which
can be mapped directly with object-oriented languages.
Class diagram shows a collection of classes, interfaces, associations, collaborations,
and constraints. It is also known as a structural diagram.
The next step was to create the physical database and input some sample data. In order
to turn the relational design into a database, we ran the following script in UNCC's
Oracle database:
INSERT INTO Customer(ID, name, addr, DOB, phone, username, password) VALUES
(64937, 'Roger Hurst', '974 Bingamon Branch Rd, Bensenville, IL
60106', '08/22/1973', '847-221-4986', 'rhurst', 'password3');
INSERT INTO Customer(ID, name, addr, DOB, phone, username,
password) VALUES (31430, 'Warren V. Woodson', '3022
Lords Way, Parsons, TN 38363', '03/07/1945', '731-845-0077',
'wvwoodson', 'password4');
LA 70802', '225-346-0068');
813, 10.0);
8.0, 20.0);
Day', 1991);
INSERT INTO VideoMedia(media_id, title, year) VALUES
'Louisiana Branch');
Sequence diagram is the most common kind of interaction diagram, which focuses on
the message interchange between a number of lifelines. Sequence diagram describes an
interaction by focusing on the sequence of messages that are exchanged, along with their
corresponding occurrence specifications on the lifelines.
From the term Interaction, it is clear that the diagram is used to describe some type of
interactions among the different elements in the model. This interaction is a part of dynamic
behavior of the system.
This interactive behavior is represented in UML by two diagrams known as Sequence
diagram and Collaboration diagram. The basic purpose of both the diagrams are similar.
Sequence diagram emphasizes on time sequence of messages and collaboration diagram
emphasizes on the structural organization of the objects that send and receive messages.
Statechart diagram is one of the five UML diagrams used to model the dynamic nature of a
system. They define different states of an object during its lifetime and these states are
changed by events. Statechart diagrams are useful to model the reactive systems. Reactive
systems can be defined as a system that responds to external or internal events.
Statechart diagram describes the flow of control from one state to another state. States are
defined as a condition in which an object exists and it changes when some event is triggered.
The most important purpose of Statechart diagram is to model lifetime of an object from
creation to termination.
Statechart diagrams are also used for forward and reverse engineering of a system. However,
the main purpose is to model the reactive system.
Following are the main purposes of using Statechart diagrams −
• To model the dynamic aspect of a system.
• To model the life time of a reactive system.
• To describe different states of an object during its life time.
• Define a state machine to model the states of an object.
Statechart diagram is used to describe the states of different objects in its life cycle. Emphasis
is placed on the state changes upon some internal or external events. These states of objects
are important to analyze and implement them accurately.
Statechart diagrams are very important for describing the states. States can be identified as the
condition of objects when a particular event occurs.
Before drawing a Statechart diagram we should clarify the following points −
• Identify the important objects to be analyzed.
• Identify the states.
• Identify the events.
Following is an example of a Statechart diagram where the state of Order object is analyzed
The first state is an idle state from where the process starts. The next states are arrived for
events like send request, confirm request, and dispatch order. These events are responsible for
the state changes of order object.
During the life cycle of an object (here order object) it goes through the following states and
there may be some abnormal exits. This abnormal exit may occur due to some problem in the
system. When the entire life cycle is complete, it is considered as a complete transaction as
shown in the following figure. The initial and final state of an object is also shown in the
following figure.
From the above discussion, we can define the practical applications of a Statechart diagram.
Statechart diagrams are used to model the dynamic aspect of a system like other four diagrams
discussed in this tutorial. However, it has some distinguishing characteristics for modeling the
dynamic nature.
Statechart diagram defines the states of a component and these state changes are dynamic in
nature. Its specific purpose is to define the state changes triggered by events. Events are
internal or external factors influencing the system.
Statechart diagrams are used to model the states and also the events operating on the system.
When implementing a system, it is very important to clarify different states of an object during
its life time and Statechart diagrams are used for this purpose. When these states and events
are identified, they are used to model it and these models are used during the implementation
of the system.
If we look into the practical implementation of Statechart diagram, then it is mainly used to
analyze the object states influenced by events. This analysis is helpful to understand the
system behavior during its execution.
The main usage can be described as −
• To model the object states of a system.
• To model the reactive system. Reactive system consists of reactive objects.
• To identify the events responsible for state changes.
• Forward and reverse engineering.
Types of DFD
Data Flow Diagrams are either Logical or Physical.
• Logical DFD - This type of DFD concentrates on the system process, and flow of
data in the system.For example in a Banking software system, how data is moved
between different entities.
• Physical DFD - This type of DFD shows how the data flow is actually implemented
in the system. It is more specific and close to the implementation.
DFD Components
DFD can represent Source, destination, storage and flow of data using the following set of
components -
• Entities - Entities are source and destination of information data. Entities are
represented by a rectangles with their respective names.
• Process - Activities and action taken on the data are represented by Circle or Round-
edged rectangles.
• Data Storage - There are two variants of data storage - it can either be represented as
a rectangle with absence of both smaller sides or as an open-sided rectangle with only
one side missing.
• Data Flow - Movement of data is shown by pointed arrows. Data movement is shown
from the base of arrow as its source towards head of the arrow as destination.
Levels of DFD
• Level 0 - Highest abstraction level DFD is known as Level 0 DFD, which depicts the
entire information system as one diagram concealing all the underlying details. Level
0 DFDs are also known as context level DFDs.
• Level 1 - The Level 0 DFD is broken down into more specific, Level 1 DFD. Level 1
DFD depicts basic modules in the system and flow of data among various modules.
Level 1 DFD also mentions basic processes and sources of information.
• Level 2 - At this level, DFD shows how data flows inside the modules mentioned in
Level 1.
Higher level DFDs can be transformed into more specific lower level DFDs with
deeper level of understanding unless the desired level of specification is achieved.
DFD for Library Management System
DFD for few interaction in Hospital Management System
7. Study and implementation of Collaboration Diagrams.
• Collaboration diagrams can become complex when too many objects are present
within the system.
• It is hard to explore each object inside the system.
• Collaboration diagrams are time consuming.
• The object is destroyed after the termination of a program.
• The state of an object changes momentarily, which makes it difficult to keep track of
every single change the occurs within an object of a system.
The above collaboration diagram represents a student information management system. The
flow of communication in the above diagram is given by,
The basic purposes of activity diagrams is similar to other four diagrams. It captures the
dynamic behavior of the system. Other four diagrams are used to show the message flow from
one object to another but activity diagram is used to show message flow from one activity to
another.
Activity is a particular operation of the system. Activity diagrams are not only used for
visualizing the dynamic nature of a system, but they are also used to construct the executable
system by using forward and reverse engineering techniques. The only missing thing in the
activity diagram is the message part.
It does not show any message flow from one activity to another. Activity diagram is
sometimes considered as the flowchart. Although the diagrams look like a flowchart, they are
not. It shows different flows such as parallel, branched, concurrent, and single.
The purpose of an activity diagram can be described as −
• Draw the activity flow of a system.
• Describe the sequence from one activity to another.
• Describe the parallel, branched and concurrent flow of the system.
Activity diagrams are mainly used as a flowchart that consists of activities performed by the
system. Activity diagrams are not exactly flowcharts as they have some additional capabilities.
These additional capabilities include branching, parallel flow, swimlane, etc.
Before drawing an activity diagram, we must have a clear understanding about the elements
used in activity diagram. The main element of an activity diagram is the activity itself. An
activity is a function performed by the system. After identifying the activities, we need to
understand how they are associated with constraints and conditions.
Before drawing an activity diagram, we should identify the following elements −
• Activities
• Association
• Conditions
• Constraints
Once the above-mentioned parameters are identified, we need to make a mental layout of the
entire flow. This mental layout is then transformed into an activity diagram.
Following is an example of an activity diagram for order management system. In the diagram,
four activities are identified which are associated with conditions. One important point should
be clearly understood that an activity diagram cannot be exactly matched with the code. The
activity diagram is made to understand the flow of activities and is mainly used by the business
users
Following diagram is drawn with the four main activities −
• Send order by the customer
• Receipt of the order
• Confirm the order
• Dispatch the order
After receiving the order request, condition checks are performed to check if it is normal or
special order. After the type of order is identified, dispatch activity is performed and that is
marked as the termination of the process.
The basic usage of activity diagram is similar to other four UML diagrams. The specific usage
is to model the control flow from one activity to another. This control flow does not include
messages.
Activity diagram is suitable for modeling the activity flow of the system. An application can
have multiple systems. Activity diagram also captures these systems and describes the flow
from one system to another. This specific usage is not available in other diagrams. These
systems can be database, external queues, or any other system.
We will now look into the practical applications of the activity diagram. From the above
discussion, it is clear that an activity diagram is drawn from a very high level. So it gives high
level view of a system. This high level view is mainly for business users or any other person
who is not a technical person.
This diagram is used to model the activities which are nothing but business requirements. The
diagram has more impact on business understanding rather than on implementation details.
Activity diagram can be used for −
• Modeling work flow by using activities.
• Modeling business requirements.
• High level understanding of the system's functionalities.
• Investigating business requirements at a later stage.
Component diagram is a special kind of diagram in UML. The purpose is also different from
all other diagrams discussed so far. It does not describe the functionality of the system but it
describes the components used to make those functionalities.
Thus from that point of view, component diagrams are used to visualize the physical
components in a system. These components are libraries, packages, files, etc.
Component diagrams can also be described as a static implementation view of a system. Static
implementation represents the organization of the components at a particular moment.
A single component diagram cannot represent the entire system but a collection of diagrams
is used to represent the whole.
The purpose of the component diagram can be summarized as −
• Visualize the components of a system.
• Construct executables by using forward and reverse engineering.
• Describe the organization and relationships of the components.
Component diagrams are used to describe the physical artifacts of a system. This artifact
includes files, executables, libraries, etc
The purpose of this diagram is different. Component diagrams are used during the
implementation phase of an application. However, it is prepared well in advance to visualize
the implementation details.
Initially, the system is designed using different UML diagrams and then when the artifacts are
ready, component diagrams are used to get an idea of the implementation.
This diagram is very important as without it the application cannot be implemented efficiently.
A well-prepared component diagram is also important for other aspects such as application
performance, maintenance, etc.
Before drawing a component diagram, the following artifacts are to be identified clearly −
• Files used in the system.
• Libraries and other artifacts relevant to the application.
• Relationships among the artifacts.
After identifying the artifacts, the following points need to be kept in mind.
• Use a meaningful name to identify the component for which the diagram is to be drawn.
• Prepare a mental layout before producing the using tools.
• Use notes for clarifying important points.
Following is a component diagram for order management system. Here, the artifacts are files.
The diagram shows the files in the application and their relationships. In actual, the component
diagram also contains dlls, libraries, folders, etc.
In the following diagram, four files are identified and their relationships are produced.
Component diagram cannot be matched directly with other UML diagrams discussed so far
as it is drawn for completely different purpose.
The following component diagram has been drawn considering all the points mentioned
above.
We have already described that component diagrams are used to visualize the static
implementation view of a system. Component diagrams are special type of UML diagrams
used for different purposes.
These diagrams show the physical components of a system. To clarify it, we can say that
component diagrams describe the organization of the components in a system.
Organization can be further described as the location of the components in a system. These
components are organized in a special way to meet the system requirements.
As we have already discussed, those components are libraries, files, executables, etc. Before
implementing the application, these components are to be organized. This component
organization is also designed separately as a part of project execution.
Component diagrams are very important from implementation perspective. Thus, the
implementation team of an application should have a proper knowledge of the component
details
Component diagrams can be used to −
• Model the components of a system.
• Model the database schema.
• Model the executables of an application.
• Model the system's source code.
The term Deployment itself describes the purpose of the diagram. Deployment diagrams are
used for describing the hardware components, where software components are deployed.
Component diagrams and deployment diagrams are closely related.
Component diagrams are used to describe the components and deployment diagrams shows
how they are deployed in hardware.
UML is mainly designed to focus on the software artifacts of a system. However, these two
diagrams are special diagrams used to focus on software and hardware components.
Most of the UML diagrams are used to handle logical components but deployment diagrams
are made to focus on the hardware topology of a system. Deployment diagrams are used by
the system engineers.
The purpose of deployment diagrams can be described as −
• Visualize the hardware topology of a system.
• Describe the hardware components used to deploy software components.
• Describe the runtime processing nodes.
Deployment diagrams are mainly used by system engineers. These diagrams are used to
describe the physical components (hardware), their distribution, and association.
Deployment diagrams can be visualized as the hardware components/nodes on which the
software components reside.
Software applications are developed to model complex business processes. Efficient software
applications are not sufficient to meet the business requirements. Business requirements can
be described as the need to support the increasing number of users, quick response time, etc.
To meet these types of requirements, hardware components should be designed efficiently and
in a cost-effective way.
Now-a-days software applications are very complex in nature. Software applications can be
standalone, web-based, distributed, mainframe-based and many more. Hence, it is very
important to design the hardware components efficiently.
Deployment diagrams can be used −
• To model the hardware topology of a system.
• To model the embedded system.
• To model the hardware details for a client/server system.
• To model the hardware details of a distributed application.
• For Forward and Reverse engineering.
1. During the planning stage, one needs to choose how many engineers are required for
the project and to develop a schedule.
2. In monitoring the project's progress, one needs to access whether the project is
progressing according to the procedure and takes corrective action, if necessary.
A model may be static or dynamic. In a static model, a single variable is taken as a key
element for calculating cost and time. In a dynamic model, all variable are interdependent,
and there is no basic variable.
Static, Single Variable Models: When a model makes use of single variables to calculate
desired values such as cost, time, efforts, etc. is said to be a single variable model. The most
common equation is:
C=aLb
Where C = Costs
L= size
a and b are constants
The Software Engineering Laboratory established a model called SEL model, for estimating
its software production. This model is an example of the static, single variable model.
E=1.4L0.93
DOC=30.4L0.90
D=4.6L0.26
Static, Multivariable Models: These models are based on method (1), they depend on
several variables describing various aspects of the software development environment. In
some model, several variables are needed to describe the software development process, and
selected equation combined these variables to give the estimate of time & cost. These models
are called multivariable models.
WALSTON and FELIX develop the models at IBM provide the following equation gives a
relationship between lines of source code and effort:
E=5.2L0.91
D=4.1L0.36
The productivity index uses 29 variables which are found to be highly correlated productivity
as follows:
Where Wi is the weight factor for the ithvariable and Xi={-1,0,+1} the estimator gives Xione
of the values -1, 0 or +1 depending on the variable decreases, has no effect or increases the
productivity.
Example: Compare the Walston-Felix Model with the SEL model on a software
development expected to involve 8 person-years of effort.
a. Calculate the number of lines of source code that can be produced.
b. Calculate the duration of the development.
c. Calculate the productivity in LOC/PY
d. Calculate the average manning
Solution:
Then
(d)Average manning is the average number of persons required per month in the project
COCOMO Model
Boehm proposed COCOMO (Constructive Cost Estimation Model) in 1981.COCOMO is one
of the most generally used software estimation models in the world. COCOMO predicts the
efforts and schedule of a software product based on the size of the software.
The initial estimate (also called nominal estimate) is determined by an equation of the form
used in the static single variable models, using KDLOC as the measure of the size. To
determine the initial effort Ei in person-months the equation used is of the type is shown
below
Ei=a*(KDLOC)b
The value of the constant a and b are depends on the project type.
1. Organic
2. Semidetached
3. Embedded
1.Organic: A development project can be treated of the organic type, if the project deals with
developing a well-understood application program, the size of the development team is
reasonably small, and the team members are experienced in developing similar methods of
projects. Examples of this type of projects are simple business systems, simple inventory
management systems, and data processing systems.
According to Boehm, software cost estimation should be done through three stages:
1. Basic Model
2. Intermediate Model
3. Detailed Model
1. Basic COCOMO Model: The basic COCOMO model provide an accurate size of the
project parameters. The following expressions give the basic COCOMO estimation model:
Effort=a1*(KLOC) a2 PM
Tdev=b1*(efforts)b2 Months
Where
KLOC is the estimated size of the software product indicate in Kilo Lines of Code,
Effort is the total effort required to develop the software product, expressed in person
months (PMs).
For the three classes of software products, the formulas for estimating the effort based on the
code size are shown below:
For the three classes of software products, the formulas for estimating the development time
based on the effort are given below:
The development time versus the product size in KLOC is plotted in fig. From fig it can be
observed that the development time is a sub linear function of the size of the product, i.e. when
the size of the product increases by two times, the time to develop the product does not double
but rises moderately. This can be explained by the fact that for larger products, a larger number
of activities which can be carried out concurrently can be identified. The parallel activities can
be carried out simultaneously by the engineers. This reduces the time to complete the project.
Further, from fig, it can be observed that the development time is roughly the same for all three
categories of products. For example, a 60 KLOC program can be developed in approximately
18 months, regardless of whether it is of organic, semidetached, or embedded type.
From the effort estimation, the project cost can be obtained by multiplying the required effort
by the manpower cost per month. But, implicit in this project cost computation is the
assumption that the entire project cost is incurred on account of the manpower cost alone. In
addition to manpower cost, a project would incur costs due to hardware and software required
for the project and the company overheads for administration, office space, etc.
It is important to note that the effort and the duration estimations obtained using the
COCOMO model are called a nominal effort estimate and nominal duration estimate. The
term nominal implies that if anyone tries to complete the project in a time shorter than the
estimated duration, then the cost will increase drastically. But, if anyone completes the
project over a longer period of time than the estimated, then there is almost no decrease in the
estimated cost value.
Example1: Suppose a project was estimated to be 400 KLOC. Calculate the effort and
development time for each of the three model i.e., organic, semi-detached & embedded.
Effort=a1*(KLOC) a2 PM
Tdev=b1*(efforts)b2 Months
Estimated Size of project= 400 KLOC
(i)Organic Mode
E = 2.4 * (400)1.05 = 1295.31 PM
D = 2.5 * (1295.31)0.38=38.07 PM
(ii)Semidetached Mode
E = 3.0 * (400)1.12=2462.79 PM
D = 2.5 * (2462.79)0.35=38.45 PM
Example2: A project size of 200 KLOC is to be developed. Software development team has
average experience on similar type of projects. The project schedule is not very tight.
Calculate the Effort, development time, average staff size, and productivity of the project.
Solution: The semidetached mode is the most appropriate mode, keeping in view the size,
schedule and experience of development time.
Hence E=3.0(200)1.12=1133.12PM
D=2.5(1133.12)0.35=29.3PM
P = 176 LOC/PM
2. Intermediate Model: The basic Cocomo model considers that the effort is only a function
of the number of lines of code and some constants calculated according to the various
software systems. The intermediate COCOMO model recognizes these facts and refines the
initial estimates obtained through the basic COCOMO model by using a set of 15 cost drivers
based on various attributes of software engineering.
Hardware attributes -
o Run-time performance constraints
o Memory constraints
o The volatility of the virtual machine environment
o Required turnabout time
Personnel attributes -
o Analyst capability
o Software engineering capability
o Applications experience
o Virtual machine experience
o Programming language experience
Project attributes -
Project ai bi ci di
3. Detailed COCOMO Model: Detailed COCOMO incorporates all qualities of the standard
version with an assessment of the cost driver?s effect on each method of the software
engineering process. The detailed model uses various effort multipliers for each cost driver
property. In detailed cocomo, the whole software is differentiated into multiple modules, and
then we apply COCOMO in various modules to estimate effort and then sum the effort.
The effort is determined as a function of program estimate, and a set of cost drivers are given
according to every phase of the software lifecycle.
Gantt chart is a type of a bar chart that is used for illustrating project schedules. Gantt charts
can be used in any projects that involve effort, resources, milestones and deliveries.
At present, Gantt charts have become the popular choice of project managers in every field.
Gantt charts allow project managers to track the progress of the entire project. Through Gantt
charts, the project manager can keep a track of the individual tasks as well as of the overall
project progression.
In addition to tracking the progression of the tasks, Gantt charts can also be used for tracking
the utilization of the resources in the project. These resources can be human resources as well
as materials used.
Gantt chart was invented by a mechanical engineer named Henry Gantt in 1910. Since the
invention, Gantt chart has come a long way. By today, it takes different forms from simple
paper based charts to sophisticated software packages.
The Use
As we have already discussed, Gantt charts are used for project management purposes. In
order to use Gantt charts in a project, there are a few initial requirements fulfilled by the
project.
First of all, the project should have a sufficiently detailed Work Breakdown Structure (WBS).
Secondly, the project should have identified its milestones and deliveries.
In some instances, project managers try to define the work break down structure while creating
Gantt chart. This is one of the frequently practised errors in using Gantt charts. Gantt charts
are not designed to assist WBS process; rather Gantt charts are for task progress tracking.
Gantt charts can be successfully used in projects of any scale. When using Gantt charts for
large projects, there can be an increased complexity when tracking the tasks.
This problem of complexity can be successfully overcome by using computer software
packages designed for offering Gantt chart functionalities.
One way to create a project plan is to use a work breakdown structure, a technique for splitting
tasks into sub-tasks and creating a task hierarchy. Gantt applications will generally allow you
to reflect the project hierarchy in the Gantt's task list at the left of the chart.
A Gantt chart is a type of horizontal bar chart commonly used in project management, which
is a visual view of tasks scheduled overtime. It provides a graphical visualization of a
schedule that helps to plan, coordinate, and track specific tasks (or elements) in a project.
Gantt chart boils down multiple tasks and timelines into a single page. Using a Gantt chart
allows all stakeholders to perceive the same schedule information, sets mutually understood
expectations, and conducts their efforts according to the desired protocol. The Gantt chart
tool provides a visual timeline for the start and end of tasks, making it clear how tasks are
interrelated and perhaps rely on the completion of another before one can start.
PERT vs Gantt Chart
PERT charts are network diagrams that use boxes to represent tasks and arrows to present
dependencies between tasks. The boxes are laid out from left to right, but there is no fixed
Y-axis with dates. The first box, or root, is centered vertically on the left side, and the
subsequent tasks can be drawn anywhere along the Y-axis. Arrows can point to the right, up
or down, but never to the left.
Gantt charts are bar graphs. The X-axis contains dates and the Y-axis lists separate tasks.
On each line of the Y-axis, the chart depicts a bar positioned to extend from the task’s start
date to its end date. Tasks are listed in the start-date order.