You are on page 1of 58

Innovative Modeling in

Software Engineering

Dr. Ajanta Das

Professor, AIITK
Amity University, Kolkata
adas10@kol.amity.edu
Outline
• Software Engineering

• Concept of Modeling

• UML Diagrams

• Case Study

• References
Software Engineering
 IEEE Definition (1993)

(1) The application of a systematic, disciplines,


quantifiable approach to the development,
operation, and maintenance of software; that is
the application of engineering to software

(2) The study of approaches as in (1)

22/3/7 Ajanta Das 3


Software development Teams
Managers
How to lead and organize?

How to collaborate?

Developers Customers

How to motivate? How to create good ideas?

22/3/7 Ajanta Das 4


Software development Teams
Managers
How to lead and organize?

How to collaborate?

Developers Customers

How to motivate? How to create good ideas?

22/3/7 Ajanta Das 5


Software development Teams
Managers
How to lead and organize?

How to collaborate?

Developers Customers

How to motivate? How to create good ideas?

22/3/7 Ajanta Das 6


Software development Teams
Managers
How to lead and organize?

How to collaborate?

Developers Customers

How to motivate? How to create good ideas?

22/3/7 Ajanta Das 7


Development Initiation
• Finalization of scope of the software
• Problem decomposition or elaboration…
– It is decomposed into constituent functions or
activities
– It is decomposed into user-visible data and objects
– or
– It is decomposed into a set of problem classes
• Decomposition process continues until all functions
or problem classes have been defined

22/3/7 Ajanta Das 8


Role of 4 P’s
• People — the most important element
of a successful project
• Product — the software to be built
• Process — the set of software
engineering tasks to get the job done
• Project — all work required to make the
product a reality

22/3/7 Ajanta Das 9


Software Modeling
Analysis  Design

Software Engineering: Pressman, 10


ADS
Background
• Motivation - desire to standardize the disparate notational
systems and approaches to software design
• Developed by - Grady Booch, Ivar Jacobson and James
Rumbaugh at Rational Software in 1994–1995
• Further Development - led by them through 1996
• Adoption - In 1997 UML was adopted as a standard by
the Object Management Group (OMG)
• Published by - the International Organization for
Standardization (ISO) in 2005
• Approved - UML is approved as an ISO standard

22/3/7 Ajanta Das 11


UML
• UML – Unified Modeling Language

• Standard language for specifying,


visualizing, constructing and documenting
the artifacts of any software systems

• Collection of best engineering practices


that have proven successful in modeling
large and complex systems
22/3/7 Ajanta Das 12
Advantages of UML
• Provide users with a ready-to-use visual modeling
• Provide extensibility and specialization mechanisms to
extend the core concepts
• Be independent of particular programming languages and
development processes
• Provide a formal basis for understanding the modeling
language
• Support higher-level development concepts such as
collaborations, frameworks, patterns and components

22/3/7 Ajanta Das 13


UML Tools
•  The most well-known modelling tool is
IBM Rational Rose
• Other tools include Rational Rhapsody,
MagicDraw UML, StarUML, ArgoUML,
Umbrello, BOUML, PowerDesigner, Visual
Paradigm, Visio and Dia
• Easy to start with StarUML and Visual
Paradigm
22/3/7 Ajanta Das 14
Use CASE DIAGRAM
• Use Case Diagram is a graphical overview of the
functionality provided by a system
• Emphasis on what a system does rather then how
• It depicts
– Actors: drawn as stick figures
– Use Cases: drawn as a horizontal ellipse
– Associations: drawn as lines
• It presents goals of the actors through use cases
and dependencies between the use cases
22/3/7 Ajanta Das 15
USE CASE COMPONENTS
• Use cases: A use case describes a sequence of actions
that provide something of measurable value to an
actor
• Actors: An actor is a person, organization, or
external system that plays a role in one or more
interactions with the system
• Associations:  Associations between actors and use
cases are indicated in use case diagrams by solid lines.
An association exists whenever an actor is involved
with an interaction described by a use case
Use Case Relationships

• Include: A Directed Relationship between two use


cases, implying that the behavior of the included use
case is inserted into the behavior of the including use
case

• The first use case often depends on the outcome of the


included use case. This is useful for extracting truly
common behaviors from multiple use cases into a single
description

22/3/7 Ajanta Das 17


Use Case Relationships

• Extend: The behavior of the extension use case may


be inserted in the extended use case under some
conditions

