0% found this document useful (0 votes)
24 views139 pages

Sepm Unit 1 and Unit 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views139 pages

Sepm Unit 1 and Unit 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 139

Software Engineering Introduction

Computer software is a product or program code developed by software engineers.

The applications of computer software are: Telecommunication, military, medical


sciences, online shopping, office products, IT industry etc.

A Software consists of data and the related documents.

The software is the key element in all computer based systems and products.

The main purpose behind software engineering is to give a framework for building a
software with best quality.

Software Engineering is an engineering branch related to the evolution of software


product using well-defined scientific principles, techniques, and procedures. The result
of software engineering is an effective and reliable software product.

Why is Software Engineering required?

Software Engineering is required due to the following reasons:

To manage Large software

For more Scalability

Cost Management

To manage the dynamic nature of software

For better quality Management

Need of Software Engineering

The necessity of software engineering appears because of a higher rate of progress in


user requirements and the environment on which the program is working.

Huge Programming: It is simpler to manufacture a wall than to a house or building,


similarly, as the measure of programming become extensive engineering has to step to
give it a scientific process.

Adaptability: If the software procedure were not based on scientific and engineering
ideas, it would be simpler to re-create new software than to scale an existing one.
Cost: As the hardware industry has demonstrated its skills and huge manufacturing
has let down the cost of computer and electronic hardware. But the cost of
programming remains high if the proper process is not adapted.

Dynamic Nature: The continually growing and adapting nature of programming


hugely depends upon the environment in which the client works. If the quality of the
software is continually changing, new upgrades need to be done in the existing one.

Quality Management: Better procedure of software development provides a better


and quality software product.

Characteristics of a good software engineer

The features that good software engineers should possess are as follows:

1. Exposure to systematic methods, i.e., familiarity with software engineering


principles.
2. Good technical knowledge of the project range (Domain knowledge).
3. Good programming abilities.
4. Good communication skills. These skills comprise of oral, written, and
interpersonal skills.
5. High motivation.
6. Sound knowledge of fundamentals of computer science.
7. Intelligence.
8. Ability to work in a team
9. Discipline, etc.
Software engineering definitions

The establishment and use of sound engineering principles in order to obtain


economical software that is reliable and works efficiently on real machines.

Software engineering is a systematic and disciplined approach towards the


development of the software operation and maintenance.

Software engineering is an engineering branch associated with the development of


software product using well-defined scientific principles, methods and procedures.

Characteristics of a software

Software should achieve a good quality in design and meet all the specifications of the
customer.

Software does not wear out i.e. it does not lose the material.

Software should be inherently complex.

Software must be efficient i.e. the ability of the software to use system resources in an
effective and efficient manner.

Software must be integral i.e. it must prevent from unauthorized access to the software
or data.

Software engineering - Layered technology

Software engineering is a fully layered technology.

To develop a software, we need to go from one layer to another.

All these layers are related to each other and each layer demands the fulfillment of the
previous layer.
The layered technology consists of:
1. Quality focus
The characteristics of good quality software are:

Correctness of the functions required to be performed by the software.

Maintainability of the software

Integrity i.e. providing security so that the unauthorized user cannot access information
or data.

Usability i.e. the efforts required to use or operate the software.

2. Process

It is the base layer or foundation layer for the software engineering.

The software process is the key to keep all levels together.

It defines a framework that includes different activities and tasks.

In short, it covers all activities, actions and tasks required to be carried out for software
development.

3. Methods

The method provides the answers of all 'how-to' that are asked during the process.

It provides the technical way to implement the software.

It includes collection of tasks starting from communication, requirement analysis,


analysis and design modelling, program construction, testing and support.

4. Tools

The software engineering tool is an automated support for the software development.
The tools are integrated i.e the information created by one tool can be used by the other
tool.

For example: The Microsoft publisher can be used as a web designing tool.

What is Software Engineering?

The term software engineering is the product of two words, software, and
engineering.

The software is a collection of integrated programs.

Software subsists of carefully-organized instructions and code written by developers


on any of various particular computer languages.

Computer programs and related documentation such as requirements, design models


and user manuals.

Engineering is the application of scientific and practical knowledge to invent,


design, build, maintain, and improve frameworks, processes, etc.

Importance of Software Engineering


The importance of Software engineering is as follows:

Reduces complexity: Big software is always complicated and challenging to progress.


Software engineering has a great solution to reduce the complication of any project.
Software engineering divides big problems into various small issues. And then start
solving each small issue one by one. All these small problems are solved independently
to each other.

To minimize software cost: Software needs a lot of hardwork and software engineers
are highly paid experts. A lot of manpower is required to develop software with a large
number of codes. But in software engineering, programmers project everything and
decrease all those things that are not needed. In turn, the cost for software productions
becomes less as compared to any software that does not use software engineering
method.

To decrease time: Anything that is not made according to the project always wastes
time. And if you are making great software, then you may need to run many codes to
get the definitive running code. This is a very time-consuming procedure, and if it is
not well handled, then this can take a lot of time. So if you are making your software
according to the software engineering method, then it will decrease a lot of time.

Handling big projects: Big projects are not done in a couple of days, and they need
lots of patience, planning, and management. And to invest six and seven months of
any company, it requires heaps of planning, direction, testing, and maintenance. No
one can say that he has given four months of a company to the task, and the project is
still in its first stage. Because the company has provided many resources to the plan
and it should be completed. So to handle a big project without any problem, the
company has to go for a software engineering method.
Reliable software: Software should be secure, means if you have delivered the
software, then it should work for at least its given time or subscription. And if any
bugs come in the software, the company is responsible for solving all these bugs.
Because in software engineering, testing and maintenance are given, so there is no
worry of its reliability.

Effectiveness: Effectiveness comes if anything has made according to the standards.


Software standards are the big target of companies to make it more effective. So
Software becomes more effective in the act with the help of software engineering.

Software Processes

The term software specifies to the set of computer programs, procedures and
associated documents (Flowcharts, manuals, etc.) that describe the program and how
they are to be used.

A software process is the set of activities and associated outcome that produce a
software product. Software engineers mostly carry out these activities. These are four
key process activities, which are common to all software processes. These activities
are:

Software specifications: The functionality of the software and constraints on its


operation must be defined.

Software development: The software to meet the requirement must be produced.

Software validation: The software must be validated to ensure that it does what the
customer wants.

Software evolution: The software must evolve to meet changing client needs.

The Software Process Model

A software process model is a specified definition of a software process, which is


presented from a particular perspective. Models, by their nature, are a simplification,
so a software process model is an abstraction of the actual process, which is being
described. Process models may contain activities, which are part of the software
process, software product, and the roles of people involved in software engineering.
Some examples of the types of software process models that may be produced are:
A workflow model: This shows the series of activities in the process along with their
inputs, outputs and dependencies. The activities in this model perform human actions.

2. A dataflow or activity model: This represents the process as a set of activities, each
of which carries out some data transformations. It shows how the input to the process,
such as a specification is converted to an output such as a design. The activities here
may be at a lower level than activities in a workflow model. They may perform
transformations carried out by people or by computers.

3. A role/action model: This means the roles of the people involved in the software
process and the activities for which they are responsible.

There are several various general models or paradigms of software development:

The waterfall approach: This takes the above activities and produces them as
separate process phases such as requirements specification, software design,
implementation, testing, and so on. After each stage is defined, it is "signed off" and
development goes onto the following stage.

Evolutionary development: This method interleaves the activities of specification,


development, and validation. An initial system is rapidly developed from a very
abstract specification.

Formal transformation: This method is based on producing a formal mathematical


system specification and transforming this specification, using mathematical methods
to a program. These transformations are 'correctness preserving.' This means that you
can be sure that the developed programs meet its specification.

System assembly from reusable components: This method assumes the parts of the
system already exist. The system development process target on integrating these parts
rather than developing them from scratch.

Software Crisis

Size: Software is becoming more expensive and more complex with the growing
complexity and expectation out of software. For example, the code in the consumer
product is doubling every couple of years.

Quality: Many software products have poor quality, i.e., the software products defects
after putting into use due to ineffective testing technique. For example, Software
testing typically finds 25 errors per 1000 lines of code.
Cost: Software development is costly i.e. in terms of time taken to develop and the
money involved. For example, Development of the FAA's Advanced Automation
System cost over $700 per lines of code.

Delayed Delivery: Serious schedule overruns are common. Very often the software
takes longer than the estimated time to develop, which in turn leads to cost shooting
up. For example, one in four large-scale development projects is never completed.

Program vs. Software

Software is more than programs. Any program is a subset of software, and it becomes
software only if documentation & operating procedures manuals are prepared.

There are three components of the software as shown in fig:

Program: Program is a combination of source code & object code.

Documentation: Documentation consists of different types of manuals. Examples of


documentation manuals are: Data Flow Diagram, Flow Charts, ER diagrams, etc.
Operating Procedures: Operating Procedures consist of instructions to set up and use
the software system and instructions on how react to the system failure. Example of
operating system procedures manuals is: installation guide, Beginner's guide, reference
guide, system administration guide, etc.

Software Development Life Cycle (SDLC)

A software life cycle model (also termed process model) is a pictorial and
diagrammatic representation of the software life cycle. A life cycle model represents
all the methods required to make a software product transit through its life cycle stages.
It also captures the structure in which these methods are to be undertaken.

In other words, a life cycle model maps the various activities performed on a software
product from its inception to retirement. Different life cycle models may plan the
necessary development activities to phases in different ways. Thus, no element which
life cycle model is followed, the essential activities are contained in all life cycle
models though the action may be carried out in distinct orders in different life cycle
models. During any life cycle stage, more than one activity may also be carried out.

Need of SDLC

The development team must determine a suitable life cycle model for a particular plan
and then observe to it.

Without using an exact life cycle model, the development of a software product would
not be in a systematic and disciplined manner. When a team is developing a software
product, there must be a clear understanding among team representative about when
and what to do. Otherwise, it would point to chaos and project failure. This problem
can be defined by using an example. Suppose a software development issue is divided
into various parts and the parts are assigned to the team members. From then on,
suppose the team representative is allowed the freedom to develop the roles assigned
to them in whatever way they like. It is possible that one representative might start
writing the code for his part, another might choose to prepare the test documents first,
and some other engineer might begin with the design phase of the roles assigned to
him. This would be one of the perfect methods for project failure.

A software life cycle model describes entry and exit criteria for each phase. A phase
can begin only if its stage-entry criteria have been fulfilled. So without a software life
cycle model, the entry and exit criteria for a stage cannot be recognized. Without
software life cycle models, it becomes tough for software project managers to monitor
the progress of the project.

SDLC Cycle

SDLC Cycle represents the process of developing software. SDLC framework


includes the following steps:

The stages of SDLC are as follows:

Stage1: Planning and requirement analysis

Requirement Analysis is the most important and necessary stage in SDLC.

The senior members of the team perform it with inputs from all the stakeholders and
domain experts or SMEs in the industry.

Planning for the quality assurance requirements and identifications of the risks
associated with the projects is also done at this stage.

Business analyst and Project organizer set up a meeting with the client to gather all the
data like what the customer wants to build, who will be the end user, what is the
objective of the product. Before creating a product, a core understanding or knowledge
of the product is very necessary.

For Example, A client wants to have an application which concerns money


transactions. In this method, the requirement has to be precise like what kind of
operations will be done, how it will be done, in which currency it will be done, etc.

Once the required function is done, an analysis is complete with auditing the feasibility
of the growth of a product. In case of any ambiguity, a signal is set up for further
discussion.

Once the requirement is understood, the SRS (Software Requirement Specification)


document is created. The developers should thoroughly follow this document and also
should be reviewed by the customer for future reference.

Stage2: Defining Requirements

Once the requirement analysis is done, the next stage is to certainly represent and
document the software requirements and get them accepted from the project
stakeholders.

This is accomplished through "SRS"- Software Requirement Specification document


which contains all the product requirements to be constructed and developed during
the project life cycle.

Stage3: Designing the Software

The next phase is about to bring down all the knowledge of requirements, analysis,
and design of the software project. This phase is the product of the last two, like inputs
from the customer and requirement gathering.

Stage4: Developing the project

In this phase of SDLC, the actual development begins, and the programming is built.
The implementation of design begins concerning writing code. Developers have to
follow the coding guidelines described by their management and programming tools
like compilers, interpreters, debuggers, etc. are used to develop and implement the
code.

Stage5: Testing

After the code is generated, it is tested against the requirements to make sure that the
products are solving the needs addressed and gathered during the requirements stage.
During this stage, unit testing, integration testing, system testing, acceptance testing
are done.

Stage6: Deployment

Once the software is certified, and no bugs or errors are stated, then it is deployed.

Then based on the assessment, the software may be released as it is or with suggested
enhancement in the object segment.

After the software is deployed, then its maintenance begins.

Stage7: Maintenance

Once when the client starts using the developed systems, then the real issues come up
and requirements to be solved from time to time.

This procedure where the care is taken for the developed product is known as
maintenance.

