>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ops="http://www.idpf.org/2007/ops">
<head>
<title>Object-Oriented Analysis and Design Using UML: Student Guide</title>
<link rel="stylesheet" type="text/css" href="css/Style.css"/>
<link rel="stylesheet" type="application/vnd.adobe-page-template+xml"
href="page-template.xpgt"/>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf8"/>
<script
src="http://www.niitstudent.com/india/NDCR2/webReaderApplication.Web/JQuery_Sc
ript/jquery-1.7.1.min.js" type="text/javascript"></script>
<script
src="http://www.niitstudent.com/india/NDCR2/webReaderApplication.Web/JQuery_Sc
ript/GlobalContentSecrity.js" type="text/javascript"></script>
<script src="http://www.niitstudent.com/india/Content/analytics.js"
type="text/javascript"></script>
</head>
<body>
<h3 class="chno" id="ch04"><em>Chapter 4</em></h3>
<h1 class="chname">Migrating from Requirements to Design</h1>
<p class="nonindent">Work in the design phase can start after analyzing the
requirements of a software system in the requirements analysis phase. Before
starting work in the design phase, you need to determine the system boundaries
and the scope of your project so that you can complete the project within the
specified time period. In addition, you need to refine the system definition, which
was created by using use case diagrams in the initial stages of the development
process.</p>
<p class="nonindent">This chapter discusses how to determine the system
boundaries and the project scope. In addition, it explains how to refine the system
definition by refining the use case diagrams.</p>
<h2 class="section-head2">Objectives</h2>
<p class="nonindent">In this chapter, you will learn to:</p>
<li>Identify the iterations to develop the system. The first iteration includes the
basic use cases of the system and the successive iterations include the remaining
use cases according to their priority.</li>
<li>Identify the interaction among the use cases and actors of each iteration.</li>
</ol>
<p class="nonindent">To identify the system boundary, consider the example of
the hospital administration system, which needs to be developed in multiple
iterations. The use cases identified for the hospital administration system at the
requirements analysis phase are:</p>
<ul class="square">
<li><strong>Give Appointment</strong>: Gives an appointment to the patient
using the automated voice response system.</li>
<li><strong>Accept Fee</strong>: Accepts payment from patients for the services
of the doctor.</li>
<li><strong>Reordering Medicines</strong>: Orders medicines whenever the
medicines reach the reorder level.</li>
<li><strong>Print Slip</strong>: Prints the prescription on the doctor's
computer.</li>
<li><strong>Accept Payment</strong>: Accepts payment from patients for the
purchased medicines.</li>
<li><strong>Modify Schedule</strong>: Enables the doctor to enter new
information or modify the existing information in the schedule.</li>
</ul>
<p class="nonindent">Based on the priority of use cases identified in the
requirements phase, you can identify various iterations for the hospital
administration system. For example, in the first iteration, you may decide to
implement the following requirements:</p>
<ul class="square">
<li>Accept telephone calls from patients to give new appointments and cancel the
existing appointments.</li>
<li>Automatically modify the schedule. The doctor should be notified about the
change in schedule due to the cancellation of any appointments. If the doctor still
wants to change the schedule, then all the affected appointments should be
cancelled and the patients should be informed accordingly.</li>
</ul>
<p class="nonindent">The use cases required to implement the requirements of
the first iteration are:</p>
<ul class="square">
<li>Give Appointment</li>
<li>Modify Schedule</li>
</ul>
<p class="nonindent">The <span class="cour">Give Appointment</span> use
case gives appointments to patients. The <span class="cour">Modify
Schedule</span> use case enables doctors to modify the schedule.</p>
<p class="nonindent">The actors identified for the first iteration of the hospital
administration system are:</p>
<ul class="square">
<li>Patient</li>
<li>Doctor</li>
</ul>
<p class="nonindent">The following figure depicts the use case diagram with the
system boundary for the first iteration of the hospital administration system.</p>
<p class="center"><img src="images/4.5a.jpg" alt=""/></p>
<p class="nonindent">In the second iteration, you can add the printing the
prescribed medication slip requirement to the prototype developed in the first
iteration. The <span class="cour">Print Slip</span> use case is required to
implement the additional requirement of the second iteration. The actors of the
second iteration are <span class="cour">Patient</span> and <span
class="cour">Doctor</span>. The following figure depicts the use case diagram
with the system boundary for the second iteration of the hospital administration
system.</p>
<p class="center"><img src="images/4.5b.jpg" alt=""/></p>
<p class="nonindent">In the third iteration, you can add the following
requirements to the prototype developed in the second iteration:</p>
<ul class="square">
<li>Accept fee from the patient for the services of the doctor</li>
<li>Print fee receipt for the patient</li>
</ul>
<p class="nonindent">The use cases identified to implement the additional
requirements of the third iteration are:</p>
<ul class="square">
use case diagram of the first iteration of the hospital administration system, a
<span class="cour">Check Schedule</span> use case needs to be created, the
functions of which are required in the functions of the <span class="cour">Give
Appointment</span> use case and the <span class="cour">Modify
Schedule</span> use case. For this reason, the <span class="cour">Check
Schedule</span> use case can be included in the <span class="cour">Give
Appointment</span> use case and the <span class="cour">Modify
Schedule</span> use case. The following figure depicts the new use case diagram
for the first iteration of the hospital administration system.</p>
<p class="center"><img src="images/4.11.jpg" alt=""/></p>
<h4 class="note"><img src="images/note1.jpg" alt=""/></h4>
<p class="note1"><em>The second iteration use case diagram has not been
refined as it does not contain include or extend relationship</em>.</p>
<p class="nonindent">In the third iteration, the <span class="cour">Print Fee
Receipt</span> and <span class="cour">Accept Fee</span> use cases are added
to the prototype developed in second iteration. The <span class="cour">Print
Slip</span> use case of the second iteration can be extended to obtain the <span
class="cour">Print Fee Receipt</span> use case of the third iteration.</p>
<p class="nonindent">The following figure depicts the use case diagram for the
third iteration of the hospital administration system.</p>
<p class="center"><img src="images/4.12.jpg" alt=""/></p>
<h2 class="section-head2" id="ch04s02s02">Realizing Use Cases in the Design
Phase</h2>
<p class="nonindent">In the implementation phase, you need to incorporate the
functions of the refined use cases into code. Therefore, in the design phase, you
need to understand how the functions of a use case can be implemented using
classes, interfaces, and sub-systems in the implementation phase. This is called
realizing use cases.</p>
<p class="nonindent">UML provides specific modeling constructs, known as
collaborations, to model use case realizations in the design phase. Collaboration is a
collection of classes, interfaces, and sub-systems that interact with each other to
achieve the functions of a use case.</p>
<p class="nonindent">The following figure shows the graphical representation of
collaboration in UML.</p>
<p class="center"><img src="images/4.13a.jpg" alt=""/></p>
<p class="nonindent">Collaboration represents the following aspects of use
cases:</p>
<ul class="square">
<p class="nonindent">You use the use cases to generate test cases. A use case
model that records all the use cases of the system, how the use cases interact, and
how the actors initiate the use cases provides useful information for creating test
cases. The following information about use cases enables you to generate test
cases:</p>
<ul class="square">
<li>Basic flow of events and all the alternate flows.</li>
<li>Descriptions of preconditions and post conditions for the functions of a use
case.</li>
<li>Non-functional requirements, such as performance, reliability, usability, and
supportability of the system.</li>
</ul>
<h4 class="note"><img src="images/note1.jpg" alt=""/></h4>
<p class="note1"><em>A related set of test cases is known as a test
scenario</em>.</p>
<p class="nonindent">To generate test cases from use cases, you need to perform
the following tasks:</p>
<ol class="arabic">
<li>Identify the instances of a use case.</li>
<li>Identify the test input and expected results for each instance of the use
case.</li>
<li>Identify the conditions required to execute each use case instance.</li>
<li>Add test input values to complete the test cases.</li>
</ol>
<h4 class="section">Identifying the Instances of a Use Case</h4>
<p class="nonindent">A use case instance represents the execution of the
sequence of actions that a use case specifies. You need to organize the instances of
each use case using a test matrix that should contain the following
information:</p>
<ul class="square">
<li>The instances of each use case in a numbered list.</li>
<li>The basic and alternate flows represented by each instance of a use case.</li>
</ul>
cases to verify that the code correctly implements the functions of all the use cases.
The test cases are also mapped to the use cases to verify whether or not all the use
cases have been tested. You need to trace requirements for the following two
reasons:</p>
<ul class="square">
<li>The customer requirements may change during the SDLC of a project.</li>
<li>The implementation of a use case in an iteration may affect the functions of the
other use cases of the system.</li>
</ul>
<p class="nonindent">To perform requirements traceability, you can use the
following two approaches:</p>
<ul class="square">
<li><strong>Backward</strong>: Involves tracing requirements from the testing
phase to the requirement gathering phase.</li>
<li><strong>Forward</strong>: Involves tracing requirements from the
requirement gathering phase to the testing phase.</li>
</ul>
<p class="nonindent">For example, to perform backward requirements traceability
in the hospital administration system, you need to verify whether or not the
identified test cases are adequate to test all the use cases. The test case identified
for the <span class="cour">Give Appointment</span> use case checks whether or
not the software system performs the following actions:</p>
<ul class="square">
<li>Asks for the age of the patient</li>
<li>Checks the schedule of the doctor</li>
<li>Gives an appointment accordingly</li>
</ul>
<p class="nonindent">The code should implement all the use cases of the hospital
administration system. You need to ensure that the use cases of the hospital
administration system map to the requirements of the desired software system.
Finally, you also verify that the requirements identified map to the features of the
software system.</p>
<h2 class="section-head2" id="ch04s02s05">Types of Use Cases used in an
Iterative Process</h2>
<p class="nonindent">Use cases evolve during iterative requirements gathering.
You can create the following use cases for an iterative model:</p>
<ul class="square">
<li>Facade use case</li>
<li>Filled use case</li>
<li>Focused use case</li>
</ul>
<h4 class="section">Facade Use Case</h4>
<p class="nonindent"><span class="cour">Facade</span> use cases describe the
software system in three terms: information, input, and output. You can also include
actors in a <span class="cour">facade</span> use case. You create facade use
cases in the initial phase of the requirements gathering process and, therefore, they
capture the ad-hoc and most basic requirements for the new system. The attributes
that facade use cases contain are:</p>
<ul class="square">
<li><strong>Use case name</strong>: Describes the function name, which is
implemented by the use case, in the customer terminology.</li>
<li><strong>Description</strong>: Describes the purpose and output of the use
case functions.</li>
<li><strong>Role name</strong>: Provides additional information about the role of
the actor involved in the association relationship with the use case.</li>
<li><strong>Input and output</strong>: Indicates the input and output of the
process modeled by the use case.</li>
</ul>
<h4 class="section">Filled Use Case</h4>
<p class="nonindent"><span class="cour">Filled</span> use cases are evolved
from facade use cases and they contain detailed information that is not provided in
the facade use cases. The information that a filled use case contains is:</p>
<ul class="square">
<li>Pre-conditions</li>
<li>Triggers</li>
<li>Actors</li>
<li>Basic course of events</li>
<li>Exceptions</li>
<li>Business rules</li>
</ul>
</ul>
<p class="nonindent">The project manager of Janes Technologies, Jennifer, adopts
an iterative approach for the development of the software system. Jennifer decides
to deliver the prototype after the second iteration of the software development life
cycle. In the first iteration, Jennifer plans to implement the required functions only
for the savings accounts. In the second iteration, she plans to implement the
required functions for the current accounts as well. Before developing the prototype,
Jennifer needs to create a design for the prototype.</p>
<p class="nonindent"><strong>Prerequisite</strong>: To perform this activity,
you will need the <strong>BANK_ATM.vsd</strong> file, which you created in the
activity “Identifying Requirements and Creating a Use Case Diagram for
the Infosuper Bank” of <a class="hlink" href="09_ch03.htm">Chapter
3</a>.</p>
<h4 class="section" id="ch04s03s02">Solution</h4>
<p class="nonindent">To design the prototype for the ATM system, you need to
perform the following tasks:</p>
<ol class="arabic">
<li>Identify the system boundary for the first iteration and create the
corresponding use case diagram.</li>
<li>Refine the use case diagram for the first iteration.</li>
<li>Identify the system boundary for the second iteration.</li>
<li>Create the use case diagram for the first and second iterations using Visio.</li>
</ol>
<h5 class="section">Task 1: Identifying the System Boundary for the First
Iteration</h5>
<p class="nonindent">To identify the system boundary for the first iteration, you
need to identify the use cases and sctors. The use cases for the first iteration
are:</p>
<ul class="square">
<li>Cash Withdrawal(Savings)</li>
<li>PIN change(Savings)</li>
<li>Transaction Summary(Savings)</li>
</ul>
<p class="nonindent">The Actors for the first iteration are:</p>
<ul class="square">
<li>Bank Customer</li>
<li>Centralized Bank System</li>
</ul>
<p class="nonindent">The following figure shows the System Boundary for the first
iteration of the ATM system.</p>
<p class="center"><img src="images/4.24a.jpg" alt=""/></p>
<h5 class="section">Task 2: Refine the Use Case Diagram</h5>
<p class="nonindent">In the first iteration, the <span class="cour">Cash
Withdrawal (Savings)</span>, <span class="cour">Change PIN (Savings)</span>,
and <span class="cour">Transaction Summary (Savings)</span> Use Cases are
using the functions of the <span class="cour">Validation</span> Use Case.
Therefore, the <span class="cour">Validation</span> Use Case should be included
in the <span class="cour">Cash Withdrawal (savings)</span>, <span
class="cour">Change PIN (Savings)</span>, and <span class="cour">Transaction
Summary (Savings)</span> Use Cases. In Visio, the
<<include>> relationship is termed as a
<<uses>> relationship. The symbol for
<<uses>> relationship in Visio is shown in the
following figure.</p>
<p class="center"><img src="images/4.24b.jpg" alt=""/></p>
<h4 class="note"><img src="images/note1.jpg" alt=""/></h4>
<p class="note1"><em>The Uses symbol appears as <img
src="images/symbol.jpg" alt=""/> in the UML Use Case stencil</em>.</p>
<p class="nonindent">The following figure shows the <span
class="cour">refined</span> use case diagram for the first iteration.</p>
<p class="center"><img src="images/4.25a.jpg" alt=""/></p>
<h5 class="section">Task 3: Identifying the System Boundary for the Second
Iteration</h5>
<p class="nonindent">In the first iteration, the Use Cases are implementing the
savings account function. In the second iteration, the Use Cases need to implement
the current account function. The basic function of the corresponding Use Cases in
both the iterations is the same. Notice that, the input data, such as the format for
the account number and the ATM card number, may be different. Therefore, the
functions of the Use Cases of the first iteration can be extended to obtain the Use
Cases of the second iteration. In Visio, the
<<extend>> relationship is termed as
<<extends>> relationship. The symbol for
<<extends>> relationship in Visio is shown in the
following figure.</p>
<p class="nonindent">To create a use case diagram for the second iteration
perform the following steps:</p>
<ol class="arabic">
<li>Right-click the <strong>Top Package</strong> in the <strong>Model
Explorer</strong> window, and select <strong>New →Package</strong>.
The <strong>UML Package Properties</strong> dialog box appears.</li>
<li>Type the name as <strong>Iteration2</strong> in the
<strong>Name</strong> text box and click the <strong>OK</strong> button.
<strong>Iteration2</strong> folder is added and appears in the tree structure of
the <strong>Model Explorer</strong> window.</li>
<li>Right-click the <strong>Iteration2</strong> in the <strong>Model
Explorer</strong> window, and select <strong>New→Use Case
Diagram</strong>. The <strong>Use Case-1</strong> page with the blank
drawing page appears.</li>
<li><p>In addition to the Use Cases and Actors of the first iteration, draw the
following Use Cases for the second iteration:</p>
<p class="nonindent">The use cases for the second iteration are:</p>
<ul class="square">
<li>Cash Withdrawal(Current)</li>
<li>PIN change(Current)</li>
<li>Transaction Summary(Current)</li>
</ul>
<p class="nonindent">After creating all the use cases for second iteration, the use
case diagram should appear, as shown in the following figure.</p>
<p class="center"><img src="images/4.32.jpg" alt=""/></p>
</li>
<li><p>Drag the <strong>Extends</strong> symbol (<img
src="images/symbol.jpg" alt=""/>) on the drawing page from the <strong>UML Use
Case</strong> <strong>(Metric)</strong> stencil, to create a relationship between
Cash Withdrawal(Current) and Cash Withdrawal (Savings) Use Cases, as shown in
the following figure.</p>
<p class="center"><img src="images/4.33.jpg" alt=""/></p>
</li>
<li><p>Similarly, create the extend relationship between the Change PIN (Current)
and Change PIN (Savings) Use Cases and the Transaction summary (Current) and
Transaction summary (Savings) Use Cases, as shown in the following figure.</p>
<p class="nonindent">Blue Valley Consulting Inc. has identified two modules that
satisfy the topmost priorities of the system for its successful implementation. The
refined details of each of these modules are given.</p>
<h5 class="section">Module 1: Maintain Tenant Details</h5>
<p class="nonindent">The system should maintain information about all
leaseholders for the purpose of billing and tracking. This module will enable an
Operations Manager to enter the details whenever there is a change required in the
tenant information or a new tenant is found for leasing purpose. For each tenant,
the system should record an identification number. The data in the identification
number can be one of the following:</p>
<ul class="square">
<li>First name, last name, and Social Security Number (SSN) of an individual</li>
<li>The company name and federal tax ID for an organization</li>
</ul>
<p class="nonindent">The system will match the identification information with the
existing information and display the list of tenants, if any tenants with these details
exist. The Operations Manager can then enter the data and save the changes. If the
changes are not saved, the system will revert to the previous record. The system
will prompt the Operations Manager to enter all the mandatory data and alert him if
any duplicate entry is found. The system will not allow anyone to enter data for any
leaseholder whose lease is still active. This will ensure that the original record of the
leaseholder is not modified. This module will also store the changes made to the
tenant's records along with date and time and the name of the Operations
Manager who modified the record. It will also enable the Property Manager to query
the database to view derived data on the recorded information.</p>
<h5 class="section">Module 2: Maintain Capital Details</h5>
<p class="nonindent">This module will enable the Property Manager to view and
maintain the records of capital committed to the property. The capital includes the
revenues generated by leasing. This module will also enable the Property Manger to
enter data for the new capital and for updating existing records.</p>
<p class="nonindent">A capital investment in the automated Real Estate
Management System will be uniquely identified by the combination of the property
name, location and category, and a system-assigned serial number. The system will
display a list of investments from which Property Managers or Operations Managers
can select or enter an investment name. This module will also store the capital
amount, capital commitment schedule, estimated returns, and the time and date
when the information is modified along with the name of the Property Manager who
modified the record.</p>
<p class="nonindent">A Property Manager can also optionally enter any contact
information of people involved in the investment other than Blue Valley Consulting
Inc. The system will validate if all the mandatory information is entered and prompt
the Property Manager to enter the missing mandatory information, if any.</p>
<p class="nonindent">Prepare the use case diagrams and identify the system
boundaries for the two modules of the Real Estate Management System of the Blue
Valley Consulting Inc.</p>
<p class="nonindent"><img src="images/hint.png" alt="" id="QN03130000102"
class="hint" /></p>
<h4 class="section" id="ch04s05s02">Exercise 2</h4>
<p class="nonindent">A library maintains the record for each copy of a book until
the book is returned. A library member can issue up to six books at a time. If the
requested book is already issued, members can reserve the books in their name. A
member can also make reservations for the books over the phone or the Internet.
For the automated library management system, the following use cases need to be
implemented:</p>
<ul class="square">
<li><strong>Issue books</strong>: Validates the library members and checks if
the requested books can be issued to them. If the number of copies in the stock
exceeds the number of reservation requests, the book is issued. Otherwise, the
member is informed that the book is not available.</li>
<li><strong>Extend Period</strong>: Extends the period for retaining the book.
The software system checks if there is a reservation on the book. If there is already
a reservation made for the book, the period for retaining the book is not
extended.</li>
</ul>
<p class="nonindent">Draw a use case diagram for the library management
system. The use case diagram should depict the relationships, if any, that exist
among use cases.</p>
<p class="nonindent"><img src="images/hint.png" alt="" id="QN03130000103"
class="hint" /></p>
<p class="pagebreak"> </p>
<h1 class="chapter-head1" id="ch04s06">Reference Links</h1>
<h4 class="section">Setting Boundaries and Project Scope</h4>
<table border="1" cellspacing="0" cellpadding="6" width="100%">
<tr valign="top">
<td align="left" style="width:30%"><strong><em>Reference Reading:
Books</em></strong></td>