You are on page 1of 8

Lab Experiment 6 & 7 Date: 30/07/2020

System Modeling
Objective:
 To draw a sample Entity Relationship Diagram for a real project or
system.
 Draw the Data Flow Diagrams at level 0 and level 1

Software Requirements:
CASE Tools
 Rational Rose for ERD
 MS Visio or MS Word for DFD

Theory
System analysis model elements:

 Data model: entity-relationship diagram (ERD)


 Functional model: data flow diagram (DFD)

Modeling consists of building an abstraction of reality. These abstractions are simplifications


because they ignore irrelevant details and they only represent the relevant details (what is
relevant or irrelevant depends on the purpose of the model).

Why Model Software?


Software is getting larger, not smaller; for example, Windows XP has more than 40 million lines
of code. A single programmer cannot manage this amount of code in its entirety. Code is often
not directly understandable by developers who did not participate in the development; thus, we
need simpler representations for complex systems (modeling is a mean for dealing with
complexity).

A wide variety of models have been in use within various engineering disciplines for a long time.
In software engineering a number of modeling methods are also available.

Analysis Model Objectives


 To describe what the customer requires.
 To establish a basis for the creation of a software design.
 To define a set of requirements that can be validated once the software is built.

The Elements of the Analysis Model


The generic analysis model consists of:

 An entity-relationship diagram (data model).


 A data flow diagram (functional model).
 A state transition diagram (behavioral model).

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

Entity Relationship Diagram


An entity relationship diagram (ERD) is one means of representing the objects and their
relationships in the data model for a software product.

Entity Relationship diagram notation:

Entity

Relationship

To create an ERD you need to:


 Define “objects” by underlining all nouns in the written statement of scope:
producers/consumers of data, places where data are stored, and “composite” data items.
 Define “operations” by double underlining all active verbs: processes relevant to the
application and data transformations.
 Consider other “services” that will be required by the objects.
 Then you need to define the relationship which indicates “connectedness”: a "fact" that
must be "remembered" by the system and cannot be or is not computed or derived
mechanically.

An Entity Relationship Diagram Methodology: (one way of doing it)

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

Example:
A company has several departments. Each department has a supervisor and at least one
employee. Employees must be assigned to at least one, but possibly more departments. At least
one employee is assigned to a project, but an employee may be on vacation and not assigned to
any projects. The important data fields are the names of the departments, projects, supervisors
and employees, as well as the supervisor and employee number and a unique project number.

Identify Entities
The entities in this system are Department, Employee, supervisor and Project. One is tempted to
make Company an entity, but it is a false entity because it has only one instance in this problem.
True entities must have more than one instance.

Find Associations and Relationships


We construct the following Relationship Matrix:

Draw Rough ERD

We connect the entities whenever a relationship is shown in the entity relationship Matrix.

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

Fill in Cardinality

From the description of the problem we see that:

 Each department has exactly one supervisor.


 A supervisor is in charge of one and only one department.
 Each department is assigned at least one employee.
 Each employee works for at least one department.
 Each project has at least one employee working on it.
 An employee assigned to 0 or more projects.

Define Primary keys


The primary keys are Department Name, Supervisor Number, Employee Number, and Project
Number.

Draw Key-Based ERD


There are two many-to-many relationships in the rough ERD above, between Department and
Employee and between Employee and Project. Thus we need the associative entities
Department-Employee and Employee-Project. The primary key for Department-Employee is the
concatenated key Department Name and Employee Number. The primary key for Employee-
Project is the concatenated key Employee Number and Project Number.

Identify Attributes
The only attributes indicated are the names of the departments, projects, supervisors and
Employees, as well as the supervisor and employee NUMBER and a unique project number.

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

Map Attributes

Draw Fully Attributed ERD

Check Results

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

Data Flow Diagram


A data flow data diagram is one means of representing the functional model of a software product. DFDs
do not represent program logic like flowcharts do.

Data flow diagram notation:

External entity

Process

Data flow

Control flow

Data store

Data flow diagram layers

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

To create a DFD you need to:


 Review ERD to isolate data objects and grammatical parse to determine operations.
 Determine external entities (producers and consumers of data).
 Create a level 0 DFD “Context Diagram” (one single process).
 Balance the flow to maintain data flow continuity.
 Develop a level 1 DFD; use a 1:5 (approx.) expansion ratio.
Data Flow Diagram Guidelines:
 All icons must be labeled with meaningful names.
 Always show external entities at level 0.
 Always label data flow arrows.
 Do not represent procedural logic.
 Each bubble is refined until it does just one thing.
Data Flow Diagram Levels:
The first level DFD shows the main processes within the system. Each of these processed can be
broken into further processes until you reach pseudocode.

Example:
Draw a first-level (level 1) data flow diagram for an online shopping website that verify the credit card
details, ship items and maintain customer account.

SWE-104 Introduction to Software Engineering Roll no.


Lab Experiment 6 & 7 Date: 30/07/2020

Exercises

a. Create an ERD for the given scenario:


Customers visit the website to purchase gardening items. Customers may or may not place
orders at any one time. Each order is assigned a unique order code and an order may have
multiple items. One order can have multiple transactions since customers may add items,
change the quantity of items or even return items after purchase, if they so desire. Relevant
customer information includes name, address and telephone number.

b. Create an ERD and DFD for creating a basic Learning Management System (LMS)
c. Create a DFD for:
i. Student Registration System.
ii. (a + b) * ( c + a * d)

SWE-104 Introduction to Software Engineering Roll no.

You might also like