SDLC (Models)
There are various software development life cycle models specify and designed which
are followed during the software development process. These models are also referred
as Software Development Process Models". Each process model follows a sequence
of steps unique to its type to ensure success in the process of software development.
Here, are some important phases of SDLC life cycle:
Waterfall Model:
The waterfall is a universally accepted SDLC model. In this method, the whole process
of software development is divided into various phases. In this SDLC model, the result
of one aspect acts as the input for the next step.
This SDLC model is documentation-intensive, with previous phases documenting
what need be performed in the subsequent phases.
RAD Model:
RAD or Rapid Application Development process is an adoption of the waterfall model;
it targets developing software in a short period. SDLC RAD model has the following
phases
Business Modeling
Data Modeling
Process Modeling
Application Generation
Testing and Turnover

Spiral Model:
The spiral model is a risk-driven process model. This SDLC model helps the group to
adopt elements of one or more process models like a waterfall, incremental, waterfall,
etc.
V-Model:
In this type of SDLC model testing and the development, the step is planned in parallel.
So, there are verification phases on the side and the validation phase on the other side.
V-Model joins by Coding phase.
Incremental Model: The incremental model is not a separate model. It is necessarily a
series of waterfall cycles. The requirements are divided into groups at the start of the
project. For each group, the SDLC model is followed to develop software. The SDLC
process is repeated, with each release adding more functionality until all requirements
are met. In this method, each cycle act as the maintenance phase for the previous
software release. Modification to the incremental model allows development cycles to
overlap. After that subsequent cycle may begin before the previous cycle is complete.
Agile Model:
Agile methodology is a practice which promotes continues interaction of development
and testing during the SDLC process of any project. In the Agile method, the entire
project is divided into small incremental builds. All of these builds are provided in
iterations, and each iteration lasts from one to three weeks.
Iterative Model:
It is a particular implementation of a software development life cycle that focuses on
an initial, simplified implementation, which then progressively gains more complexity
and a broader feature set until the final system is complete. In short, iterative
development is a way of breaking down the software development of a large
application into smaller pieces.
Big bang model:
Big bang model is focusing on all types of resources in software development and
coding, with no or very little planning. The requirements are understood and
implemented when they come.
This model works best for small projects with smaller size development team which
are working together. It is also useful for academic software development projects. It
is an ideal model where requirements are either unknown or final release date is not
given.

Spiral Model:
The spiral model is a risk-driven process model. This SDLC model helps the team to
adopt elements of one or more process models like a waterfall, incremental, waterfall,
etc.
This model adopts the best features of the prototyping model and the waterfall model.
The spiral methodology is a combination of rapid prototyping and concurrency in
design and development activities.

Waterfall model:

Winston Royce introduced the Waterfall Model in 1970.This model has five phases:
Requirements analysis and specification, design, implementation, and unit testing,
integration and system testing, and operation and maintenance. The steps always
follow in this order and do not overlap. The developer must complete every phase
before the next phase begins. This model is named "Waterfall Model", because its
diagrammatic representation resembles a cascade of waterfalls.

Requirements analysis and specification phase: The aim of this phase is to


understand the exact requirements of the customer and to document them properly.
Both the customer and the software developer work together so as to document all the
functions, performance, and interfacing requirement of the software. It describes the
"what" of the system to be produced and not "how."In this phase, a large document
called Software Requirement Specification (SRS) document is created which
contained a detailed description of what the system will do in the common language.
Design Phase: This phase aims to transform the requirements gathered in the SRS into
a suitable form which permits further coding in a programming language. It defines
the overall software architecture together with high level and detailed design. All this
work is documented as a Software Design Document (SDD).

Implementation and unit testing: During this phase, design is implemented. If the
SDD is complete, the implementation or coding phase proceeds smoothly, because all
the information needed by software developers is contained in the SDD.

During testing, the code is thoroughly examined and modified. Small modules are
tested in isolation initially. After that these modules are tested by writing some
overhead code to check the interaction between these modules and the flow of
intermediate output.

Integration and System Testing: This phase is highly crucial as the quality of the end
product is determined by the effectiveness of the testing carried out. The better output
will lead to satisfied customers, lower maintenance costs, and accurate results. Unit
testing determines the efficiency of individual modules. However, in this phase, the
modules are tested for their interactions with each other and with the system.

Operation and maintenance phase: Maintenance is the task performed by every user
once the software has been delivered to the customer, installed, and operational.
When to use SDLC Waterfall Model?

Some Circumstances where the use of the Waterfall model is most suited are:

When the requirements are constant and not changed regularly.

A project is short

The situation is calm

Where the tools and technology used is consistent and is not changing

When resources are well prepared and are available to use.

Advantages of Waterfall model

This model is simple to implement also the number of resources that are required for
it is minimal.

The requirements are simple and explicitly declared; they remain unchanged during
the entire project development.

The start and end points for each phase is fixed, which makes it easy to cover progress.

The release date for the complete product, as well as its final cost, can be determined
before development.

It gives easy to control and clarity for the customer due to a strict reporting system.

Disadvantages of Waterfall model

In this model, the risk factor is higher, so this model is not suitable for more significant
and complex projects.

This model cannot accept the changes in requirements during development.

It becomes tough to go back to the phase. For example, if the application has now
shifted to the coding phase, and there is a change in requirement, It becomes tough to
go back and change it.

Since the testing done at a later stage, it does not allow identifying the challenges and
risks in the earlier phase, so the risk reduction strategy is difficult to prepare.
RAD (Rapid Application Development) Model:

RAD is a linear sequential software development process model that emphasizes a


concise development cycle using an element based construction approach. If the
requirements are well understood and described, and the project scope is a constraint,
the RAD process enables a development team to create a fully functional system within
a concise time period.

RAD (Rapid Application Development) is a concept that products can be developed


faster and of higher quality through:

Gathering requirements using workshops or focus groups

Prototyping and early, reiterative user testing of designs

The re-use of software components

A rigidly paced schedule that refers design improvements to the next product version

Less formality in reviews and other team communication


The various phases of RAD are as follows:

1.Business Modelling: The information flow among business functions is defined by


answering questions like what data drives the business process, what data is generated,
who generates it, where does the information go, who process it and so on.

2. Data Modelling: The data collected from business modeling is refined into a set of
data objects (entities) that are needed to support the business. The attributes (character
of each entity) are identified, and the relation between these data objects (entities) is
defined.

Process Modelling: The information object defined in the data modeling phase are
transformed to achieve the data flow necessary to implement a business function.
Processing descriptions are created for adding, modifying, deleting, or retrieving a data
object.

Application Generation: Automated tools are used to facilitate construction of the


software; even they use the 4th GL techniques.

Testing & Turnover: Many of the programming components have already been tested
since RAD emphasis reuse. This reduces the overall testing time. But the new part
must be tested, and all interfaces must be fully exercised.

When to use RAD Model?

When the system should need to create the project that modularizes in a short span
time (2-3 months).

When the requirements are well-known.

When the technical risk is limited.

When there's a necessity to make a system, which modularized in 2-3 months of period.

It should be used only if the budget allows the use of automatic code generating tools.

Advantage of RAD Model

This model is flexible for change.

In this model, changes are adoptable.

Each phase in RAD brings highest priority functionality to the customer.


It reduced development time.

It increases the reusability of features.

Disadvantage of RAD Model

It required highly skilled designers.

All application is not compatible with RAD.

For smaller projects, we cannot use the RAD model.

On the high technical risk, it's not suitable.

Required user involvement.


Spiral Model :

The Spiral Model, initially suggested by Bohem, is an evolutionary software process


model that couples the iterative nature of prototyping with the controlled and
systematic aspects of the linear sequential model. Using the Spiral model, the software
is developed in order of incremental releases. It provides the potential for rapid
development of incremental version of the software. A spiral model is divided into
several framework activities also called task regions. Typically, there are between
three & six task regions.

Customer communication- tasks required to establish effective communication


between developer & customer.

Planning- Determination of objectives, alternatives, and constraints.

Risk Analysis- Analysis alternatives and attempts to identify and resolve the risks
involved

Development- Product Development & Testing product

Assessment-Customer Evaluation

Each of the regions is populated by a set of work tasks called a task set, they are
adapted to the characteristics of the project to be undertaken. For a small project, the
number of work tasks and their formality is low. For a larger, more critical project,
each task region contains more work tasks that are defined to achieve a higher level of
formality.
When to use Spiral Model?

When deliverance is required to be frequent.

When the project is large

When requirements are unclear and complex

When changes may require at any time

Large and high budget projects

Advantages

High amount of risk analysis

Good for large and mission-critical projects.

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.


What is RAD Model? Advantages & Disadvantages Or What is RAD (Rapid
Application Development) Model?

RAD or Rapid Application Development process is an adoption of the waterfall model;


it targets at developing software in a short span of time. RAD follow the iterative

SDLC RAD model has following phases

Business Modeling

Data Modeling

Process Modeling

Application Generation

Testing and Turnover

It focuses on input-output source and destination of the information. It emphasizes on


delivering projects in small pieces; the larger projects are divided into a series of
smaller projects. The main features of RAD model are that it focuses on the reuse of
templates, tools, processes, and code.
RAD Model in Software Engineering

Different phases of RAD model includes

Phases of
Activities performed in RAD Model
RAD model

Business On basis of the flow of information and distribution between various


Modeling business channels, the product is designed
Data The information collected from business modeling is refined into a set
Modeling of data objects that are significant for the business

Process The data object that is declared in the data modeling phase is
transformed to achieve the information flow necessary to implement a
Modeling
business function
Application Automated tools are used for the construction of the software, to
Generation convert process and data models into prototypes
Testing and As prototypes are individually tested during every iteration, the overall
Turnover testing time is reduced in RAD.

When to use RAD Methodology?

1. When a system needs to be produced in a short span of time (2-3 months)


2. When the requirements are known
3. When the user will be involved all through the life cycle
4. When technical risk is less
5. When there is a necessity to create a system that can be modularized in 2-3 months
of time
6. When a budget is high enough to afford designers for modeling along with the cost
of automated tools for code generation
Advantages and Disadvantages of SDLC RAD Model

Advantages Disadvantages

Flexible and adaptable to changes It can't be used for smaller projects


It is useful when you have to reduce the Not all application is compatible with
overall project risk RAD
When technical risk is high, it is not
It is adaptable and flexible to changes
suitable
It is easier to transfer deliverables as If developers are not committed to
scripts, high-level abstractions and delivering software on time, RAD
intermediate codes are used projects can fail
Reduced features due to time boxing,
Due to code generators and code reuse,
where features are pushed to a later
there is a reduction of manual coding
version to finish a release in short period
Reduced scalability occurs because a
Due to prototyping in nature, there is a RAD developed application begins as a
possibility of lesser defects prototype and evolves into a finished
application
Progress and problems accustomed are
Each phase in RAD delivers highest hard to track as such there is no
priority functionality to client documentation to demonstrate what has
been done
With less people, productivity can be Requires highly skilled designers or
increased in short time developers
What is Spiral Model? When to Use? Advantages & Disadvantages

What is Spiral Model?

Spiral Model is a combination of a waterfall model and iterative model. Each phase in
spiral model begins with a design goal and ends with the client reviewing the progress.
The spiral model was first mentioned by Barry Boehm in his 1986 paper.

The development team in Spiral-SDLC model starts with a small set of requirement
and goes through each development phase for those set of requirements. The software
engineering team adds functionality for the additional requirement in every-increasing
spirals until the application is ready for the production phase.

Spiral Model Phases

Spiral Model Phases Activities performed during phase

It includes estimating the cost, schedule and resources for


Planning the iteration. It also involves understanding the system
requirements for continuous communication between the
system analyst and the customer
Identification of potential risk is done while risk
Risk Analysis
mitigation strategy is planned and finalized
It includes testing, coding and deploying software at the
Engineering
customer site
Evaluation of software by the customer. Also, includes
Evaluation identifying and monitoring risks such as schedule
slippage and cost overrun
When to use Spiral Methodology?

1. When project is large


2. When releases are required to be frequent
3. When creation of a prototype is applicable
4. When risk and costs evaluation is important
5. For medium to high-risk projects
6. When requirements are unclear and complex
7. When changes may require at any time
8. When long term project commitment is not feasible due to changes in economic
priorities

Advantages and Disadvantages of Spiral Model


Advantages Disadvantages
Additional functionality or changes can Risk of not meeting the schedule or
be done at a later stage budget
Cost estimation becomes easy as the
It works best for large projects only also
prototype building is done in small
demands risk assessment expertise
fragments
Continuous or repeated development For its smooth operation spiral model
helps in risk management protocol needs to be followed strictly
Development is fast and features are Documentation is more as it has
added in a systematic way intermediate phases
There is always a space for customer It is not advisable for smaller project, it
feedback might cost them a lot
V-Model

V-Model also referred to as the Verification and Validation Model. In this, each phase
of SDLC must complete before the next phase starts. It follows a sequential design
process same as the waterfall model. Testing of the device is planned in parallel with
a corresponding stage of development.

Verification: It involves a static analysis method (review) done without executing


code. It is the process of evaluation of the product development process to find whether
specified requirements meet.

Validation: It involves dynamic analysis method (functional, non-functional), testing


is done by executing code. Validation is the process to classify the software after the
completion of the development process to determine whether the software meets the
customer expectations and requirements.

So V-Model contains Verification phases on one side of the Validation phases on the
other side. Verification and Validation process is joined by coding phase in V-shape.
Thus it is known as V-Model.

There are the various phases of Verification Phase of V-model:

Business requirement analysis: This is the first step where product requirements
understood from the customer's side. This phase contains detailed communication to
understand customer's expectations and exact requirements.

