Sepm Unit 1 and Unit 2
Sepm Unit 1 and Unit 2
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.
Cost Management
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.
The features that good software engineers should possess are as follows:
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 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.
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:
Integrity i.e. providing security so that the unauthorized user cannot access information
or data.
2. Process
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.
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.
The term software engineering is the product of two words, software, and
engineering.
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.
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 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.
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.
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.
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.
Software is more than programs. Any program is a subset of software, and it becomes
software only if documentation & operating procedures manuals are prepared.
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
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.
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 analysis is done, the next stage is to certainly represent and
document the software requirements and get them accepted from the project
stakeholders.
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.
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.
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.
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:
A project is short
Where the tools and technology used is consistent and is not changing
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.
In this model, the risk factor is higher, so this model is not suitable for more significant
and complex projects.
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:
A rigidly paced schedule that refers design improvements to the next product version
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.
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 the system should need to create the project that modularizes in a short span
time (2-3 months).
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.
Risk Analysis- Analysis alternatives and attempts to identify and resolve the risks
involved
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?
Advantages
Disadvantages
Business Modeling
Data Modeling
Process Modeling
Application Generation
Phases of
Activities performed in RAD Model
RAD model
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.
Advantages Disadvantages
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.
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.
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.
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.
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.
The V-shaped model should be chosen when sample technical resources are available
with essential technical expertise.
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.
Works well for small plans where requirements are easily understood.
If any changes happen in the midway, then the test documents along with the required
documents, has to be updated.
Incremental Model
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.
More flexible.
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.
Once the requirement is developed, requirement for that increment are frozen
Incremental Phases Activities performed in incremental phases
When software engineering team are not very well skilled or trained
Such methodology is more in use for web application and product based companies
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
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.
Transition - The software is released to the public. Final adjustments or updates are
made based on feedback from end users.
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.
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.
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.
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.
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.
An object-oriented system comes with several great features which are discussed
below.
Encapsulation
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.
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 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.
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.
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.
Class Diagram helps construct the code for the software application development.
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
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.
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.
Attributes must have a meaningful name that describes the use of it in a class.
Relationships
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.
Association:
This kind of relationship represents static relationships between classes A and B. For
example; an employee works for an organization.
It should be named to indicate the role played by the class attached at the end of the
association path.
In this example, the relationship between student and college is shown which is
studies.
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:
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 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.
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.
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.
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 diagram describes the types of objects in the system and the different kinds of
relationships which exist among them
Class diagrams are most important UML diagrams used for software application
development
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.
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.
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:
if a method doesn’t take any parameters then leave the parentheses empty. Ex:
checkBalance()
Class members (attributes and methods) have a specific visibility assigned to them.
See table below for how to represent them in UML.
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
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.).
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
Dependency
Aggregation
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 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.
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.
Use case −Use case represents a set of actions performed by a system for a specific
goal.
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 −
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
Package − Package is the only one grouping thing available for gathering structural
and behavioral things.
Annotational Things
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.
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
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
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 third section is used to describe the operations performed by the class.
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.
Interface Notation
Collaboration 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 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.
The usage of Final State Notation is to show the termination point of a process.
Active class looks similar to a class with a solid border. Active class is generally used
to describe the concurrent behavior of 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.
Interaction 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
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.
Generalization Notation
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.
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 −
It shows clear transition from design to Not so clear transition from design to
implementation. implementation.
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.
UML is made up of −
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
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.
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
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
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.
Collaboration diagram
Statechart diagram
Activity 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.
Collaboration Diagram
Statechart Diagram
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.
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.
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.
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 name of the class diagram should be meaningful to describe the aspect of the
system.
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.
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.
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.
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.
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.
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.
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.
Before drawing an object diagram, the following things should be remembered and
understood clearly −
Object diagrams consist of 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.
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
Now, if you take a snap of the running train then you will find a static picture of it
having the following −
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.
Reverse engineering.
Component diagrams are used to visualize the organization and relationships among
components in a system. These diagrams are also used to make executable systems.
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.
A single component diagram cannot represent the entire system but a collection of
diagrams is used to represent the whole.
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.
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.
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.
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
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.
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.
Performance
Scalability
Maintainability
Portability
Nodes
Monitor
Modem
Caching server
Server
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.
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.
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.
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.
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.
Do not try to include all types of relationships, as the main purpose of the diagram is
to identify the requirements.
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.
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 −
Reverse engineering.
Forward engineering.
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.
Sequence and collaboration diagrams are used to capture the dynamic nature but from
a different angle.
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
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 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.
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.
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.
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.
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.
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.
Initial State – The starting state before an activity takes place is depicted using the
initial 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.
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.
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.
Decision node and Branching – When we need to make a decision before deciding
the flow of control, we use the 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.
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.
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.
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.
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
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 –
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.
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.
The above diagram prints the number if it is odd otherwise it subtracts one from the
number and displays it.
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.
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.
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.
The first state is an idle state from where the process starts. The next states are arrived
for events like send request, confirm request, and dispatch order. These events are
responsible for the state changes of order object.
During the life cycle of an object (here order object) it goes through the following
states and there may be some abnormal exits. This abnormal exit may occur due to
some problem in the system. When the entire life cycle is complete, it is considered as
a complete transaction as shown in the following figure. The initial and final state of
an object is also shown in the following figure.
From the above discussion, we can define the practical applications of a Statechart
diagram. Statechart diagrams are used to model the dynamic aspect of a system like
other four diagrams discussed in this tutorial. However, it has some distinguishing
characteristics for modeling the dynamic nature.
Statechart diagram defines the states of a component and these state changes are
dynamic in nature. Its specific purpose is to define the state changes triggered by
events. Events are internal or external factors influencing the system.
Statechart diagrams are used to model the states and also the events operating on the
system. When implementing a system, it is very important to clarify different states of
an object during its life time and Statechart diagrams are used for this purpose. When
these states and events are identified, they are used to model it and these models are
used during the implementation of the system.
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
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.
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.
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
After receiving the order request, condition checks are performed to check if it is
normal or special order. After the type of order is identified, dispatch activity is
performed and that is marked as the termination of the process.
The basic usage of activity diagram is similar to other four UML diagrams. The
specific usage is to model the control flow from one activity to another. This control
flow does not include messages.
Activity diagram is suitable for modeling the activity flow of the system. An
application can have multiple systems. Activity diagram also captures these systems
and describes the flow from one system to another. This specific usage is not available
in other diagrams. These systems can be database, external queues, or any other
system.
We will now look into the practical applications of the activity diagram. From the
above discussion, it is clear that an activity diagram is drawn from a very high level.
So it gives high level view of a system. This high level view is mainly for business
users or any other person who is not a technical person.
This diagram is used to model the activities which are nothing but business
requirements. The diagram has more impact on business understanding rather than on
implementation details.
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.
Relationship
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.
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
Partial participation − Not all entities are involved in the relationship. Partial
participation is represented by single lines.
Generalization Aggregation
Generalization
Specialization
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.
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.
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.
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
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
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
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
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.
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.
System
Process
Technology
Analysis Phase: It uses Data Flow Diagram, Data Dictionary, State Transition
diagram and ER diagram.
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.
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.
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:
Determining feasibility
Defining requirements
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
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 −
Implementation of associations.
Requirement Engineering
The process to gather the software requirements from client, analyze and document
them is known as requirement engineering.
Feasibility Study
Requirement Gathering
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.
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.
Technical requirements are expressed in structured language, which is used inside the
organization.
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.
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.
Interviews
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
Questionnaires
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.
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.
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 -
Users can be divided into groups and groups can be given separate rights.
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.
Security
Logging
Storage
Configuration
Performance
Cost
Interoperability
Flexibility
Disaster recovery
Accessibility