• It defines that instances of a use case may be augmented


with some additional behavior defined in an extending
use case

• Extend relationship indicates “optional” to the base use


case.

22/3/7 Ajanta Das 18


Use Case Relationships

• Generalization: A given use case may have


common behaviors, constraints and assumptions to
the general use case

22/3/7 Ajanta Das 19


Example – Student
Registration and Learning System

22/3/7 Ajanta Das 20


Supermarket
Automation System
(SAS)
Problem
Requirements Identification
The manager of a super market wants automation software to
be developed. The super market stocks a set of items.
Customers pick up their desired items from the different
counters in required quantities. The customers present these
items to the sales clerk. The sales clerk enters the code
number of these items along with their respective quantities.
 

SAS should at the end of a sales transaction print the bill


containing the serial number of their sales transactions, the
name of each item, code number, quantity, unit price and
item price. The bill should indicate the total amount payable.

22/3/7 Ajanta Das 22


Problem
Requirements Identification
SAS should maintain the inventory of the various items of the supermarket.
The manager upon query should be able to see the inventory details. In
order to support inventory management, the inventory of an item should
be decreased whenever an item is sold. SAS should also support an
option by which an employee can update the inventory whenever new
supply arrives.

SAS should support printing the sales statistics for every item the super
market deals with for any particular day or any particular period. The
sales statistics should indicate the quantity of an item sold, the price
realized, and the profit accrued.

The manager of the super market should able to change the price at which
an item is sold as the prices of the different items may vary on a day-to-
day basis.
22/3/7 Ajanta Das 23
Problem
Requirements Identification
The manager of a super market wants automation software to
be developed. The super market stocks a set of items.
Customers pick up their desired items from the different
counters in required quantities. The customers present these
items to the sales clerk. The sales clerk enters the code
number of these items along with their respective quantities.
 

SAS should at the end of a sales transaction print the bill


containing the serial number of their sales transactions, the
name of each item, code number, quantity, unit price and
item price. The bill should indicate the total amount payable.
22/3/7 Ajanta Das 24
Problem
Requirements Identification
SAS should maintain the inventory of the various items of the supermarket.
The manager upon query should be able to see the inventory details. In
order to support inventory management, the inventory of an item should
be decreased whenever an item is sold. SAS should also support an
option by which an employee can update the inventory whenever new
supply arrives.

SAS should support printing the sales statistics for every item the super
market deals with for any particular day or any particular period. The
sales statistics should indicate the quantity of an item sold, the price
realized, and the profit accrued.

The manager of the super market should able to change the price at which
an item is sold as the prices of the different items may vary on a day-to-
day basis.
22/3/7 Ajanta Das 25
Identifying Actors

Customer Employee

SAS

SalesClerk Manager

22/3/7 Ajanta Das 26


Identifying Use Cases

pickUpItem

processTransaction

changePrice

printBill
prepareSalesStats

updateInventory

22/3/7 Ajanta Das 27


SAS Use Case Diagram

Customer pickUpItem salesClerk Employee


updateInventory

changePrice
Manager
SAS

printBill

prepareSalesStat

22/3/7 Ajanta Das 28


SAS Use Case Diagram –V2

Customer pickUpItem salesClerk Employee


updateInventory

changePrice Manager
processTransaction
SAS

printBill

prepareSalesStat

22/3/7 Ajanta Das 29


Activity Diagram
• It is used to describe the business and operational
workflows of components step-by-step in a system
• An activity diagram shows the overall flow of
control
• Activities are states that represents the
performance of actions or subactivities
• Transitions (or next state) are triggered by the the
actions or subactivities

22/3/7 Ajanta Das 30


Activity Diagram contd.
It depicts
• Start point: start point of the activity diagram
• End point: end of the same diagram
• Activities: represents states of the system
• Decision points: through this point one activity
would be happened
• Swim lanes: represents group activities for
each actor in the diagram
22/3/7 Ajanta Das 31
Symbols used in Activity Diagram

22/3/7 Ajanta Das 32


Activity Diagram contd.
• Fork: splits an incoming transition into several
concurrent outgoing transitions. All of the
transitions fire together.
• Join: Merges transitions from concurrent
regions into a single outgoing transitions.
Activities: represents states of the system
• Decision: A state node that represents a decision.
Each transition from this node depends on a
Boolean condition
22/3/7 Ajanta Das 33
Symbols used in Activity Diagram