System Design: In this stage system engineers analyze and interpret the business of
the proposed system by studying the user requirements document.
Architecture Design: The baseline in selecting the architecture is that it should
understand all which typically consists of the list of modules, brief functionality of
each module, their interface relationships, dependencies, database tables, architecture
diagrams, technology detail, etc. The integration testing model is carried out in a
particular phase.

Module Design: In the module design phase, the system breaks down into small
modules. The detailed design of the modules is specified, which is known as Low-
Level Design

Coding Phase: After designing, the coding phase is started. Based on the
requirements, a suitable programming language is decided. There are some guidelines
and standards for coding. Before checking in the repository, the final build is optimized
for better performance, and the code goes through many code reviews to check the
performance.

There are the various phases of Validation Phase of V-model:

Unit Testing: In the V-Model, Unit Test Plans (UTPs) are developed during the
module design phase. These UTPs are executed to eliminate errors at code level or unit
level. A unit is the smallest entity which can independently exist, e.g., a program
module. Unit testing verifies that the smallest entity can function correctly when
isolated from the rest of the codes/ units.

Integration Testing: Integration Test Plans are developed during the Architectural
Design Phase. These tests verify that groups created and tested independently can
coexist and communicate among themselves.

System Testing: System Tests Plans are developed during System Design Phase.
Unlike Unit and Integration Test Plans, System Tests Plans are composed by the
client?s business team. System Test ensures that expectations from an application
developer are met.

Acceptance Testing: Acceptance testing is related to the business requirement


analysis part. It includes testing the software product in user atmosphere. Acceptance
tests reveal the compatibility problems with the different systems, which is available
within the user atmosphere. It conjointly discovers the non-functional problems like
load and performance defects within the real user atmosphere.

When to use V-Model?

When the requirement is well defined and not ambiguous.


The V-shaped model should be used for small to medium-sized projects where
requirements are clearly defined and fixed.

The V-shaped model should be chosen when sample technical resources are available
with essential technical expertise.

Advantage (Pros) of V-Model:

Easy to Understand.

Testing Methods like planning, test designing happens well before coding.

This saves a lot of time. Hence a higher chance of success over the waterfall model.

Avoids the downward flow of the defects.

Works well for small plans where requirements are easily understood.

Disadvantage (Cons) of V-Model:

Very rigid and least flexible.

Not a good for a complex project.

Software is developed during the implementation stage, so no early prototypes of the


software are produced.

If any changes happen in the midway, then the test documents along with the required
documents, has to be updated.

Incremental Model

Incremental Model is a process of software development where requirements divided


into multiple standalone modules of the software development cycle. In this model,
each module goes through the requirements, design, implementation and testing
phases. Every subsequent release of the module adds function to the previous release.
The process continues until the complete system achieved.
The various phases of incremental model are as follows:

Requirement analysis: In the first phase of the incremental model, the product
analysis expertise identifies the requirements. And the system functional requirements
are understood by the requirement analysis team. To develop the software under the
incremental model, this phase performs a crucial role.

Design & Development: In this phase of the Incremental model of SDLC, the design
of the system functionality and the development method are finished with success.
When software develops new practicality, the incremental model uses style and
development phase.

Testing: In the incremental model, the testing phase checks the performance of each
existing function as well as additional functionality. In the testing phase, the various
methods are used to test the behavior of each task.

Implementation: Implementation phase enables the coding phase of the development


system. It involves the final coding that design in the designing and development phase
and tests the functionality in the testing phase. After completion of this phase, the
number of the product working is enhanced and upgraded up to the final system
product

When we use the Incremental Model?

When the requirements are superior.

A project has a lengthy development schedule.

When Software team are not very well skilled or trained.


When the customer demands a quick release of the product.

You can develop prioritized requirements first.

Advantage of Incremental Model

Errors are easy to be recognized.

Easier to test and debug

More flexible.

Simple to manage risk because it handled during its iteration.

The Client gets important functionality early.

Disadvantage of Incremental Model

Need for good planning

Total Cost is high.

Well defined module interfaces are needed.

Incremental Model in SDLC: Use, Advantage & Disadvantage

What is Incremental Model?

Incremental Model is a process of software development where requirements are


broken down into multiple standalone modules of software development cycle.
Incremental development is done in steps from analysis design, implementation,
testing/verification, maintenance.
Each iteration passes through the requirements, design, coding and testing phases.
And each subsequent release of the system adds function to the previous release until
all designed functionality has been implemented.

The system is put into production when the first increment is delivered. The first
increment is often a core product where the basic requirements are addressed, and
supplementary features are added in the next increments. Once the core product is
analyzed by the client, there is plan development for the next increment.

Characteristics of an Incremental module includes

System development is broken down into many mini development projects

Partial systems are successively built to produce a final total system

Highest priority requirement is tackled first

Once the requirement is developed, requirement for that increment are frozen
Incremental Phases Activities performed in incremental phases

Requirement Requirement and specification of the software are


Analysis collected
Design Some high-end function are designed during this stage
Code Coding of software is done during this stage
Once the system is deployed, it goes through the testing
Test
phase

When to use Incremental models?

Requirements of the system are clearly understood

When demand for an early release of a product arises

When software engineering team are not very well skilled or trained

When high-risk features and goals are involved

Such methodology is more in use for web application and product based companies

Advantages and Disadvantages of Incremental Model

Advantages Disadvantages
The software will be generated quickly
It requires a good planning designing
during the software life cycle
Problems might cause due to system
It is flexible and less expensive to architecture as such not all requirements
change requirements and scope collected up front for the entire software
lifecycle
Thought the development stages Each iteration phase is rigid and does not
changes can be done overlap each other
Rectifying a problem in one unit requires
This model is less costly compared to
correction in all the units and consumes a
others
lot of time
A customer can respond to each
building
Errors are easy to be identified

RUP is a software development process from Rational, a division of IBM. It divides


the development process into four distinct phases that each involve business modeling,
analysis and design, implementation, testing, and deployment. The four phases are:

Inception - The idea for the project is stated. The development team determines if the
project is worth pursuing and what resources will be needed.

Elaboration - The project's architecture and required resources are further evaluated.
Developers consider possible applications of the software and costs associated with
the development.

Construction - The project is developed and completed. The software is designed,


written, and tested.

Transition - The software is released to the public. Final adjustments or updates are
made based on feedback from end users.

The RUP development methodology provides a structured way for companies to


envision create software programs. Since it provides a specific plan for each step of
the development process, it helps prevent resources from being wasted and reduces
unexpected development costs.

The emerging Web engineering discipline deals with the process of developing Web-
based systems and applications. This includes theoretical principles and systematic,
disciplined and quantifiable approaches towards the cost-effective development and
evolution of highquality, ubiquitously usable Web-based systems and applications. It
fundamentally concerns the technology which enables the construction of Web
applications.

Web Engineering includes the following areas:


Web Process & Project Management Disciplines

Web Requirements Modeling Disciplines

Web System Design Disciplines, Tools & Methods

Web System Implementation Disciplines

Web System Testing Disciplines

Web Applications Categories Disciplines

Currently, Web engineering does not provide a unique and systematic approach to the
development process containing process models, architectures, suitable techniques and
methods with quality assurance. As a result, Web engineering is still struggling to
establish itself as a reliable engineering discipline. The cost of poor reliability and
effectiveness has serious consequences for the acceptability of the systems. One of the
main reasons for the low acceptance of Web-based applications could be the gap
between design models and the implementation model of the Web.

Object Oriented Approach

In the object-oriented approach, the focus is on capturing the structure and behavior of
information systems into small modules that combines both data and process. The
main aim of Object Oriented Design (OOD) is to improve the quality and productivity
of system analysis and design by making it more usable.

In analysis phase, OO models are used to fill the gap between problem and solution. It
performs well in situation where systems are undergoing continuous design, adaption,
and maintenance. It identifies the objects in problem domain, classifying them in terms
of data and behavior.

The OO model is beneficial in the following ways −

It facilitates changes in the system at low cost.


It promotes the reuse of components.

It simplifies the problem of integrating components to configure large system.

It simplifies the design of distributed systems.

Elements of Object-Oriented System

Let us go through the characteristics of OO System −

Objects − An object is something that is exists within problem domain and can be
identified by data (attribute) or behavior. All tangible entities (student, patient) and
some intangible entities (bank account) are modeled as object.

Attributes − They describe information about the object.

Behavior − It specifies what the object can do. It defines the operation performed on
objects.

Class − A class encapsulates the data and its behavior. Objects with similar meaning
and purpose grouped together as class.

Methods − Methods determine the behavior of a class. They are nothing more than an
action that an object can perform.

Message − A message is a function or procedure call from one object to another. They
are information sent to objects to trigger methods. Essentially, a message is a function
or procedure call from one object to another.

Features of Object-Oriented System

An object-oriented system comes with several great features which are discussed
below.

Encapsulation

Encapsulation is a process of information hiding. It is simply the combination of


process and data into a single entity. Data of an object is hidden from the rest of the
system and available only through the services of the class. It allows improvement or
modification of methods used by objects without affecting other parts of a system.
Abstraction

It is a process of taking or selecting necessary method and attributes to specify the


object. It focuses on essential characteristics of an object relative to perspective of
user.

Relationships

All the classes in the system are related with each other. The objects do not exist in
isolation, they exist in relationship with other objects.

There are three types of object relationships −

Aggregation − It indicates relationship between a whole and its parts.

Association − In this, two classes are related or connected in some way such as one
class works with another to perform a task or one class acts upon other class.

Generalization − The child class is based on parent class. It indicates that two classes
are similar but have some differences.

Inheritance

Inheritance is a great feature that allows to create sub-classes from an existing class by
inheriting the attributes and/or operations of existing classes.

Polymorphism and Dynamic Binding

Polymorphism is the ability to take on many different forms. It applies to both objects
and operations. A polymorphic object is one who true type hides within a super or
parent class.

In polymorphic operation, the operation may be carried out differently by different


classes of objects. It allows us to manipulate objects of different classes by knowing
only their common properties.

UML is popular for its diagrammatic notations. We all know that UML is for
visualizing, specifying, constructing and documenting the components of software and
non-software systems. Hence, visualization is the most important part which needs to
be understood and remembered.

UML notations are the most important elements in modeling. Efficient and appropriate
use of notations is very important for making a complete and meaningful model. The
model is useless, unless its purpose is depicted properly.
What is Class?

A Class is a blueprint that is used to create Object. The Class defines what object can
do.

What is Class Diagram?

Class Diagram gives the static view of an application. A class diagram describes the
types of objects in the system and the different types of relationships that exist among
them. This modeling method can run with almost all Object-Oriented Methods. A class
can refer to another class. A class can have its objects or may inherit from other classes.

UML Class Diagram gives an overview of a software system by displaying classes,


attributes, operations, and their relationships. This Diagram includes the class name,
attributes, and operation in separate designated compartments.

Class Diagram helps construct the code for the software application development.

Benefits of Class Diagram

Class Diagram Illustrates data models for even very complex information systems

It provides an overview of how the application is structured before studying the actual
code. This can easily reduce the maintenance time

It helps for better understanding of general schematics of an application.

Allows drawing detailed charts which highlights code required to be programmed

Helpful for developers and other stakeholders.

Essential elements of A UML class diagram

Essential elements of UML class diagram are:

Class Name

Attributes

Operations
Class Name

The name of the class is only needed in the graphical representation of the class. It
appears in the topmost compartment. A class is the blueprint of an object which can
share the same relationships, attributes, operations, & semantics. The class is rendered
as a rectangle, including its name, attributes, and operations in sperate compartments.

Following rules must be taken care of while representing a class:

A class name should always start with a capital letter.

A class name should always be in the center of the first compartment.

A class name should always be written in bold format.

An abstract class name should be written in italics format.

Attributes:

An attribute is named property of a class which describes the object being modeled. In
the class diagram, this component is placed just below the name-compartment.

A derived attribute is computed from other attributes. For example, an age of the
student can be easily computed from his/her birth date.
Attributes characteristics

The attributes are generally written along with the visibility factor.

Public, private, protected and package are the four visibilities which are denoted by +,
-, #, or ~ signs respectively.

Visibility describes the accessibility of an attribute of a class.

Attributes must have a meaningful name that describes the use of it in a class.

Relationships

There are mainly three kinds of relationships in UML:

Dependencies

Generalizations

Associations

Dependency

A dependency means the relation between two or more classes in which a change in
one may force changes in the other. However, it will always create a weaker
relationship. Dependency indicates that one class depends on another.

In the following example, Student has a dependency on College


Generalization:

A generalization helps to connect a subclass to its superclass. A sub-class is inherited


from its superclass. Generalization relationship can't be used to model interface
implementation. Class diagram allows inheriting from multiple super classes.

In this example, the class Student is generalized from Person Class.

Association:

This kind of relationship represents static relationships between classes A and B. For
example; an employee works for an organization.

Here are some rules for Association:

Association is mostly verb or a verb phrase or noun or noun phrase.

It should be named to indicate the role played by the class attached at the end of the
association path.

Mandatory for reflexive associations

In this example, the relationship between student and college is shown which is
studies.
Multiplicity

A multiplicity is a factor associated with an attribute. It specifies how many instances


of attributes are created when a class is initialized. If a multiplicity is not specified, by
default one is considered as a default multiplicity.

