Lab 04 UML Context Diagram DFD 19102024 062645pm
Lab 04 UML Context Diagram DFD 19102024 062645pm
Teacher Signature:
1
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Software Construction
SOFTWARE CONSTRUCTION
LAB EXPERIMENT # 4
Background
Visual Modeling is a way of thinking about problems using models organized around
real-world ideas. Models are useful for understanding problems, communicating with
everyone involved with the project (customers, domain experts, analysts, designers,
etc.), modeling enterprises, preparing documentation, and designing programs and
databases
Visual Modeling
• Capture the structure and behavior of architectures and components.
• Show how the elements of the system fit together.
• Hide or expose details appropriate for the task.
• Maintain consistency between a design and its implementation.
• Promote unambiguous communication.
History of UML
The UML is an attempt to standardize the artifacts of analysis and design: semantic
models, syntactic notation and diagrams. The first public draft (version 0.8) was
introduced in October 1995. Feedback from the public and Ivar Jacobson's input were
10
10
Lab Manual: Software Construction
included in the next two versions (0.9 in July 1996 and 0.91 in October 1996).
Version 1.0 was presented to the Object Management Group (OMG) for
standardization in July 1997. Additional enhancements were incorporated into the 1.1
version of UML, which was presented to the OMG in September 1997. In November
1997, the UML was adopted as the standard modeling language by the OMG.
REQ1: A customer wishing to borrow a video provides the empty box of the video they
desire, their membership card, and payment
REQ2: payment is always with the credit card used to open the customer account. The
customer then returns the video to the store after watching it.
REQ3: If a loaned video is overdue by a day the customer's credit card is charged, and a
reminder letter is sent to them. Each day after that a further card is made, and each week a
reminder letter is sent. This continues until either the customer returns the video, or the
charges are equal to the cost of replacing the video.
REQ4: New customers fill out a form with their personal details and credit card details,
and the counter staff give the new customer a membership card. Each new customer's form
is added to the customer file.
REQ5: The local video supplier sends a list of available titles to Video-Rental LTD, who
decide whether to send them an order and payment. If an order is sent then the supplier
sends the requested videos to the store. For each new video a new stock form is completed
and placed in the stock file.
Actors
• Are NOT part of the system – they represent anyone or anything that must interact
with the system.
• Input information to the system.
• Receive information from the system.
• Both input to and receive information from the system.
• Usually represented in UML as a stickman.
11
11
Lab Manual: Software Construction
The symbol for an actor does not differentiate between a primary actor and a secondary
actor; the difference must be inferred from the use case descriptions (also called use case
narratives).
Use Case
• A sequence of transactions performed by a system that yields a measurable result
of values for a particular actor
• A use case typically represents a major piece of functionality that is complete
from beginning to end. A use case must deliver something of value to an actor.
Represented by Oval with use case text inside
Extends
• Optional behavior.
• Behavior only runs under certain conditions (such as alarm).
• Several different flows run based on the user’s selection.
12
12
Lab Manual: Software Construction
Context Diagram
The context diagram is used to establish the context and boundaries of the system to
be modelled: which things are inside and outside of the system being modelled, and
what is the relationship of the system with these external entities.
The context diagram is used to establish the context and boundaries of the system to
be modelled: which things are inside and outside of the system being modelled, and
what is the relationship of the system with these external entities.
The process of establishing the analysis framework by drawing and reviewing the
context diagram inevitably involves some initial discussions with users regarding
problems with the existing system and the specific requirements for the new system.
These are formally documented along with any specific system requirements
Having agreed on the framework, the detailed investigation of the current system must
be planned. This involves identifying how each of the areas included within the scope
will be investigated. This could be by interviewing users, providing questionnaires to
users or clients, studying existing system documentation and procedures, observation
and so on. Key users are identified and their specific roles in the investigation are
agreed upon.
13
13
Lab Manual: Software Construction
In order to produce the context diagram and agree on system scope, the following
must be identified:
• External entities
• External entities are the sources and recipients lies outside of the system under
investigation.
• Identify external entities by identifying sources and recipients of the data-flows,
which lie outside of the system under investigation.
• Draw and label a process box representing the entire system.
• Data-flows
• Data Flow is the Flow of data between system entities.
• Identify data-flows by listing the major documents and information flows
associated with the system.
• You may find the use of the following kind of table is useful:
Add the data-flows between the external entities and the system box
We can do a quick check when we have created the diagram by counting the number
of flows out of, and into each entity.
From column 'sender' we can see there should be:
o 5 data-flows out of the system
o 5 data-flows out of customer
o 2 data-flows out of supplier
14
14
Lab Manual: Software Construction
From column 'receiver' we can see there should be:
o 7 data-flows into the system.
o 3 data-flows into customer
o 2 data-flows out of supplier
Our context diagram looks as follows:
15
15
Lab Manual: Software Construction
• Data stores — where information is stored within the system. Data stores are
notated as rectangles with two parts
• The small left-hand box is used for the identifier, which comprises a
numerical reference prefixed by a letter
• The main area of the rectangle is labelled with the name of the data
store
“M” is used where a manual data store is being depicted.
“D” is used where it is a computer-based data store.
“T” is used where a temporary data store is being represented.
Types of DFD
Data Flow Diagrams are either Logical or Physical.
Logical DFD
This type of DFD concentrates on the system process, and flow of data in the system.
For example in a Banking software system, how data is moved between different
entities.
Physical DFD
This type of DFD shows how the data flow is actually implemented in the system. It is
more specific and closer to the implementation.
DFD Level 1
Divide the Main system into major sub-system, Add data stores in our
system/ sub-system
16
16
Lab Manual: Software Construction
The first is the obvious one: you, as the software engineer, have not fully described a
process to your satisfaction, so you expand that process into a next level diagram. The
new diagram is built in just the same way that a level one is built from a context
diagram only the new inputs and outputs are precisely to the data flows to and from
the process you are expanding.
The second reason is that you realise the diagram you are working on is becoming
cluttered and unclear. To simplify the diagram, collect together a few of the processes.
Ideally, these processes should be related in some way. Replace them with a single
process and treat the original collection of processes as a lower level, expanding the
new process. The inputs and outputs to the new process are whatever inputs and
outputs that are needed to make the diagrams balance. Remember to re-number the old
processes to show that they have been moved down a level.
DFD Level 2
17
17
Lab Manual: Software Construction
Lab Tasks:
Now you will learn how to apply the above-mentioned methods to draw
Diagrams
1. From the problem statement of your project draw Use Case Diagram, Context
Diagram and Data Flow Diagram update the SRS and upload the updated version
on Trello.
2. Capture a screenshot of the updated SRS document, including the version number
and the created diagrams, and attach them to your lab file.
Note: Use Draw.io or MS Visio to accomplish the above mention task
TIME BOXING:
Teacher Signature:
11