22/3/7 Ajanta Das 34


Symbols used in Activity Diagram

22/3/7 Ajanta Das 35


Example

22/3/7 Ajanta Das 36


22/3/7 Ajanta Das 37
SAS Activity Diagram part
SalesClerk Customer SAS

pickUpItem
placeItem

addCode
printBill

processTran
saction

makePayment

22/3/7 Ajanta Das 38


SAS Activity Diagram Contd.
SAS Employee Manager

printBill
updateInventory

prepareSalesStats

changePrice

updatePrice

22/3/7 Ajanta Das 39


SalesClerk
SAS Activity Diagram
Customer SAS Employee Manager

pickUpItem

placeItem

addCode

processTransaction
printBill
updateInventory

makePayment

prepareSalesStats

changePrice

updatePrice

22/3/7 Ajanta Das 40


CLASS DIAGRAM
• It describes the structure of a system by
showing the system's classes

• Each class depicts attributes and methods

• Classes are associated with different types of


relationships between them

22/3/7 Ajanta Das 41


CLASS Diagram contd.
Relationships are --
 Association:
 Example: "department offers courses", is an association

22/3/7 Ajanta Das 42


CLASS Diagram contd.
 Aggregation:
 It is a variant of the "has a" or association relationship;
It represents a part-whole or part-of relationship
 Aggregation can occur when a class is a collection or container of
other classes, but where the contained classes do not have a strong
life cycle dependency on the container--essentially, if the container
is destroyed, its contents are not

22/3/7 Ajanta Das 43


CLASS Diagram contd.
 Dependency:
 Dependency is a weaker form of relationship which
indicates that one class depends on another because it uses
it at some point of time
 Dependency exists if a class is a parameter variable or local variable
of a method of another class

• Composition:
– It is a stronger variant of the "owns a" or association relationship;
composition is more specific than aggregation. It is represented with a
solid diamond shape
– Composition usually has a strong life cycle dependency between
instances of the container class and instances of the contained class(es):
If the container is destroyed, normally every instance that it contains is
destroyed as well

22/3/7 Ajanta Das 44


Composition

22/3/7 Ajanta Das 45


CLASS Diagram contd.
 Generalization:
It indicates that one of the two related classes (the
subtype) is considered to be a specialized form of the
other (the supertype) and supertype is considered as
'Generalization' of subtype

22/3/7 Ajanta Das 46


CLASS Diagram contd.

22/3/7 Ajanta Das 47


SAS Class Diagram
SAS
Customer item_no : int
cust_id : String item_price : double
item_name : String
item_qty : int printBill()
price : double prepareSalesStats()

pickUpItem()
makePayment()
Employee
item_name
item_qty
item_code
emp_id
SalesClerk
clerk_id : String updateInventory() Manager
item_name : String item_name : String
item_code : String item_code : String
item_unit_price : double
processTransaction()
updatePrice()
22/3/7 Ajanta Das 49
SEQUENCE Diagram
• UML sequence diagram models the flow of logic within
the system in a visual manner
• Sequence diagram is kind of interaction diagram
• It shows an interaction, consisting of a set of objects and
their relationships, including the messages that may be
dispatched among them
• A sequence diagram is an interaction diagram that
emphasizes the time-ordering of messages
• Interaction diagram address the dynamic view of a
system

22/3/7 Ajanta Das 50


Synchronous Message

22/3/7 Ajanta Das 51


22/3/7 Ajanta Das 52
Example

22/3/7 Ajanta Das 53


Customer
SAS Sequence Diagram
SalesClerk SAS Employee Manager

pickUpItem()

Place item

processTransaction()

Customer is
Item details
waiting for
payment
printBill()

Bill details

Bill Details

makePayment()

Sales details

updateInventory()

Inventory details

prepareSalesStats()

sales statistics

updatePrice()

Price details

22/3/7 Ajanta Das 54


Conclusions

22/3/7 Ajanta Das 55


Acknowledgements

Mridul Paul

Siba Mitra

22/3/7 Ajanta Das 56


References
• “Visual Modeling with Rational Rose 2002
and UML” by Terry Quartrani
• “Unified Modeling Language User Guide”,
Grady Booch, James Rumbaugh, Ivar
Jacobson, October 1998.
• Agile Modeling- available at:
http://www.agilemodeling.com/artifacts/
sequenceDiagram.htm
22/3/7 Ajanta Das 57
Thank you

You might also like