Let's say that that there are 100 students in one college. The college can have multiple
students.

Aggregation
Aggregation is a special type of association that models a whole- part relationship
between aggregate and its parts.

For example, the class college is made up of one or more student. In aggregation, the
contained classes are never totally dependent on the lifecycle of the container. Here,
the college class will remain even if the student is not available.

Composition:

The composition is a special type of aggregation which denotes strong ownership


between two classes when one class is a part of another class.

For example, if college is composed of classes student. The college could contain
many students, while each student belongs to only one college. So, if college is not
functioning all the students also removed.

Aggregation vs. Composition

Aggregation Composition
Composition display relationship
Aggregation indicates a relationship
where the child will never exist
where the child can exist separately from
independent of the parent. Example:
their parent class. Example: Automobile
House (parent) and Room (child).
(Parent) and Car (Child). So, If you delete
Rooms will never separate into a
the Automobile, the child Car still exist.
House.
Abstract Classes

It is a class with an operation prototype, but not the implementation. It is also possible
to have an abstract class with no operations declared inside of it. An abstract is useful
for identifying the functionalities across the classes. Let us consider an example of an
abstract class. Suppose we have an abstract class called as a motion with a method or
an operation declared inside of it. The method declared inside the abstract class is
called a move ().

This abstract class method can be used by any object such as a car, an animal, robot,
etc. for changing the current position. It is efficient to use this abstract class method
with an object because no implementation is provided for the given function. We can
use it in any way for multiple objects.

In UML, the abstract class has the same notation as that of the class. The only
difference between a class and an abstract class is that the class name is strictly written
in an italic font.

An abstract class cannot be initialized or instantiated.

Abstract Class Notation


In the above abstract class notation, there is the only a single abstract method which
can be used by multiple objects of classes.

Example of UML Class Diagram

Creating a class diagram is a straightforward process. It does not involve many


technicalities. Here, is an example:

ATMs system is very simple as customers need to press some buttons to receive cash.
However, there are multiple security layers that any ATM system needs to pass. This
helps to prevent fraud and provide cash or need details to banking customers.

Below given is a UML Class Diagram example:

Class Diagram in Software Development Lifecycle

Class diagrams can be used in various software development phases. It helps in


modeling class diagrams in three different perspectives.
Conceptual perspective: Conceptual diagrams are describing things in the real world.
You should draw a diagram that represents the concepts in the domain under study.
These concepts related to class and it is always language-independent.

Specification perspective: Specification perspective describes software abstractions


or components with specifications and interfaces. However, it does not give any
commitment to specific implementation.

Implementation perspective: This type of class diagrams is used for implementations


in a specific language or application. Implementation perspective, use for software
implementation.

Best practices of Designing of the Class Diagram

Class diagrams are the most important UML diagrams used for software application
development. There are many properties which should be considered while drawing a
Class Diagram. They represent various aspects of a software application.

Here, are some points which should be kept in mind while drawing a class diagram:

The name given to the class diagram must be meaningful. Moreover, It should describe
the real aspect of the system.

The relationship between each element needs to be identified in advance.

The responsibility for every class needs to be identified.

For every class, minimum number of properties should be specified. Therefore,


unwanted properties can easily make the diagram complicated.

User notes should be included whenever you need to define some aspect of the
diagram. At the end of the drawing, it must be understandable for the software
development team.

Lastly, before creating the final version, the diagram needs to be drawn on plain paper.
Moreover, It should be reworked until it is ready for final submission.

Conclusion
UML is the standard language for specifying, designing, and visualizing the artifacts
of software systems

A class is a blueprint for an object

A class diagram describes the types of objects in the system and the different kinds of
relationships which exist among them

It allows analysis and design of the static view of a software application

Class diagrams are most important UML diagrams used for software application
development

Essential elements of UML class diagram are 1) Class 2) Attributes 3) Relationships

Class Diagram provides an overview of how the application is structured before


studying the actual code. It certainly reduces the maintenance time

What is a Class Diagram?

Suppose you have to design a system. Before implementating a bunch of classes, you’ll
want to have a conceptual understanding of the system — that is, what classes do I
need? What functionality and information will these classes have? How do they
interact with one another? Who can see these classes? And so on.

That’s where class diagrams come in. Class diagrams are a neat way of visualizing the
classes in your system before you actually start coding them up. They’re a static
representation of your system structure.
Example of a Class Diagram for a Banking System

This is a fairly simple diagram. However, as your system scales and grows, it becomes
increasingly difficult to keep track of all these relationships. Having a precise,
organized, and straight-forward diagram to do that for you is integral to the success of
your system.

Why do we need class diagrams?

Planning and modeling ahead of time make programming much easier.

Besides that, making changes to class diagrams is easy, whereas coding differnent
functionality after the fact is kind of annoying.

When someone wants to build a house, they don’t just grab a hammer and get to work.
They need to have a blueprint — a design plan — so they can ANALYZE & modify
their system.

You don’t need much technical/language-specific knowledge to understand it.

Some Technical Stuff


Class Representation in UML

A class is represented as a box with 3 compartments. The uppermost one contains the
class name. The middle one contains the class attributes and the last one contains the
class methods. Like this:

They adhere to the following convention:

attribute name : type

method name (parameter: type)

if you’d like to set a default value to an attribute do as above balance : Dollars = 0

if a method doesn’t take any parameters then leave the parentheses empty. Ex:
checkBalance()

Visibility of Class Members

Class members (attributes and methods) have a specific visibility assigned to them.
See table below for how to represent them in UML.

visibility and how to denote it


Let’s specify the visibility of the members of the BankAccount class above.

We made the `owner` and balance private as well as the withdraw method. But we kept
the deposit method public. (Anyone can put money in, but not everyone can take
money out. Just as we like it.)

Relationships

Summary of types of relationships and their notation

Association

a relationship between two separate classes. It joins two entirely separate entities.
There are four different types of association: bi-directional, uni-directional,
aggregation (includes composition aggregation) and reflexive. Bi-directional and uni-
directional associations are the most common ones.

This can be specified using multiplicity (one to one, one to many, many to many, etc.).

A typical implementation in Java is through the use of an instance field. The


relationship can be bi-directional with each class holding a reference to the other.

Inheritance
Indicates that child (subclass) is considered to be a specialized form of the parent
(super class). For example consider the following:

Above we have an animal parent class with all public member fields. You can see the
arrows originating from the duck, fish, and zebra child classes which indicate they
inherit all the members from the animal class. Not only that, but they also implement
their own unique member fields. You can see that the duck class has a swim() method
as well as a quack() method.

Realization/Implementation

a relationship between two model elements, in which one model element


implements/executes the behavior that the other model element specifies.
example of implements

Dependency

Aggregation

a special form of association which is a unidirectional (a.k.a one way) relationship


between classes. The best way to understand this relationship is to call it a “has a” or
“is part of” relationship. For example, consider the two classes: Wallet and Money. A
wallet “has” money. But money doesn’t neccessarily need to have a wallet so it’s a
one directional relationship.

Composition

a restricted form of Aggregation in which two entities (or you can say classes) are
highly dependent on each other.

Multiplicity

after specificyfing the type of association relationship by connecting the classes, you
can also declare the cardinality between the associated entities. For example:
The above UML diagram shows that a house has exactly one kitchen, exactly one bath,
atleast one bedroom (can have many), exactly one mailbox, and at most one mortgage
(zero or one).

UML (Unified Modeling Language) is a standard language for specifying, visualizing,


constructing, and documenting the artifacts of software systems.

UML diagrams are not only made for developers but also for business users, common
people, and anybody interested to understand the system. The system can be a software
or non-software system. Thus it must be clear that UML is not a development method
rather it accompanies with processes to make it a successful system.

As UML describes the real-time systems, it is very important to make a conceptual


model and then proceed gradually. The conceptual model of UML can be mastered by
learning the following three major elements −
UML building blocks

Rules to connect the building blocks

Common mechanisms of UML

This chapter describes all the UML building blocks. The building blocks of UML can
be defined as −

Things

Relationships

Diagrams

Things

Things are the most important building blocks of UML. Things can be −

Structural

Behavioral

Grouping

Annotational

Structural Things

Structural things define the static part of the model. They represent the physical and
conceptual elements. Following are the brief descriptions of the structural things.

Class − Class represents a set of objects having similar responsibilities.

Interface − Interface defines a set of operations, which specify the responsibility of a


class.
Collaboration −Collaboration defines an interaction between elements.

Use case −Use case represents a set of actions performed by a system for a specific
goal.

Component −Component describes the physical part of a system.

Node − A node can be defined as a physical element that exists at run time.

Behavioral Things

A behavioral thing consists of the dynamic parts of UML models. Following are the
behavioral things −

Interaction − Interaction is defined as a behavior that consists of a group of messages


exchanged among elements to accomplish a specific task.

State machine − State machine is useful when the state of an object in its life cycle is
important. It defines the sequence of states an object goes through in response to
events. Events are external factors responsible for state change
Grouping Things

Grouping things can be defined as a mechanism to group elements of a UML model


together. There is only one grouping thing available −

Package − Package is the only one grouping thing available for gathering structural
and behavioral things.

Annotational Things

Annotational things can be defined as a mechanism to capture remarks, descriptions,


and comments of UML model elements. Note - It is the only one Annotational thing
available. A note is used to render comments, constraints, etc. of an UML element.

Relationship

Relationship is another most important building block of UML. It shows how the
elements are associated with each other and this association describes the functionality
of an application.

There are four kinds of relationships available.

Dependency

Dependency is a relationship between two things in which change in one element also
affects the other.

Association

Association is basically a set of links that connects the elements of a UML model. It
also describes how many objects are taking part in that relationship.
Generalization

Generalization can be defined as a relationship which connects a specialized element


with a generalized element. It basically describes the inheritance relationship in the
world of objects.

Realization

Realization can be defined as a relationship in which two elements are connected. One
element describes some responsibility, which is not implemented and the other one
implements them. This relationship exists in case of interfaces.

UML Diagrams

UML diagrams are the ultimate output of the entire discussion. All the elements,
relationships are used to make a complete UML diagram and the diagram represents a
system.

The visual effect of the UML diagram is the most important part of the entire process.
All the other elements are used to make it complete.

UML includes the following nine diagrams, the details of which are described in the
subsequent chapters.

Class diagram

Object diagram

Use case diagram

Sequence diagram

Collaboration diagram

Activity diagram
Statechart diagram

Deployment diagram

Component diagram

Structural Things

Graphical notations used in structural things are most widely used in UML. These are
considered as the nouns of UML models. Following are the list of structural things.

Classes

Object

Interface

Collaboration

Use case

Active classes

Components

Nodes

Class Notation

UML class is represented by the following figure. The diagram is divided into four
parts.

The top section is used to name the class.

The second one is used to show the attributes of the class.

The third section is used to describe the operations performed by the class.

The fourth section is optional to show any additional components.


Classes are used to represent objects. Objects can be anything having properties and
responsibility.

Object Notation

The object is represented in the same way as the class. The only difference is the name
which is underlined as shown in the following figure.

As the object is an actual implementation of a class, which is known as the instance of


a class. Hence, it has the same usage as the class.

Interface Notation

Interface is represented by a circle as shown in the following figure. It has a name


which is generally written below the circle.
Interface is used to describe the functionality without implementation. Interface is just
like a template where you define different functions, not the implementation. When a
class implements the interface, it also implements the functionality as per requirement.

Collaboration Notation

Collaboration is represented by a dotted eclipse as shown in the following figure. It


has a name written inside the eclipse.

Collaboration represents responsibilities. Generally, responsibilities are in a group.

Use Case Notation

Use case is represented as an eclipse with a name inside it. It may contain additional
responsibilities.
Use case is used to capture high level functionalities of a system.

Actor Notation

An actor can be defined as some internal or external entity that interacts with the
system.

An actor is used in a use case diagram to describe the internal or external entities.

Initial State Notation

Initial state is defined to show the start of a process. This notation is used in almost all
diagrams.

The usage of Initial State Notation is to show the starting point of a process.

Final State Notation


Final state is used to show the end of a process. This notation is also used in almost all
diagrams to describe the end.

The usage of Final State Notation is to show the termination point of a process.

Active Class Notation

Active class looks similar to a class with a solid border. Active class is generally used
to describe the concurrent behavior of a system.

Active class is used to represent the concurrency in a system.

Component Notation

A component in UML is shown in the following figure with a name inside. Additional
elements can be added wherever required.

Component is used to represent any part of a system for which UML diagrams are
made.

Node Notation

A node in UML is represented by a square box as shown in the following figure with
a name. A node represents the physical component of the system.
Node is used to represent the physical part of a system such as the server, network, etc.

Behavioral Things

Dynamic parts are one of the most important elements in UML. UML has a set of
powerful features to represent the dynamic part of software and non-software systems.
These features include interactions and state machines.

Interactions can be of two types −

Sequential (Represented by sequence diagram)

Collaborative (Represented by collaboration diagram)

Interaction Notation

Interaction is basically a message exchange between two UML components. The


following diagram represents different notations used in an interaction.
Interaction is used to represent the communication among the components of a system.

State Machine Notation

State machine describes the different states of a component in its life cycle. The
notations are described in the following diagram.
State machine is used to describe different states of a system component. The state can
be active, idle, or any other depending upon the situation.

Grouping Things

