Professional Documents
Culture Documents
Object Oriented Design
Object Oriented Design
Refined
Ram : Student
: bookController : Book
Object1 : Object2 :
Class1 Class2
Synchronous
message
Object1 : Object2 :
Class1 Class2
Asynchronous
message
Object1 : Object2 :
Class1 Class2
message( )
Procedure
call
Object1 : Object2 :
Class1 Class2
message( )
return message
Object1 :
Class1
Object1 :
Class1
<<create>> Object2 : Class2
message()
Destroy
BarcodeReader
object get the book issued
get the book issued
Notify the validate the membership and account of the member
controller issue
book request get the book issued
getBookBarcodeID( )
Read book acceptBookBarcodeID(bookBarcodeID)
barcode ID
Accept book
barcode ID
getMemberBarcodeID( )
Read member acceptMemberBarcodeID(memberBarcodeID)
displayMemberDetails(memberBarcodeID)
barcode ID
<<destroy>>
Accept member
barcode ID
Destroy
BarcodeReader
issueBook(bookBarcodeID, memberBarcodeID)
object issueBook(bookBarcodeID, memberBarcodeID)
validate(memberBarcodeID)
Destroy
BarcodeReader
issueBook(bookBarcodeID, memberBarcodeID)
object
Send issue book
request issueBook(bookBarcodeID, memberBarcodeID)
validate(memberBarcodeID)
An error message
is returned as Account full
account of Account full
member is full Account full
Sequence Diagram
Creating Sequence Diagram of use cases with extensions
A use case may contain exceptional cases which are modeled through extends
relationship between two use cases.
In the interaction diagram the extends relationship may be modeled by
procedure call i.e. inserting the functionality of extended use case.
For example, fine calculation use case extends the return book use case. Thus,
the use case description of the fine calculation use case extends the use case
description of return book. During execution of the sequence diagram, the fine
calculation procedure is inserted. The position of the procedure call can be
determined by the use case description of return book.
updateIssueStatus(bookBarcodeID)
Return book
and save the
information to
Object Oriented
database
Software Engineering by Yogesh Singh & Ruchika Malhotra
: Library Staff : BarcodeReader : ReturnBookInterface : ReturnBookController : Transaction : Member : Book
getBookBarcodeID( )
Read book acceptBookBarcodeID(bookBarcodeID)
barcodeID displayMemberDetails(memberBarcodeID)
<<destroy>>
Return book
and check fine returnBook(bookBarcodeID)
returnBook(bookBarcodeID)
status retrieveMember(bookBarcodeID)
[member=student] checkFine(bookBarcodeID)
status of fine=true
<<create>>
: FineCalculator
Fine exists calculateFine(bookBarcodeID, memberBarcodeID)
hence create
fine calculator
object calculateFine(bookBarcodeID, memberBarcodeID)
<<create>>
: FineStatus
Notify fine saveFine(bookBarcodeID, memberBarcodeID, fine)
amount to actor
<<destroy>>
fine amount
<<destroy>>
fine amount
Return book fine amount
and save the returnBook(bookBarcodeID)
information to
decrementBook(memberBarcodeID)
database
updateIssueStatus(bookBarcodeID)
Invalid loginId/password
User is not Invalid loginId/password
allowed to
login into Invalid loginId/password
the system
Object1 : Class1
1: getData()
Object2 : Class2
1: getData( )
2: sendValue(a)
Object2 : Class2
1: getBookBarcodeID( )
3: getMemberBarcodeID( )
6: <<destroy>>
9: validate(memberBarcodeID)
11: incrementBook(memberBarcodeID)
8: issueBook(bookBarcodeID, memberBarcodeID)
: BarcodeReader
12: updateIssueStatus(bookBarcodeID)
4: Login(loginID, password)
5: validate(loginID, password)
: LoginController : Login
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Refinement of Use Case
Description
Basic Flow
1 Student/faculty/employee membership number is read through barcode
reader.
2 The system displays information about the student/faculty/employee.
5 The system validated the membership and number of books issued in the
account.
6 The system checks whether the member fine exceeds the maximum
limit of fine.
7 The book is issued for the specified number of days and the return date of
database.
9 If the book is reserved by the same member then it is marked as
unreserved.
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Refinement of Use Case
Description
In issue book use case, three alternative flows are added during the in depth
study of exceptional cases.
The “Book is already reserved” alternative flow was not considered earlier
which is quite possible in practice. If a student may ask for a “reserved book”,
permission for the same should be denied by the LMS.
Alternative flow “fine exceeds the specified limit” is added in which a student
may want to get a book issued while his/her fine limit has been exceeded.
Other Alternative flow “Unable to read entry” is also added in order to
represent the exceptional case when the barcode of the book or member could
not be read by the system.
The design phase updates the use cases and may modify other related diagrams.
We may also find need of new use cases to simplify complex steps and increase
the reusability.
Thus, continuous refinement is a key to development of software through
iterative process.
The understanding of the system continuously increases and this brings changes
in the various models and documents that are produced and finally results in the
development of the source code.
Use case descriptions are the medium through which our continuous increase in
knowledge of the system is reflected.
Destroy
BarcodeReader
object
issueBook(bookBarcodeID, memberBarcodeID)
issueBook(bookBarcodeID, memberBarcodeID)
Notify the
controller issue reserveStatus(bookBarcodeID, memberBarcodeID)
book request
updateIssueStatus(bookBarcodeID)
Class name
Class type
Description
Attributes Attribute 1
Attribute 2
………….
Attribute n
Operations Operation 1
Operation 2
…………..
Operation n
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Development of Detailed Design
Class name Transaction
Class type Entity
Description This class is used to store the details of each transaction i.e issue and
return
Attributes Long bookBarcodeID
Long memberBarcodeID
Date dateOfIssue
Date expectedDOR
Date actualDOR
Operations void issueBook(bookBarcodeID : Long, memberBarcodeID : Long)
member retrieveMember(bookBarcodeID : Long)
boolean checkFine(bookBarcodeID)
void returnBook(bookBarcodeID : Long)
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Development of Detailed Design
Class name Book
Class type Entity
Description This class is used to store the details of each book in the library
Attributes Long bookBarcodeID
String subjectDescriptor
String ISBN
String bookTitle
String language
String authorName
String publisher
Boolean issueStatus
Operations void updateIssueStatus(bookBarcodeID : Long)
void saveDetails( )
Object Oriented Software Engineering by Yogesh Singh & Ruchika
string deleteBook(bookBarcodeID Malhotra
: Long)
Generating Test Cases from Use
Cases
Test cases are integral part of any testing activity. The creation of
test cases and executing them when the source code is available
ensures that a robust, defect free and high quality system is
constructed. A tester may ask the following questions:
What is the exact functionality of the system?
What are the exceptional or error conditions that may occur in the system?
How to decide when the system has been tested completely?
consists of generates
Test cases
requires
produces
Test results
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Generating Test Cases from Use
Cases
Deriving Test Cases from Use Cases: A Five Step Process
A systematic approach may follow the following steps in order
to derive test cases from use cases:
Creation of use case scenario matrix
Identification of variables in a use case
Identification of different input states of variables
Design of test case matrix
Assigning actual values to input variables
Alternative
Flow 2
Alternative
Flow 1
Alternative Flow 3 Alternative Flow 3
(a) (b)
Alternative Flow 1: Invalid login Id/password
Alternative Flow 2: Invalid Entry
Alternative Flow 3: User exits
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Use Case Testing