SDA Lab Manual
SDA Lab Manual
Week 12 Draw Model view control (MVC) pattern of any Design doc Rational Rose
project using UML Diagrams
Objectives
• Introduce the lab environment and tools used in the software
engineering lab
• Discuss the Project & learn how to write project definition.
1. Outline
• Introduction to the lab plan and objectives.
• Project definition.
2. Background
The software engineer is a key person analyzing the business, identifying
opportunities for improvement, and designing information systems to implement these
ideas. It is important to understand and develop through practice the skills needed to
successfully design and implement new software systems.
2.1 Introduction
• In this lab you will practice the software development life cycle (project
management, requirements engineering, systems modeling, software design,
prototyping, and testing) using CASE tools within a team work environment.
• UML notation is covered in this lab as the modeling language for analysis and
design.
3. CASE Tools
No tools are used for this lab.
4. In-Class Example
Examples of problem definition will be presented in the class.
5. Exercises
• Form groups of 4 students (with one of them as a leader).
• Brainstorm and list 3 suitable project titles.
• Present these to the class.
• Choose one of the projects from your list.
• Try to write (a hypothetical) project definition for it.
• Present it to the instructor/class.
6. Deliverables
• Form teams of 4 students for the term project.
• Suggest / research a project and write a project definition/problem statement.
Object Oriented Software Engineering Lab Manual (IT0502)
2
Software Requirement
Specification (SRS)
Lab Manual
Objectives
• Gain a deeper understanding of the Software Requirement Specification
phase and the Software Requirement Specification (SRS).
• Learn how to write requirements and specifications.
1. Outline
• Review of the requirements engineering process.
• Write requirements and specifications.
• Software Requirement Specification (SRS).
2. Background
A requirement is a statement of a behavior or attribute that a system must possess for
the system to be acceptable to a stakeholder.
Creating specifications is important. However, you may not create specifications if:
• You are using a very incremental development process (small changes).
• You are building research or proof of concept projects.
• You rebuilding very small projects.
• It is not cheaper or faster than building the product.
3. CASE Tools
Nil
4. In-Class Demo
An overview of the requirements engineering process, and writing requirements and
specifications.
5. Exercises
Write SRS for your project
6. Deliverables
SRS for your project
Questions
3
Introduction to UML and Use
Case Diagram
Lab Manual
Objectives
• Study the benefits of visual modeling.
• Learn use case diagrams: discovering actors and discovering use cases.
• Practice use cases diagrams using Rational Rose.
1. Outline
• Visual modeling.
• Introduction to UML.
• Introduction to visual modeling with UML.
• Use case diagrams: discovering actors and use cases.
2. 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
11
11
Lab Manual
system's intended functions (use cases), its surroundings (actors), and relationships
between the use cases and actors (use case diagrams).
2.5 Actors
• Are NOT part of the system – they represent anyone or anything that must
interact with the system.
• Only input information to the system.
• Only receive information from the system.
• Both input to and receive information from the system.
• Represented in UML as a stickman.
3. CASE Tools
The Rational Rose product family is designed to provide the software developer with
a complete set of visual modeling tools for development of robust, efficient solutions
to real business needs in the client/server, distributed enterprise and real-time systems
environments. Rational Rose products share a common universal standard, making
12
12
Lab Manual
modeling accessible to nonprogrammers wanting to model business processes as well
as to programmers modeling applications logic.
4. In-Class Example
Now you will learn how to apply the above-mentioned methods to draw use case
diagrams from the problem statement. Please refer to Lab 5 slides which explain the
process in detail with some examples.
13
13
Lab Manual
5. Exercises
Read carefully the following problem statement
We are after a system that controls a recycling machine for returnable bottles and
cans. The machine will allow a customer to return bottles or cans on the same
occasion.
item, the system will check what type has been returned. The system will
register how many items each customer returns and, when the customer asks for a
receipt, the system will print out what he deposited, the value of the returned items
and the total return sum that will be paid to the customer.
The system is also be used by an operator. The operator wants to know how many
items of each type have been returned during the day. At the end of the day, the
operator asks for a printout of the total number of items that have been deposited in
the machine on that particular day. The operator should also be able to change
information in the system, such as the deposit values of the items. If something is
amiss, for example if a can gets stuck or if the receipt roll is finished, the operator will
be called by a special alarm signal.
6. Deliverables
You should submit the solutions for the previous exercises.
You should use these techniques to draw use case diagrams for your term project
using Rational Rose.
Questions
1. Draw the use case diagram of your system.
3. How we choose the use cases.
4. What is the need of use case diagram in a project.
14
14
Lab Manual
4
System Modeling
Entity-relationship diagram
(ERD)
15
15
Lab Manual
Objective:
Deeper understanding of System modeling:
• Data model: entity-relationship diagram (ERD).
1. Outline
System analysis model elements:
• Data model: entity-relationship diagram (ERD)
2. Background
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).
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.
16
16
Lab Manual
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
3. CASE Tools
You can use MS word to create your ERD.
4. In-Class Example
Now you will learn how to create ERD.
5. Exercises
ERD for your Project
6. Deliverables
You should create ERD for your term project
17
17
Lab Manual
5
System Modeling
18
18
Lab Manual
Objective:
Deeper understanding of System modeling:
• Functional model: data flow diagram (DFD).
1. Outline
System analysis model elements:
• Functional model: data flow diagram (DFD)
2. Background
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).
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.
19
19
Lab Manual
E xternal entity
Pr ocess
Data flow
Control flow
21
21
Lab Manual
3. CASE Tools
You can use MS word to create your DFD.
4. In-Class Example
Now you will learn how to create DFD.
5. Exercises
DFD for your Project
6. Deliverables
You should create DFD for your term project
Questions
1. Draw the DFD of your System.
2.How we balance a DFD.
3. How we choose the level of DFD.
4. What is the need of DFD in a project.
22
22
Lab Manual
6
Documenting Use Cases
23
23
Lab Manual
Objectives
• Study how to document use cases in detail.
• Know about scenarios (flow of events) and its importance.
1. Outline
• Writing flow of events.
• Flow of events template and example.
2. Background
Each use case is documented with a flow of events. The flow of events for a use case
is a description of the events needed to accomplish the required behavior of the use
case. Activity diagrams may also be created at this stage in the life cycle. These
diagrams represent the dynamics of the system. They are flow charts that are used to
show the workflow of a system; that is, they show the flow of control from one
activity to another in the system,
24
24
Lab Manual
Each project should use a standard template for the creation of the flow of events
document. The following template seems to be useful.
X Flow of events for the <name> use case
X.1 Preconditions
X.2 Main flow
X.3 Sub-flows (if applicable)
X.4 Alternative flows
where X is a number from 1 to the number of use cases.
25
25
Lab Manual
A sample completed flow of events document for the Select Courses to Teach use
case follows.
1.1 Preconditions
Create course offerings sub-flow of the maintain course information use case must
execute before this use case begins.
If the activity selected is ADD, the S-1: add a course offering sub-flow is performed.
If the activity selected is DELETE, the S-2: delete a course offering sub-flow is
performed.
If the activity selected is REVIEW, the S-3: review schedule sub-flow is performed.
If the activity selected is PRINT, the S-4: print a schedule sub-flow is performed.
1.3 Sub-flows
S-1: Add a Course Offering:
The system displays the course screen containing a field for a course name and
number. The professor enters the name and number of a course (E-3). The system
displays the course offerings for the entered course (E-4). The professor selects a
course offering. The system links the professor to the selected course offering (E-5).
The use case then begins again.
27
27
Lab Manual
E-2: An invalid semester is entered. The user can re-enter the semester or terminate
the use case.
E-3: An invalid course name/number is entered. The user can re-enter a valid
name/number combination or terminate the use case.
E-4: Course offerings cannot be displayed. The user is informed that this option is not
available at the current time. The use case begins again.
E-5: A link between the professor and the course offering cannot be created. The
information is saved and the system will create the link at a later time. The use case
continues.
E-6: An invalid course offering name/number is entered. The user can re-enter a valid
course offering name/number combination or terminate the use case.
E-7: A link between the professor and the course offering cannot be removed. The
information is saved and the system will remove the link at a later time. The use case
continues.
E-8: The system cannot retrieve schedule information. The use case then begins again.
E-9: The schedule cannot be printed. The user is informed that this option is not
available at the current time. The use case begins again.
Use case flow of events documents are entered and maintained in documents external
to Rational Rose. The documents are linked to the use case.
3. CASE Tools
Rational Rose .
4. In-Class Example
Now you will learn how to apply the above mentioned methods to write flow of
Events.
5. Exercises
Apply to your Project
6. Deliverables
28
28
Lab Manual
You should use these techniques to write flow of events.
Questions
1. Draw the use case diagram of your System.
2. How to document use cases?
7
Activity Diagrams
29
29
Lab Manual
Objectives.
• Deeper understanding of UML activity diagrams.
• Practicing flow of events and activity diagrams using Rational Rose.
1. Outline
• Activity diagrams.
• Examples.
2. Background
Each use case is documented with a flow of events. The flow of events for a use case
is a description of the events needed to accomplish the required behavior of the use
case. Activity diagrams may also be created at this stage in the life cycle. These
diagrams represent the dynamics of the system. They are flow charts that are used to
show the workflow of a system; that is, they show the flow of control from one
activity to another in the system.
3. CASE Tools
Rational Rose .
4. In-Class Example
Now you will learn how to draw activity diagrams from the use case(s) flow of events
5. Exercises
Apply to your Project
6. Deliverables
You should use these techniques to draw activity diagrams for your term project.
21
21
Lab Manual
8
Object Oriented Analysis:
Discovering Classes
22
22
Lab Manual
Objective
• Learn the object-oriented analysis phase by understanding the methods
of class elicitation and finding the classes in an object-oriented system.
1. Outline
• Object-Oriented concepts
• Discovering classes’ approaches: noun phrase approach, common class
patterns, use case driven method, CRC (Class-Responsibility-Collaboration)
and mixed approach.
• Examples.
2. Background
Classes: a description of a group of objects with common properties (attributes),
common behavior (operations), common relationships to other objects and common
semantics.
23
23
Lab Manual
• Control: model sequencing behavior specific to one or more use cases. Control
classes coordinate the events needed to realize the behavior specified in the use
case, and they are responsible for the flow of events in the use case.
24
24
Lab Manual
2.4.1 Noun Phrase Approach: Examine the requirements and underline each noun.
Each noun is a candidate class; divide the list of candidate classes into:
• Relevant classes: part of the application domain; occur frequently in
requirements.
• Irrelevant classes: outside of application domain
• Fuzzy classes: unable to be declared relevant with confidence; require
additional analysis
2.4.2 Common Class Patterns: Derives candidate classes from the classification
theory of objects; candidate classes and objects come from one of the
following sources:
• Tangible things: e.g. buildings, cars.
• Roles: e.g. teachers, students.
• Events: things that happen at a given date and time, or as steps in an
ordered sequence: e.g. landing, request, interrupt.
• Interactions: e.g. meeting, discussion.
• Sources, facilities: e.g. departments.
• Other systems: external systems with which the application interacts.
• Concept class: a notion shared by a large community.
• Organization class: a collection or group within the domain.
• People class: roles people can play.
• Places class: a physical location relevant to the system.
2.4.3 Use Case Driven Method: The scenarios - use cases that are fundamental to
the system operation are enumerated. Going over each scenario leads to the
identification of the objects, the responsibilities of each object, and how these
objects collaborate with other objects.
25
25
Lab Manual
CRC cards are effective at analyzing scenarios; they force you to be concise
and clear; they are cheap, portable and readily available.
2.4.5 Mixed Approach: A mix of these approaches can be used, one possible
scenario is:
• Use CRC for brainstorming.
• Identify the initial classes by domain knowledge.
• Use common class patterns approach to guide the identification of the
classes.
• Use noun phrase approach to add more classes.
• Use the use case approach to verify the identified classes.
26
26
Lab Manual
3. CASE Tools
Rational Rose .
4. In-Class Example
Now you will learn how to apply the above mentioned methods of finding classes
from the problem statement.
5. Exercises
Apply to your Project
6. Deliverables
• You should use these class elicitation techniques to identify the classes for
your term project.
27
27
Lab Manual
9
Interaction Diagrams:
Sequence Diagram
28
28
Lab Manual
Objectives
• Better understanding of the interaction diagrams.
• Get familiar with sequence diagrams.
• Practice drawing the interaction diagrams using Rational Rose.
1. Outline
• Interaction diagrams:
o Sequence diagrams
2. Background
Interaction diagrams describe how groups of objects collaborate in some behavior. An
interaction diagram typically captures the behavior of a single use case.
Interaction diagrams do not capture the complete behavior, only typical scenarios.
29
29
Lab Manual
• You must know how to place the objects so that the sequence is clear.
• You may start the scenario by an actor.
• Timing is represented vertically downward.
• Arrows between life lines represents message passing.
• Horizontal arrows may pass through the lifeline of another object, but must
stop at some other object.
• You may add constraints to these horizontal arrows.
• Objects may send messages to themselves.
• Long, narrow rectangles can be placed over the lifeline of objects to show
when the object is active. These rectangles are called activation lines.
30
30
Lab Manual
3. CASE Tools
Rational Rose.
4. In-Class Example
Now you will learn how to apply the above mentioned methods of drawing sequence
diagrams from the problem statement.
5. Exercises
Apply to your Project
6. Deliverables
You should use these techniques to create sequence diagrams for your term project.
Questions
31
31
Lab Manual
10
Interaction diagrams:
collaboration diagrams showing
client server architecture pattern
32
32
Lab Manual
Objectives
• Better understanding of the interaction diagrams.
• Get familiar with collaboration diagrams.
• Practice drawing the interaction diagrams using Rational Rose.
1. Outline
• Interaction diagrams:
o Collaboration diagrams
2. Background
Interaction diagrams describe how groups of objects collaborate in some behavior. An
interaction diagram typically captures the behavior of a single use case.
Interaction diagrams do not capture the complete behavior, only typical scenarios.
2.3 Notes
• Always keep your diagrams simple.
• For “IF... then ...” else scenarios, you may draw separate sequence diagrams
for the different branches of the “if statement”. You may even hide them, (at
least during the analysis phase) and document them by the text description
accompanying the sequence diagrams.
3. CASE Tools
33
33
Lab Manual
Rational Rose.
4. In-Class Example
Now you will learn how to apply the above mentioned methods of drawing collaboration
diagrams from the problem statement.
5. Exercises
Apply to your Project
6. Deliverables
You should use these techniques to create collaboration diagrams for your term project.
34
34
Lab Manual
11
Software Design:
Software Architecture and Object-
Oriented Design
35
35
Lab Manual
Objectives
• Deeper understanding of software design and the software design
document (SDD).
• Learn how to find the relationships between classes to create UML class
diagram.
1. Outline
• Software design concepts and principals.
• Software architecture.
• Specifying the attributes and the operations and finding the relationships
between classes.
• Creating UML class diagram.
• Software design document.
2. Background
The purpose of software design is “to produce a workable (implementable) solution to
a given problem.” David Budgen in Software Design: An Introduction.
30
30
Lab Manual
• Design should produce modules that exhibit independent functional
characteristics.
• Design should support verification and maintenance.
31
31
Lab Manual
3. CASE Tools
Rational Rose.
4. In-Class Example
Now you will learn how to specify classes’ attributes, methods and the relationships
between the classes.
5. Exercises
32
32
Lab Manual
6. Deliverables
• Also you should use specifying class attributes, methods and the relationship
with other classes you learned in your term project.
12
Model view control (MVC) pattern of
any project using UML Diagrams
33
33
Lab Manual
Lab 12: Draw Model view control (MVC) pattern of any project
using UML Diagrams (open ended lab)
Objectives
• Deeper understanding of Model view control (MVC) pattern
• Learn how to Draw Model view control (MVC) pattern of any project
using UML Diagrams
1. Outline
• Software design concepts and principals.
• Software architecture.
34
34
Lab Manual
• Specifying the attributes and the operations and finding the relationships
between classes.
• Creating UML diagram.
• Software design document.
2. Background
3. CASE Tools
Rational Rose.
4. In-Class Example
Now you will learn how to specify classes’ attributes, methods and the relationships
between the classes.
5. Exercises
6. Deliverables
• Document UML diagram that depicts MVC pattern of project.
35
35
Lab Manual
13
State Transition Diagram
36
36
Lab Manual
Objectives
• Deeper understanding of UML state transition diagrams (STD).
• Practicing using Rational Rose.
1. Outline
• UML state diagrams.
• UML state diagram notation
• UML state details
• Examples
2. Background
Mainly, we use interaction diagrams to study and model the behavior of objects in our
system. Sometimes, we need to study the behavior of a specific object that shows
complex behavior to better understand its dynamics. For that sake, UML provides
state transition diagrams used to model the behavior of objects of complex behavior.
In this Lab, UML state transition diagrams will be introduced. We will study their
notation and how can we model them using Rational Rose.
37
37
Lab Manual
• There is no need to prepare a state diagram for every class you have in the
system.
38
38
Lab Manual
• In the operations part, we usually use one of the following reserved words:
o Entry: a specific action performed on the entry to the state.
o Do: an ongoing action performed while in the state.
o On: a specific action performed while in the state.
o Exit: a specific action performed on exiting the state.
• There are two special states added to the state transition diagram- start state
and end state.
• Notation of start state is a solid black circle and for the end state a bull’s eye is
used.
3. CASE Tools
Rational Rose .
4. In-Class Example
Now you will learn how to apply the above mentioned methods of drawing state
transition diagrams (STD).
39
39
Lab Manual
5. Exercises
Apply to your Project
6. Deliverables
You should use these techniques to create state transition diagrams for your term
project.
40
40
Lab Manual
14
Implementation Diagrams:
Component diagrams showing component based
architecture pattern
41
41
Lab Manual
1. Outline
• Implementation diagrams: component diagrams.
• Examples.
2. Background
Implementation diagrams capture design information. The main implementation
diagrams in UML are: component and deployment diagrams. In this Lab we will
study these diagrams and their notation.
42
42
Lab Manual
3. CASE Tools
Rational Rose.
4. In-Class Example
Now you will learn how to apply the above mentioned methods of creating
component diagrams.
5. Exercises
Apply system and its components and draw component diagrams.
6. Deliverables
You should use these techniques to create component diagrams for
your term project.
43
43
Lab Manual
44
44
Lab Manual
15
Implementation Diagrams:
Deployment Diagrams
45
45
Lab Manual
Objectives
• Become familiar with the implementation diagrams: component and
deployment diagrams.
• Practice using Rational Rose.
1. Outline
• Implementation diagrams: deployment diagrams.
• Examples.
2. Background
Implementation diagrams capture design information. The main implementation
diagrams in UML are: component and deployment diagrams. In this Lab we will
study these diagrams and their notation.
46
46
Lab Manual
47
47
Lab Manual
3. CASE Tools
Rational Rose.
4. In-Class Example
Now you will learn how to apply the above mentioned methods of creating
deployment diagrams.
5. Exercises
Apply system and its components and draw deployment diagrams.
6. Deliverables
You should use these techniques to create deployment diagrams for your term
project.
48
48
Lab Manual
16
Software Testing and
Documentation
49
49
Lab Manual
Objectives
• Gain a deeper understanding of software testing and the software testing
document.
• Become familiar with a software testing tool (JUnit).
1. Outline
• Overview of software testing.
• Unit testing.
• JUnit tutorial.
• Software test specification.
2. Background
Testing is the process of executing a program with the intent of finding errors. A good
test case is one with a high probability of finding an as-yet undiscovered error. A
successful test is one that discovers an as-yet-undiscovered error.
The causes of the software defects are: specification may be wrong; specification may
be a physical impossibility; faulty program design; or the program may be incorrect.
3. CASE Tools
JUnit is an open-source project to provide a better solution for unit testing in Java. It
can be integrated with many Java IDEs.
Central idea: create a separate Java testing class for each class you’re creating, and
then provide a means to easily integrate the testing class with the tested class for unit
testing.
41
41
Lab Manual
4. In-Class Demo
A tutorial on how to use JUnit with some example will be presented.
5. Exercises
Write a JUnit test class for testing
public class Exercise {
6. Deliverables
• You should submit the solutions for the previous exercise in a document.
• Also, if you are building your project using Java, you should use JUnit for
testing.
42
42