Organizing the UML models is one of the most important aspects of the design. In
UML, there is only one element available for grouping and that is package.

Package Notation

Package notation is shown in the following figure and is used to wrap the components
of a system.
Annotational Things

In any diagram, explanation of different elements and their functionalities are very
important. Hence, UML has notes notation to support this requirement.

Note Notation

This notation is shown in the following figure. These notations are used to provide
necessary information of a system.

Relationships

A model is not complete unless the relationships between elements are described
properly. The Relationship gives a proper meaning to a UML model. Following are
the different types of relationships available in UML.

Dependency

Association

Generalization

Extensibility

Dependency Notation

Dependency is an important aspect in UML elements. It describes the dependent


elements and the direction of dependency.

Dependency is represented by a dotted arrow as shown in the following figure. The


arrow head represents the independent element and the other end represents the
dependent element.
Dependency is used to represent the dependency between two elements of a system

Association Notation

Association describes how the elements in a UML diagram are associated. In simple
words, it describes how many elements are taking part in an interaction.

Association is represented by a dotted line with (without) arrows on both sides. The
two ends represent two associated elements as shown in the following figure. The
multiplicity is also mentioned at the ends (1, *, etc.) to show how many objects are
associated.

Association is used to represent the relationship between two elements of a system.

Generalization Notation

Generalization describes the inheritance relationship of the object-oriented world. It is


a parent and child relationship.

Generalization is represented by an arrow with a hollow arrow head as shown in the


following figure. One end represents the parent element and the other end represents
the child element.
Generalization is used to describe parent-child relationship of two elements of a
system.

Extensibility Notation

All the languages (programming or modeling) have some mechanism to extend its
capabilities such as syntax, semantics, etc. UML also has the following mechanisms
to provide extensibility features.

Stereotypes (Represents new elements)

Tagged values (Represents new attributes)

Constraints (Represents the boundaries)

Extensibility notations are used to enhance the power of the language. It is basically
additional elements used to represent some extra behavior of the system. These extra
behaviors are not covered by the standard available notations.
Structured Approach Vs. Object-Oriented Approach

The following table explains how the object-oriented approach differs from the
traditional structured approach −

Structured Approach Object Oriented Approach

It works with Top-down approach. It works with Bottom-up approach.

Program is divided into number of Program is organized by having number


submodules or functions. of classes and objects.

Function call is used. Message passing is used.

Software reuse is not possible. Reusability is possible.

Structured design programming usually Object oriented design programming


left until end phases. done concurrently with other phases.

Structured Design is more suitable for


It is suitable for in-house development.
offshoring.

It shows clear transition from design to Not so clear transition from design to
implementation. implementation.

It is suitable for real time system, It is suitable for most business


embedded system and projects where applications, game development
objects are not the most useful level of projects, which are expected to
abstraction. customize or extended.

Class diagram, sequence diagram, state


DFD & E-R diagram model the data. chart diagram, and use cases all
contribute.

In this approach, projects can be


In this, projects can be managed easily
difficult to manage due to uncertain
due to clearly identifiable phases.
transitions between phase.
Unified Modeling Language (UML)

UML is a visual language that lets you to model processes, software, and systems to
express the design of system architecture. It is a standard language for designing and
documenting a system in an object oriented manner that allow technical architects to
communicate with developer.

It is defined as set of specifications created and distributed by Object Management


Group. UML is extensible and scalable.

The objective of UML is to provide a common vocabulary of object-oriented terms


and diagramming techniques that is rich enough to model any systems development
project from analysis through implementation.

UML is made up of −

Diagrams − It is a pictorial representations of process, system, or some part of it.

Notations − It consists of elements that work together in a diagram such as connectors,


symbols, notes, etc.
Example of UML Notation for class

Instance diagram-UML notation

Operations Performed on Objects

The following operations are performed on the objects −

Constructor/Destructor − Creating new instances of a class and deleting existing


instances of a class. For example, adding a new employee.

Query − Accessing state without changing value, has no side effects. For example,
finding address of a particular employee.
Update − Changes value of one or more attributes & affect state of object For example,
changing the address of an employee.

Uses of UML

UML is quite useful for the following purposes −

Modeling the business process

Describing the system architecture

Showing the application structure

Capturing the system behavior

Modeling the data structure

Building the detailed specifications of the system

Sketching the ideas

Generating the program code

Static Models

Static models show the structural characteristics of a system, describe its system
structure, and emphasize on the parts that make up the system.

They are used to define class names, attributes, methods, signature, and packages.

UML diagrams that represent static model include class diagram, object diagram, and
use case diagram.

Dynamic Models

Dynamic models show the behavioral characteristics of a system, i.e., how the system
behaves in response to external events.

Dynamic models identify the object needed and how they work together through
methods and messages.

They are used to design the logic and behavior of system.

UML diagrams represent dynamic model include sequence diagram, communication


diagram, state diagram, activity diagram.
There are two broad categories of diagrams and they are again divided into
subcategories −

Structural Diagrams

Behavioral Diagrams

Structural Diagrams

The structural diagrams represent the static aspect of the system. These static aspects
represent those parts of a diagram, which forms the main structure and are therefore
stable.

These static parts are represented by classes, interfaces, objects, components, and
nodes. The four structural diagrams are −

Class diagram

Object diagram

Component diagram

Deployment diagram

Class Diagram

Class diagrams are the most common diagrams used in UML. Class diagram consists
of classes, interfaces, associations, and collaboration. Class diagrams basically
represent the object-oriented view of a system, which is static in nature.

Active class is used in a class diagram to represent the concurrency of the system.

Class diagram represents the object orientation of a system. Hence, it is generally used
for development purpose. This is the most widely used diagram at the time of system
construction.

Object Diagram

Object diagrams can be described as an instance of class diagram. Thus, these


diagrams are more close to real-life scenarios where we implement a system.
Object diagrams are a set of objects and their relationship is just like class diagrams.
They also represent the static view of the system.

The usage of object diagrams is similar to class diagrams but they are used to build
prototype of a system from a practical perspective.

Component Diagram

Component diagrams represent a set of components and their relationships. These


components consist of classes, interfaces, or collaborations. Component diagrams
represent the implementation view of a system.

During the design phase, software artifacts (classes, interfaces, etc.) of a system are
arranged in different groups depending upon their relationship. Now, these groups are
known as components.

Finally, it can be said component diagrams are used to visualize the implementation.

Deployment Diagram

Deployment diagrams are a set of nodes and their relationships. These nodes are
physical entities where the components are deployed.

Deployment diagrams are used for visualizing the deployment view of a system. This
is generally used by the deployment team.

Note − If the above descriptions and usages are observed carefully then it is very clear
that all the diagrams have some relationship with one another. Component diagrams
are dependent upon the classes, interfaces, etc. which are part of class/object diagram.
Again, the deployment diagram is dependent upon the components, which are used to
make component diagrams.

Behavioral Diagrams

Any system can have two aspects, static and dynamic. So, a model is considered as
complete when both the aspects are fully covered.

Behavioral diagrams basically capture the dynamic aspect of a system. Dynamic aspect
can be further described as the changing/moving parts of a system.

UML has the following five types of behavioral diagrams −

Use case diagram


Sequence diagram

Collaboration diagram

Statechart diagram

Activity diagram

Use Case Diagram

Use case diagrams are a set of use cases, actors, and their relationships. They represent
the use case view of a system.

A use case represents a particular functionality of a system. Hence, use case diagram
is used to describe the relationships among the functionalities and their
internal/external controllers. These controllers are known as actors.

Sequence Diagram

A sequence diagram is an interaction diagram. From the name, it is clear that the
diagram deals with some sequences, which are the sequence of messages flowing from
one object to another.

Interaction among the components of a system is very important from implementation


and execution perspective. Sequence diagram is used to visualize the sequence of calls
in a system to perform a specific functionality.

Collaboration Diagram

Collaboration diagram is another form of interaction diagram. It represents the


structural organization of a system and the messages sent/received. Structural
organization consists of objects and links.

The purpose of collaboration diagram is similar to sequence diagram. However, the


specific purpose of collaboration diagram is to visualize the organization of objects
and their interaction.

Statechart Diagram

Any real-time system is expected to be reacted by some kind of internal/external


events. These events are responsible for state change of the system.

Statechart diagram is used to represent the event driven state change of a system. It
basically describes the state change of a class, interface, etc.
State chart diagram is used to visualize the reaction of a system by internal/external
factors.

Activity Diagram

Activity diagram describes the flow of control in a system. It consists of activities and
links. The flow can be sequential, concurrent, or branched.

Activities are nothing but the functions of a system. Numbers of activity diagrams are
prepared to capture the entire flow in a system.

Activity diagrams are used to visualize the flow of controls in a system. This is
prepared to have an idea of how the system will work when executed.

Note − Dynamic nature of a system is very difficult to capture. UML has provided
features to capture the dynamics of a system from different angles. Sequence diagrams
and collaboration diagrams are isomorphic, hence they can be converted from one
another without losing any information. This is also true for Statechart and activity
diagram.

UML - Class Diagram

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 object
oriented 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.

Purpose of Class Diagrams

The purpose of class diagram is to model the static view of an application. Class
diagrams are the only diagrams which can be directly mapped with object-oriented
languages and thus widely used at the time of construction.
UML diagrams like activity diagram, sequence diagram can only give the sequence
flow of the application, however class diagram is a bit different. It is the most popular
UML diagram in the coder community.

The purpose of the class diagram can be summarized as −

Analysis and design of the static view of an application.

Describe responsibilities of a system.

Base for component and deployment diagrams.

Forward and reverse engineering.

How to Draw a Class Diagram?

Class diagrams are the most popular UML diagrams used for construction of software
applications. It is very important to learn the drawing procedure of class diagram.

Class diagrams have a lot of properties to consider while drawing but here the diagram
will be considered from a top level view.

Class diagram is basically a graphical representation of the static view of the system
and represents different aspects of the application. A collection of class diagrams
represent the whole system.

The following points should be remembered while drawing a class diagram −

The name of the class diagram should be meaningful to describe the aspect of the
system.

Each element and their relationships should be identified in advance.

Responsibility (attributes and methods) of each class should be clearly identified

For each class, minimum number of properties should be specified, as unnecessary


properties will make the diagram complicated.
Use notes whenever required to describe some aspect of the diagram. At the end of the
drawing it should be understandable to the developer/coder.

Finally, before making the final version, the diagram should be drawn on plain paper
and reworked as many times as possible to make it correct.

The following diagram is an example of an Order System of an application. It describes


a particular aspect of the entire application.

First of all, Order and Customer are identified as the two elements of the system. They
have a one-to-many relationship because a customer can have multiple orders.

Order class is an abstract class and it has two concrete classes (inheritance relationship)
SpecialOrder and NormalOrder.

The two inherited classes have all the properties as the Order class. In addition, they
have additional functions like dispatch () and receive ().

The following class diagram has been drawn considering all the points mentioned
above.

Where to Use Class Diagrams?

Class diagram is a static diagram and it is used to model the static view of a system.
The static view describes the vocabulary of the system.

Class diagram is also considered as the foundation for component and deployment
diagrams. Class diagrams are not only used to visualize the static view of the system
but they are also used to construct the executable code for forward and reverse
engineering of any system.

Generally, UML diagrams are not directly mapped with any object-oriented
programming languages but the class diagram is an exception.

Class diagram clearly shows the mapping with object-oriented languages such as Java,
C++, etc. From practical experience, class diagram is generally used for construction
purpose.

In a nutshell it can be said, class diagrams are used for −

Describing the static view of the system.

Showing the collaboration among the elements of the static view.

Describing the functionalities performed by the system.

Construction of software applications using object oriented languages.

UML - Object Diagrams

Object diagrams are derived from class diagrams so object diagrams are dependent
upon class diagrams.

Object diagrams represent an instance of a class diagram. The basic concepts are
similar for class diagrams and object diagrams. Object diagrams also represent the
static view of a system but this static view is a snapshot of the system at a particular
moment.

Object diagrams are used to render a set of objects and their relationships as an
instance.

Purpose of Object Diagrams

The purpose of a diagram should be understood clearly to implement it practically.


The purposes of object diagrams are similar to class diagrams.
The difference is that a class diagram represents an abstract model consisting of classes
and their relationships. However, an object diagram represents an instance at a
particular moment, which is concrete in nature.

It means the object diagram is closer to the actual system behavior. The purpose is to
capture the static view of a system at a particular moment.

The purpose of the object diagram can be summarized as −

Forward and reverse engineering.

Object relationships of a system

Static view of an interaction.

Understand object behaviour and their relationship from practical perspective

How to Draw an Object Diagram?

We have already discussed that an object diagram is an instance of a class diagram. It


implies that an object diagram consists of instances of things used in a class diagram.

So both diagrams are made of same basic elements but in different form. In class
diagram elements are in abstract form to represent the blue print and in object diagram
the elements are in concrete form to represent the real world object.

To capture a particular system, numbers of class diagrams are limited. However, if we


consider object diagrams then we can have unlimited number of instances, which are
unique in nature. Only those instances are considered, which have an impact on the
system.

From the above discussion, it is clear that a single object diagram cannot capture all
the necessary instances or rather cannot specify all the objects of a system. Hence, the
solution is −

First, analyze the system and decide which instances have important data and
association.

Second, consider only those instances, which will cover the functionality.

Third, make some optimization as the number of instances are unlimited.

Before drawing an object diagram, the following things should be remembered and
understood clearly −
Object diagrams consist of objects.

The link in object diagram is used to connect objects.

Objects and links are the two elements used to construct an object diagram.

After this, the following things are to be decided before starting the construction of the
diagram −

The object diagram should have a meaningful name to indicate its purpose.

The most important elements are to be identified.

The association among objects should be clarified.

Values of different elements need to be captured to include in the object diagram.

Add proper notes at points where more clarity is required.

The following diagram is an example of an object diagram. It represents the Order


management system which we have discussed in the chapter Class Diagram. The
following diagram is an instance of the system at a particular time of purchase. It has
the following objects.

Customer

Order

SpecialOrder

NormalOrder

Now the customer object (C) is associated with three order objects (O1, O2, and O3).
These order objects are associated with special order and normal order objects (S1, S2,
and N1). The customer has the following three orders with different numbers (12, 32
and 40) for the particular time considered.

The customer can increase the number of orders in future and in that scenario the object
diagram will reflect that. If order, special order, and normal order objects are observed
then you will find that they have some values.

For orders, the values are 12, 32, and 40 which implies that the objects have these
values for a particular moment (here the particular time when the purchase is made is
considered as the moment) when the instance is captured
The same is true for special order and normal order objects which have number of
orders as 20, 30, and 60. If a different time of purchase is considered, then these values
will change accordingly.

The following object diagram has been drawn considering all the points mentioned
above

Where to Use Object Diagrams?

Object diagrams can be imagined as the snapshot of a running system at a particular


moment. Let us consider an example of a running train

Now, if you take a snap of the running train then you will find a static picture of it
having the following −

A particular state which is running.

A particular number of passengers. which will change if the snap is taken in a different
time

Here, we can imagine the snap of the running train is an object having the above values.
And this is true for any real-life simple or complex system.

In a nutshell, it can be said that object diagrams are used for −

Making the prototype of a system.

Reverse engineering.

Modeling complex data structures.

Understanding the system from practical perspective.


UML - Component Diagrams

Component diagrams are different in terms of nature and behavior. Component


diagrams are used to model the physical aspects of a system. Now the question is, what
are these physical aspects? Physical aspects are the elements such as executables,
libraries, files, documents, etc. which reside in a node.

Component diagrams are used to visualize the organization and relationships among
components in a system. These diagrams are also used to make executable systems.

Purpose of Component Diagrams

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.

How to Draw a Component Diagram?

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.
Where to Use Component Diagrams?

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.

UML - Deployment Diagrams

Deployment diagrams are used to visualize the topology of the physical components
of a system, where the software components are deployed.

Deployment diagrams are used to describe the static deployment view of a system.
Deployment diagrams consist of nodes and their relationships.

Purpose of Deployment Diagrams

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.

How to Draw a Deployment Diagram?

Deployment diagram represents the deployment view of a system. It is related to the


component diagram because the components are deployed using the deployment
diagrams. A deployment diagram consists of nodes. Nodes are nothing but physical
hardware used to deploy the application.
Deployment diagrams are useful for system engineers. An efficient deployment
diagram is very important as it controls the following parameters −

Performance

Scalability

Maintainability

Portability

Before drawing a deployment diagram, the following artifacts should be identified −

Nodes

Relationships among nodes

Following is a sample deployment diagram to provide an idea of the deployment view


of order management system. Here, we have shown nodes as −

Monitor

Modem

Caching server

Server

The application is assumed to be a web-based application, which is deployed in a


clustered environment using server 1, server 2, and server 3. The user connects to the
application using the Internet. The control flows from the caching server to the
clustered environment.

The following deployment diagram has been drawn considering all the points
mentioned above.
Where to Use Deployment Diagrams?

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.


UML - Use Case Diagrams

To model a system, the most important aspect is to capture the dynamic behavior.
Dynamic behavior means the behavior of the system when it is running/operating.

Only static behavior is not sufficient to model a system rather dynamic behavior is
more important than static behavior. In UML, there are five diagrams available to
model the dynamic nature and use case diagram is one of them. Now as we have to
discuss that the use case diagram is dynamic in nature, there should be some internal
or external factors for making the interaction.

These internal and external agents are known as actors. Use case diagrams consists of
actors, use cases and their relationships. The diagram is used to model the
system/subsystem of an application. A single use case diagram captures a particular
functionality of a system.

Hence to model the entire system, a number of use case diagrams are used.

Purpose of Use Case Diagrams

The purpose of use case diagram is to capture the dynamic aspect of a system.
However, this definition is too generic to describe the purpose, as other four diagrams
(activity, sequence, collaboration, and Statechart) also have the same purpose. We will
look into some specific purpose, which will distinguish it from other four diagrams.

Use case diagrams are used to gather the requirements of a system including internal
and external influences. These requirements are mostly design requirements. Hence,
when a system is analyzed to gather its functionalities, use cases are prepared and
actors are identified.

When the initial task is complete, use case diagrams are modelled to present the outside
view.

In brief, the purposes of use case diagrams can be said to be as follows −

Used to gather the requirements of a system.

Used to get an outside view of a system.

Identify the external and internal factors influencing the system.

Show the interaction among the requirements are actors.

How to Draw a Use Case Diagram?


Use case diagrams are considered for high level requirement analysis of a system.
When the requirements of a system are analyzed, the functionalities are captured in
use cases.

We can say that use cases are nothing but the system functionalities written in an
organized manner. The second thing which is relevant to use cases are the actors.
Actors can be defined as something that interacts with the system.

Actors can be a human user, some internal applications, or may be some external
applications. When we are planning to draw a use case diagram, we should have the
following items identified.

Functionalities to be represented as use case

Actors

Relationships among the use cases and actors.

Use case diagrams are drawn to capture the functional requirements of a system. After
identifying the above items, we have to use the following guidelines to draw an
efficient use case diagram

The name of a use case is very important. The name should be chosen in such a way
so that it can identify the functionalities performed.

Give a suitable name for actors.

Show relationships and dependencies clearly in the diagram.

Do not try to include all types of relationships, as the main purpose of the diagram is
to identify the requirements.

Use notes whenever required to clarify some important points.

Following is a sample use case diagram representing the order management system.
Hence, if we look into the diagram then we will find three use cases (Order,
SpecialOrder, and NormalOrder) and one actor which is the customer.

The SpecialOrder and NormalOrder use cases are extended from Order use case.
Hence, they have extended relationship. Another important point is to identify the
system boundary, which is shown in the picture. The actor Customer lies outside the
system as it is an external user of the system.
Where to Use a Use Case Diagram?

As we have already discussed there are five diagrams in UML to model the dynamic
view of a system. Now each and every model has some specific purpose to use.
Actually these specific purposes are different angles of a running system.

To understand the dynamics of a system, we need to use different types of diagrams.


Use case diagram is one of them and its specific purpose is to gather system
requirements and actors.

Use case diagrams specify the events of a system and their flows. But use case diagram
never describes how they are implemented. Use case diagram can be imagined as a
black box where only the input, output, and the function of the black box is known.

These diagrams are used at a very high level of design. This high level design is refined
again and again to get a complete and practical picture of the system. A well-structured
use case also describes the pre-condition, post condition, and exceptions. These extra
elements are used to make test cases when performing the testing.

Although use case is not a good candidate for forward and reverse engineering, still
they are used in a slightly different way to make forward and reverse engineering. The
same is true for reverse engineering. Use case diagram is used differently to make it
suitable for reverse engineering.

In forward engineering, use case diagrams are used to make test cases and in reverse
engineering use cases are used to prepare the requirement details from the existing
application.
Use case diagrams can be used for −

Requirement analysis and high level design.

Model the context of a system.

Reverse engineering.

Forward engineering.

UML - Interaction Diagrams

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.

Purpose of Interaction Diagrams

The purpose of interaction diagrams is to visualize the interactive behavior of the


system. Visualizing the interaction is a difficult task. Hence, the solution is to use
different types of models to capture the different aspects of the interaction.

Sequence and collaboration diagrams are used to capture the dynamic nature but from
a different angle.

The purpose of interaction diagram is −

To capture the dynamic behaviour of a system.

To describe the message flow in the system.

To describe the structural organization of the objects.

To describe the interaction among objects.

How to Draw an Interaction Diagram?


As we have already discussed, the purpose of interaction diagrams is to capture the
dynamic aspect of a system. So to capture the dynamic aspect, we need to understand
what a dynamic aspect is and how it is visualized. Dynamic aspect can be defined as
the snapshot of the running system at a particular moment

We have two types of interaction diagrams in UML. One is the sequence diagram and
the other is the collaboration diagram. The sequence diagram captures the time
sequence of the message flow from one object to another and the collaboration diagram
describes the organization of objects in a system taking part in the message flow.

Following things are to be identified clearly before drawing the interaction diagram

Objects taking part in the interaction.

Message flows among the objects.

The sequence in which the messages are flowing.

Object organization.

Following are two interaction diagrams modeling the order management system. The
first diagram is a sequence diagram and the second is a collaboration diagram

The Sequence Diagram

The sequence diagram has four objects (Customer, Order, SpecialOrder and
NormalOrder).

The following diagram shows the message sequence for SpecialOrder object and the
same can be used in case of NormalOrder object. It is important to understand the time
sequence of message flows. The message flow is nothing but a method call of an
object.

The first call is sendOrder () which is a method of Order object. The next call is
confirm () which is a method of SpecialOrder object and the last call is Dispatch ()
which is a method of SpecialOrder object. The following diagram mainly describes
the method calls from one object to another, and this is also the actual scenario when
the system is running.
The Collaboration Diagram

The second interaction diagram is the collaboration diagram. It shows the object
organization as seen in the following diagram. In the collaboration diagram, the
method call sequence is indicated by some numbering technique. The number indicates
how the methods are called one after another. We have taken the same order
management system to describe the collaboration diagram.

Method calls are similar to that of a sequence diagram. However, difference being the
sequence diagram does not describe the object organization, whereas the collaboration
diagram shows the object organization.

To choose between these two diagrams, emphasis is placed on the type of requirement.
If the time sequence is important, then the sequence diagram is used. If organization
is required, then collaboration diagram is used.
Where to Use Interaction Diagrams?

We have already discussed that interaction diagrams are used to describe the dynamic
nature of a system. Now, we will look into the practical scenarios where these diagrams
are used. To understand the practical application, we need to understand the basic
nature of sequence and collaboration diagram.

The main purpose of both the diagrams are similar as they are used to capture the
dynamic behavior of a system. However, the specific purpose is more important to
clarify and understand.

Sequence diagrams are used to capture the order of messages flowing from one object
to another. Collaboration diagrams are used to describe the structural organization of
the objects taking part in the interaction. A single diagram is not sufficient to describe
the dynamic aspect of an entire system, so a set of diagrams are used to capture it as a
whole.

Interaction diagrams are used when we want to understand the message flow and the
structural organization. Message flow means the sequence of control flow from one
object to another. Structural organization means the visual organization of the elements
in a system.

Interaction diagrams can be used −

To model the flow of control by time sequence.

To model the flow of control by structural organizations.


For forward engineering.

For reverse engineering.

We use Activity Diagrams to illustrate the flow of control in a system and refer to the
steps involved in the execution of a use case. We model sequential and concurrent
activities using activity diagrams. So, we basically depict workflows visually using an
activity diagram. An activity diagram focuses on condition of flow and the sequence
in which it happens. We describe or depict what causes a particular event using an
activity diagram.

UML models basically three types of diagrams, namely, structure diagrams,


interaction diagrams, and behavior diagrams. An activity diagram is a behavioral
diagram i.e. it depicts the behavior of a system.

An activity diagram portrays the control flow from a start point to a finish point
showing the various decision paths that exist while the activity is being executed. We
can depict both sequential processing and concurrent processing of activities using an
activity diagram. They are used in business and process modelling where their primary
use is to depict the dynamic aspects of a system.

An activity diagram is very similar to a flowchart. So let us understand if an activity


diagrams or a flowcharts are any different :

Difference between an Activity diagram and a Flowchart –

Flowcharts were typically invented earlier than activity diagrams. Non programmers
use Flow charts to model workflows. For example: A manufacturer uses a flow chart
to explain and illustrate how a particular product is manufactured. We can call a
flowchart a primitive version of an activity diagram. Business processes where
decision making is involved is expressed using a flow chart.

So, programmers use activity diagrams (advanced version of a flowchart) to depict


workflows. An activity diagram is used by developers to understand the flow of
programs on a high level. It also enables them to figure out constraints and conditions
that cause particular events. A flow chart converges into being an activity diagram if
complex decisions are being made.

Brevity is the soul of wit. We need to convey a lot of information with clarity and
make sure it is short. So an activity diagram helps people on both sides i.e.
Businessmen and Developers to interact and understand systems.

A question arises:
Do we need to use both the diagram and the textual documentation?
Different individuals have different preferences in which they understand something.
For example: To understand a concept, some people might prefer a written tutorial
with images while others would prefer a video lecture.
So we generally use both the diagram and the textual documentation to make our
system description as clear as possible. We also need to be sensitive to the needs of
the audience that we are catering to at times.

Difference between a Use case diagram and an Activity diagram

An activity diagram is used to model the workflow depicting conditions, constraints,


sequential and concurrent activities. On the other hand, the purpose of a Use Case is
to just depict the functionality i.e. what the system does and not how it is done. So in
simple terms, an activity diagram shows ‘How’ while a Use case shows ‘What’ for a
particular system.
The levels of abstraction also vary for both of them. An activity diagram can be used
to illustrate a business process (high level implementation) to a stand alone algorithm
(ground level implementation). However, Use cases have a low level of abstraction.
They are used to show a high level of implementation only.
Figure – an activity diagram for an emotion based music player

The above figure depicts an activity diagram for an emotion based music player which
can also be used to change the wallpaper.

The various components used in the diagram and the standard notations are explained
below.

Activity Diagram Notations –

Initial State – The starting state before an activity takes place is depicted using the
initial state.

Figure – notation for initial state or start state

A process can have only one initial state unless we are depicting nested
activities. We use a black filled circle to depict the initial state of a system. For
objects, this is the state when they are instantiated. The Initial State from the
UML Activity Diagram marks the entry point and the initial Activity State.
For example – Here the initial state is the state of the system before the
application is opened.

Figure – initial state symbol being used

Action or Activity State – An activity represents execution of an action on objects or


by objects. We represent an activity using a rectangle with rounded corners. Basically
any action or event that takes place is represented using an activity.

Figure – notation for an activity state

For example – Consider the previous example of opening an application opening


the application is an activity state in the activity diagram.

Figure – activity state symbol being used

Action Flow or Control flows – Action flows or Control flows are also referred to as
paths and edges. They are used to show the transition from one activity state to another.

Figure – notation for control Flow

An activity state can have multiple incoming and outgoing action flows. We use
a line with an arrow head to depict a Control Flow. If there is a constraint to be
adhered to while making the transition it is mentioned on the arrow.
Consider the example – Here both the states transit into one final state using
action flow symbols i.e. arrows.

Figure – using action flows for transitions

Decision node and Branching – When we need to make a decision before deciding
the flow of control, we use the decision node.

Figure – notation for decision node

The outgoing arrows from the decision node can be labelled with conditions or
guard expressions.It always includes two or more output arrows.

Figure – an activity diagram using decision node


Guards – A Guard refers to a statement written next to a decision node on an arrow
sometimes within square brackets.

Figure – guards being used next to a decision node

The statement must be true for the control to shift along a particular direction.
Guards help us know the constraints and conditions which determine the flow
of a process.

Fork – Fork nodes are used to support concurrent activities.

Figure – fork notation

When we use a fork node when both the activities get executed concurrently i.e.
no decision is made before splitting the activity into two parts. Both parts need
to be executed in case of a fork statement.
We use a rounded solid rectangular bar to represent a Fork notation with
incoming arrow from the parent activity state and outgoing arrows towards the
newly created activities.
For example: In the example below, the activity of making coffee can be split
into two concurrent activities and hence we use the fork notation.
Figure – a diagram using fork

Join – Join nodes are used to support concurrent activities converging into one. For
join notations we have two or more incoming edges and one outgoing edge.

Figure – join notation

For example – When both activities i.e. steaming the milk and adding coffee get
completed, we converge them into one final activity.
Figure – a diagram using join notation

Merge or Merge Event – Scenarios arise when activities which are not being executed
concurrently have to be merged. We use the merge notation for such scenarios. We
can merge two or more activities into one if the control proceeds onto the next activity
irrespective of the path chosen.

Figure – merge notation

For example – In the diagram below: we can’t have both sides executing
concurrently, but they finally merge into one. A number can’t be both odd and
even at the same time.
Figure – an activity diagram using merge notation

Swimlanes :

We use swimlanes for grouping related activities in one column. Swimlanes group
related activities into one column or one row. Swimlanes can be vertical and
horizontal. Swimlanes are used to add modularity to the activity diagram. It is not
mandatory to use swimlanes. They usually give more clarity to the activity diagram.
It’s similar to creating a function in a program. It’s not mandatory to do so, but, it is a
recommended practice.
Figure – swimlanes notation

We use a rectangular column to represent a swimlane as shown in the figure


above.

For example – Here different set of activities are executed based on if the
number is odd or even. These activities are grouped into a swimlane.
Figure – an activity diagram making use of swimlanes

Time Event –

Figure – time event notation

We can have a scenario where an event takes some time to complete. We use an
hourglass to represent a time event.
For example – Let us assume that the processing of an image takes takes a lot
of time. Then it can be represented as shown below.
Figure – an activity diagram using time event

Final State or End State – The state which the system reaches when a particular
process or activity ends is known as a Final State or End State. We use a filled circle
within a circle notation to represent the final state in a state machine diagram. A system
or a process can have multiple final states.

Figure – notation for final state

How to Draw an activity diagram –

Identify the initial state and the final states.

Identify the intermediate activities needed to reach the final state from he initial state.

Identify the conditions or constraints which cause the system to change control flow.

Draw the diagram with appropriate notations.


Figure – an activity diagram

The above diagram prints the number if it is odd otherwise it subtracts one from the
number and displays it.

Uses of an Activity Diagram –

Dynamic modelling of the system or a process.

Illustrate the various steps involved in a UML use case.

Model software elements like methods,operations and functions.

We can use Activity diagrams to depict concurrent activities easily.

Show the constraints, conditions and logic behind algorithms.

UML - Statechart Diagrams

The name of the diagram itself clarifies the purpose of the diagram and other details.
It describes different states of a component in a system. The states are specific to a
component/object of a system.
A Statechart diagram describes a state machine. State machine can be defined as a
machine which defines different states of an object and these states are controlled by
external or internal events.

Activity diagram explained in the next chapter, is a special kind of a Statechart


diagram. As Statechart diagram defines the states, it is used to model the lifetime of
an object.

Purpose of Statechart Diagrams

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.

How to Draw a Statechart Diagram?

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.

Where to Use Statechart Diagrams?

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.

UML - Activity Diagrams

Activity diagram is another important diagram in UML to describe the dynamic


aspects of the system.

Activity diagram is basically a flowchart to represent the flow from one activity to
another activity. The activity can be described as an operation of the system.

The control flow is drawn from one operation to another. This flow can be sequential,
branched, or concurrent. Activity diagrams deal with all type of flow control by using
different elements such as fork, join, etc

Purpose of Activity Diagrams

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.

How to Draw an Activity Diagram?

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.

Where to Use Activity Diagrams?

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.

ER Diagram Representation

Let us now learn how the ER Model is represented by means of an ER diagram. Any
object, for example, entities, attributes of an entity, relationship sets, and attributes of
relationship sets, can be represented with the help of an ER diagram.

Entity

Entities are represented by means of rectangles. Rectangles are named with the entity
set they represent.

Attributes
Attributes are the properties of entities. Attributes are represented by means of ellipses.
Every ellipse represents one attribute and is directly connected to its entity (rectangle).

If the attributes are composite, they are further divided in a tree like structure. Every
node is then connected to its attribute. That is, composite attributes are represented by
ellipses that are connected with an ellipse.

Multivalued attributes are depicted by double ellipse.


Derived attributes are depicted by dashed ellipse.

Relationship

Relationships are represented by diamond-shaped box. Name of the relationship is


written inside the diamond-box. All the entities (rectangles) participating in a
relationship, are connected to it by a line.
Binary Relationship and Cardinality

A relationship where two entities are participating is called a binary relationship.


Cardinality is the number of instance of an entity from a relation that can be associated
with the relation.

One-to-one − When only one instance of an entity is associated with the relationship,
it is marked as '1:1'. The following image reflects that only one instance of each entity
should be associated with the relationship. It depicts one-to-one relationship.

One-to-many − When more than one instance of an entity is associated with a


relationship, it is marked as '1:N'. The following image reflects that only one instance
of entity on the left and more than one instance of an entity on the right can be
associated with the relationship. It depicts one-to-many relationship.

Many-to-one − When more than one instance of entity is associated with the
relationship, it is marked as 'N:1'. The following image reflects that more than one
instance of an entity on the left and only one instance of an entity on the right can be
associated with the relationship. It depicts many-to-one relationship.
Many-to-many − The following image reflects that more than one instance of an
entity on the left and more than one instance of an entity on the right can be associated
with the relationship. It depicts many-to-many relationship.

Participation Constraints

Total Participation − Each entity is involved in the relationship. Total participation


is represented by double lines.

Partial participation − Not all entities are involved in the relationship. Partial
participation is represented by single lines.

Generalization Aggregation

The ER Model has the power of expressing database entities in a conceptual


hierarchical manner. As the hierarchy goes up, it generalizes the view of entities, and
as we go deep in the hierarchy, it gives us the detail of every entity included.
Going up in this structure is called generalization, where entities are clubbed together
to represent a more generalized view. For example, a particular student named Mira
can be generalized along with all the students. The entity shall be a student, and further,
the student is a person. The reverse is called specialization where a person is a student,
and that student is Mira.

Generalization

As mentioned above, the process of generalizing entities, where the generalized


entities contain the properties of all the generalized entities, is called generalization.
In generalization, a number of entities are brought together into one generalized entity
based on their similar characteristics. For example, pigeon, house sparrow, crow and
dove can all be generalized as Birds.

Specialization

Specialization is the opposite of generalization. In specialization, a group of entities is


divided into sub-groups based on their characteristics. Take a group ‘Person’ for
example. A person has name, date of birth, gender, etc. These properties are common
in all persons, human beings. But in a company, persons can be identified as employee,
employer, customer, or vendor, based on what role they play in the company.
Similarly, in a school database, persons can be specialized as teacher, student, or a
staff, based on what role they play in school as entities.

Inheritance

We use all the above features of ER-Model in order to create classes of objects in
object-oriented programming. The details of entities are generally hidden from the
user; this process known as abstraction.

Inheritance is an important feature of Generalization and Specialization. It allows


lower-level entities to inherit the attributes of higher-level entities.

For example, the attributes of a Person class such as name, age, and gender can be
inherited by lower-level entities such as Student or Teacher.

UML Use Case Diagram Examples

An automated teller machine (ATM) is a banking subsystem (subject) that provides


bank customers with access to financial transactions in a public space without the need
for a cashier, clerk, or bank teller.

Customer (actor) uses bank ATM to Check Balances of his/her bank accounts, Deposit
Funds, Withdraw Cash and/or Transfer Funds (use cases). ATM Technician provides
Maintenance and Repairs. All these use cases also involve Bank actor whether it is
related to customer transactions or to the ATM servicing.
An example of use case diagram for Bank ATM subsystem - top level use cases.

On most bank ATMs, the customer is authenticated by inserting a plastic ATM card
and entering a personal identification number (PIN). Customer Authentication use case
is required for every ATM transaction so we show it as include relationship. Including
this use case as well as transaction generalizations make the ATM Transaction an
abstract use case.
Bank ATM Transactions and Customer Authentication Use Cases Example.

Customer may need some help from the ATM. ATM Transaction use case is extended
via extension point called menu by the ATM Help use case whenever ATM Transaction
is at the location specified by the menu and the bank customer requests help, e.g. by
selecting Help menu item.

Bank ATM Maintenance, Repair, Diagnostics Use Cases Example.

ATM Technician maintains or repairs Bank ATM. Maintenance use case includes
Replenishing ATM with cash, ink or printer paper, Upgrades of hardware, firmware
or software, and remote or on-site Diagnostics. Diagnostics is also included in (shared
with) Repair use case.
Online Shopping

UML Use Case Diagram Example

Web Customer actor uses some web site to make purchases online. Top level use
cases are View Items, Make Purchase and Client Register. View Items use case
could be used by customer as top level use case if customer only wants to find and see
some products. This use case could also be used as a part of Make Purchase use case.
Client Register use case allows customer to register on the web site, for example to get
some coupons or be invited to private sales. Note, that Checkout use case is included
use case not available by itself - checkout is part of making purchase.

Except for the Web Customer actor there are several other actors which will be
described below with detailed use cases.

Online shopping UML use case diagram example - top level use cases.
View Items use case is extended by several optional use cases - customer may search
for items, browse catalog, view items recommended for him/her, add items to shopping
cart or wish list. All these use cases are extending use cases because they provide some
optional functions allowing customer to find item.

Customer Authentication use case is included in View Recommended Items and Add
to Wish List because both require the customer to be authenticated. At the same time,
item could be added to the shopping cart without user authentication.

Online shopping UML use case diagram example - view items use case.

Checkout use case includes several required uses cases. Web customer should be
authenticated. It could be done through user login page, user authentication cookie
("Remember me") or Single Sign-On (SSO). Web site authentication service is used
in all these use cases, while SSO also requires participation of external identity
provider.

Checkout use case also includes Payment use case which could be done either by
using credit card and external credit payment service or with PayPal.
Online shopping UML use case diagram example - checkout, authentication and
payment use cases.
Object Oriented System Development Life Cycle

It consists of three macro processes −

Object Oriented Analysis (OOA)

Object oriented design (OOD)

Object oriented Implementation (OOI)

Object Oriented Systems Development Activities

Object-oriented systems development includes the following stages −

Object-oriented analysis

Object-oriented design

Prototyping

Implementation

Incremental testing
Object-Oriented Analysis

This phase concerns with determining the system requirements and to understand the
system requirements build a use-case model. A use-case is a scenario to describe the
interaction between user and computer system. This model represents the user needs
or user view of system.

It also includes identifying the classes and their relationships to the other classes in the
problem domain, that make up an application.

Object-Oriented Design

The objective of this phase is to design and refine the classes, attributes, methods, and
structures that are identified during the analysis phase, user interface, and data access.
This phase also identifies and defines the additional classes or objects that support
implementation of the requirement.

Prototyping

Prototyping enables to fully understand how easy or difficult it will be to implement


some of the features of the system.

It can also give users a chance to comment on the usability and usefulness of the
design. It can further define a use-case and make use-case modeling much easier.

Implementation

It uses either Component-Based Development (CBD) or Rapid Application


Development (RAD).

Component-based development (CBD)

CODD is an industrialized approach to the software development process using


various range of technologies like CASE tools. Application development moves from
custom development to assembly of pre-built, pre-tested, reusable software
components that operate with each other. A CBD developer can assemble components
to construct a complete software system.

Rapid Application Development (RAD)

RAD is a set of tools and techniques that can be used to build an application faster than
typically possible with traditional methods. It does not replace SDLC but complements
it, since it focuses more on process description and can be combined perfectly with the
object oriented approach.

Its task is to build the application quickly and incrementally implement the user
requirements design through tools such as visual basic, power builder, etc.

Incremental Testing

Software development and all of its activities including testing are an iterative process.
Therefore, it can be a costly affair if we wait to test a product only after its complete
development. Here incremental testing comes into picture wherein the product is tested
during various stages of its development.

Structured Analysis and Structured Design (SA/SD)

Structured Analysis and Structured Design (SA/SD) is diagrammatic notation


which is design to help people understand the system. The basic goal of SA/SD is to
improve quality and reduce the risk of System failure. It establishes concrete
management specification and documentation. It focuses on solidity, pliability and
maintainability of system.

Basically the approach of SA/SD is based on the Data Flow Diagram. It is easy to
understand SA/SD but it focuses on well defined system boundary whereas JSD
approach is too complex and does not have any graphical representation.

SA/SD is combined known as SAD and it mainly focuses on following 3 points:

System

Process

Technology

SA/SD involves 2 phases:

Analysis Phase: It uses Data Flow Diagram, Data Dictionary, State Transition
diagram and ER diagram.

Design Phase: It uses Structure Chart and Pseudo Code.


Analysis Phase:
Analysis Phase involves data flow diagram, data dictionary, state transition diagram
and entity relationship diagram.

Data Flow Diagram:


In the data flow diagram model describe how the data flows through the system. We
can incorporate the Boolean operators and & or to link data flows when more than
one data flow may be input or output from a process.

For example, if we have to choose between two paths of a process we can add
an operator or and if two data flows are necessary for a process we can add and
operator. The input of the process “check-order” needs the credit information
and order information whereas the output of the process would be a cash-order
or a good-credit-order.

Data Dictionary:
The content that are not described in the DFD are described in data dictionary. It
defines the data store and relevant meaning. A physical data dictionary for data
elements which flow between processes, between entities, and between processes
and entities may be included. This would also include descriptions of data elements
that flow external to the data stores.

A logical data dictionary may also be included for each such data element. All
system names, whether they are names of entities, types, relations, attributes or
services, should be entered in the dictionary.

State Transition Diagram:


State transition diagram is similar to dynamic model. It specifies how much time
function will take to execute and data access triggered by events. It also describes all
of the states that an object can have, the events under which an object changes state,
the conditions that must be fulfilled before the transition will occur and the activities
undertaken during the life of an object.

ER Diagram:
ER diagram specifies the relationship between data store. It is basically used in
database design. It basically describes the relationship between different entities.

Design Phase:
Design Phase involves structure chart and pseudo code.

Structure Chart:
It is created by the data flow diagram. Structure Chart specifies how DFS’s processes
are grouped into task and allocate to CPU.The structured chart does not show the
working and internal structure of the processes or modules, and does not show the
relationship between data or data-flows. Similar to other SASD tools, it is time and
cost independent and there is no error-checking technique associated with this tool.

The modules of a structured chart are arranged arbitrarily and any process from
a DFD can be chosen as the central transform depending on the analysts’ own
perception. The structured chart is difficult to amend, verify, maintain, and
check for completeness and consistency.

Pseudo Code:
It is actual implementation of system.It is a informal way of programming which
doesn’t require any specific programming language or technology.

Structured systems analysis and design methodology (SSADM) is a set of standards


for systems analysis and application design. It uses a formal methodical approach to
the analysis and design of information systems.

The SSADM is an open methodology based on the waterfall model. It has been used
by many commercial businesses, consultants, educational establishments and CASE
tool developers.

SSADM follows the waterfall life cycle model starting from the feasibility study to the
physical design stage of development. One of the main features of SSADM is the
intensive user involvement in the requirements analysis stage. The users are made to
sign off each stage as they are completed assuring that requirements are met. The users
are provided with clear, easily understandable documentation consisting of various
diagrammatic representations of the system. SSADM breaks up a development project
into stages, modules, steps and tasks. The first and foremost model developed in
SSADM is the data model. It is a part of requirements gathering and consists of well
defined stages, steps and products. The techniques used in SSADM are logical data
modeling, data flow modeling and entity behavior modeling.

Logical Data Modeling: This involves the process of identifying, modeling and
documenting data as a part of system requirements gathering. The data are classified
further into entities and relationships.

Data Flow Modeling: This involves tracking the data flow in an information system.
It clearly analyzes the processes, data stores, external entities and data movement.

Entity Behavior Modeling: This involves identifying and documenting the events
influencing each entity and the sequence in which these events happen.
Some of the important characteristics of SSADM are:

Dividing a project into small modules with well defined objectives

Useful during requirements specification and system design stage

Diagrammatic representation and other useful modeling techniques

Simple and easily understood by clients and developers

Performing activities in a sequence

The stages of SSADM include:

Determining feasibility

Investigating the current environment

Determining business systems options

Defining requirements

Determining technical system options

Creating the logical design

Creating the physical design

Object-Oriented Analysis
Object–Oriented Analysis (OOA) is the procedure of identifying software engineering
requirements and developing software specifications in terms of a software system’s
object model, which comprises of interacting objects.
The main difference between object-oriented analysis and other forms of analysis is
that in object-oriented approach, requirements are organized around objects, which
integrate both data and functions. They are modelled after real-world objects that the
system interacts with. In traditional analysis methodologies, the two aspects -
functions and data - are considered separately.
Grady Booch has defined OOA as, “Object-oriented analysis is a method of analysis
that examines requirements from the perspective of the classes and objects found in
the vocabulary of the problem domain”.
The primary tasks in object-oriented analysis (OOA) are −
Identifying objects

Organizing the objects by creating object model diagram

Defining the internals of the objects, or object attributes

Defining the behavior of the objects, i.e., object actions

Describing how the objects interact

Object-Oriented Design
Object–Oriented Design (OOD) involves implementation of the conceptual model
produced during object-oriented analysis. In OOD, concepts in the analysis model,
which are technology−independent, are mapped onto implementing classes,
constraints are identified and interfaces are designed, resulting in a model for the
solution domain, i.e., a detailed description of how the system is to be built on
concrete technologies.
The implementation details generally include −

Restructuring the class data (if necessary),

Implementation of methods, i.e., internal data structures and algorithms,

Implementation of control, and

Implementation of associations.

Requirement Engineering

The process to gather the software requirements from client, analyze and document
them is known as requirement engineering.

The goal of requirement engineering is to develop and maintain sophisticated and


descriptive ‘System Requirements Specification’ document.

Requirement Engineering Process

It is a four step process, which includes –

Feasibility Study
Requirement Gathering

Software Requirement Specification

Software Requirement Validation

Let us see the process briefly -

Feasibility study

When the client approaches the organization for getting the desired product developed,
it comes up with rough idea about what all functions the software must perform and
which all features are expected from the software.

Referencing to this information, the analysts does a detailed study about whether the
desired system and its functionality are feasible to develop.

This feasibility study is focused towards goal of the organization. This study analyzes
whether the software product can be practically materialized in terms of
implementation, contribution of project to organization, cost constraints and as per
values and objectives of the organization. It explores technical aspects of the project
and product such as usability, maintainability, productivity and integration ability.

The output of this phase should be a feasibility study report that should contain
adequate comments and recommendations for management about whether or not the
project should be undertaken.

Requirement Gathering

If the feasibility report is positive towards undertaking the project, next phase starts
with gathering requirements from the user. Analysts and engineers communicate with
the client and end-users to know their ideas on what the software should provide and
which features they want the software to include.

Software Requirement Specification

SRS is a document created by system analyst after the requirements are collected from
various stakeholders.

SRS defines how the intended software will interact with hardware, external interfaces,
speed of operation, response time of system, portability of software across various
platforms, maintainability, speed of recovery after crashing, Security, Quality,
Limitations etc.
The requirements received from client are written in natural language. It is the
responsibility of system analyst to document the requirements in technical language
so that they can be comprehended and useful by the software development team.

SRS should come up with following features:

User Requirements are expressed in natural language.

Technical requirements are expressed in structured language, which is used inside the
organization.

Design description should be written in Pseudo code.

Format of Forms and GUI screen prints.

Conditional and mathematical notations for DFDs etc.

Software Requirement Validation

After requirement specifications are developed, the requirements mentioned in this


document are validated. User might ask for illegal, impractical solution or experts may
interpret the requirements incorrectly. This results in huge increase in cost if not nipped
in the bud. Requirements can be checked against following conditions -

If they can be practically implemented

If they are valid and as per functionality and domain of software

If there are any ambiguities

If they are complete

If they can be demonstrated

Requirement Elicitation Process

Requirement elicitation process can be depicted using the folloiwng diagram:

Requirements gathering - The developers discuss with the client and end users and
know their expectations from the software.
Organizing Requirements - The developers prioritize and arrange the requirements
in order of importance, urgency and convenience.

Negotiation & discussion - If requirements are ambiguous or there are some conflicts
in requirements of various stakeholders, if they are, it is then negotiated and discussed
with stakeholders. Requirements may then be prioritized and reasonably
compromised.

The requirements come from various stakeholders. To remove the ambiguity


and conflicts, they are discussed for clarity and correctness. Unrealistic
requirements are compromised reasonably.

Documentation - All formal & informal, functional and non-functional requirements


are documented and made available for next phase processing.

Requirement Elicitation Techniques

Requirements Elicitation is the process to find out the requirements for an intended
software system by communicating with client, end users, system users and others who
have a stake in the software system development.

There are various ways to discover requirements

Interviews

Interviews are strong medium to collect requirements. Organization may conduct


several types of interviews such as:

Structured (closed) interviews, where every single information to gather is decided in


advance, they follow pattern and matter of discussion firmly.

Non-structured (open) interviews, where information to gather is not decided in


advance, more flexible and less biased.

Oral interviews

Written interviews

One-to-one interviews which are held between two persons across the table.

Group interviews which are held between groups of participants. They help to uncover
any missing requirement as numerous people are involved.
Surveys

Organization may conduct surveys among various stakeholders by querying about


their expectation and requirements from the upcoming system.

Questionnaires

A document with pre-defined set of objective questions and respective options is


handed over to all stakeholders to answer, which are collected and compiled.

A shortcoming of this technique is, if an option for some issue is not mentioned in the
questionnaire, the issue might be left unattended.

Task analysis

Team of engineers and developers may analyze the operation for which the new system
is required. If the client already has some software to perform certain operation, it is
studied and requirements of proposed system are collected.

Domain Analysis

Every software falls into some domain category. The expert people in the domain can
be a great help to analyze general and specific requirements.

Brainstorming

An informal debate is held among various stakeholders and all their inputs are recorded
for further requirements analysis.

Prototyping

Prototyping is building user interface without adding detail functionality for user to
interpret the features of intended software product. It helps giving better idea of
requirements. If there is no software installed at client’s end for developer’s reference
and the client is not aware of its own requirements, the developer creates a prototype
based on initially mentioned requirements. The prototype is shown to the client and
the feedback is noted. The client feedback serves as an input for requirement gathering.

Observation

Team of experts visit the client’s organization or workplace. They observe the actual
working of the existing installed systems. They observe the workflow at client’s end
and how execution problems are dealt. The team itself draws some conclusions which
aid to form requirements expected from the software.

Software Requirements Characteristics

Gathering software requirements is the foundation of the entire software development


project. Hence they must be clear, correct and well-defined.

A complete Software Requirement Specifications must be:

Clear

Correct

Consistent

Coherent

Comprehensible

Modifiable

Verifiable

Prioritized

Unambiguous

Traceable

Credible source

Software Requirements

We should try to understand what sort of requirements may arise in the requirement
elicitation phase and what kinds of requirements are expected from the software
system.

Broadly software requirements should be categorized in two categories:


Functional Requirements

Requirements, which are related to functional aspect of software fall into this category.

They define functions and functionality within and from the software system.

Examples -

Search option given to user to search from various invoices.

User should be able to mail any report to management.

Users can be divided into groups and groups can be given separate rights.

Should comply business rules and administrative functions.

Software is developed keeping downward compatibility intact.

Non-Functional Requirements

Requirements, which are not related to functional aspect of software, fall into this
category. They are implicit or expected characteristics of software, which users make
assumption of.

Non-functional requirements include -

Security

Logging

Storage

Configuration

Performance

Cost

Interoperability

Flexibility

Disaster recovery

Accessibility

You might also like

pFad - Phonifier reborn

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

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


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy