Solution Exercise 4

King Saud University
College of Computer & Information Sciences
Computer Science Department
Final Exam: Fall 2009-2010
Sunday February 07, 2010
Module Title: Software Engineering
Module Code: CSC 342
Time Allowed: 3 hours
Dr. Salah Hammami
This exam comprises 5 exercises. Make sure you read each question carefully before attempting an answer. Be
sure to clearly indicate your final answer for each question. Also, be sure to state any assumptions that you are
making in your answers.
Exercise 1: (12 points)
For multiple choice questions, circle all that apply.
1.
In software engineering, a software process is:
a.
b.
c.
d.
e.
3.
A set of executable modules that run
concurrently
An activity that is repeatedly executed during
software development
A sequence of steps that converts inputs to one
or more outputs
An organized set of activities performed for
developing a software system
All of the above
Which are reasons for adopting an iterative,
incremental software development lifecycle over
a waterfall lifecycle?
a.
b.
c.
5.
Waterfall is not used much in practice anymore
Waterfall does not lower risk as quickly
Waterfall projects are almost always delivered
late
d. Iterative, incremental adopts to changes better
e. Iterative, incremental ensures customer
participation
UML sequence diagrams and collaboration
diagrams contain which of the following UML
modeling elements?
a.
b.
c.
d.
e.
f.
2.
Classes
Objects
Associations
Methods
Attributes
All of the above
Validation testing is intended to show that:
a.
b.
c.
d.
4.
The software is extensible and well
documented
The software meets its requirements
The software contains defects
All of the above
What type of UML diagram is used to describe a
specific scenario of a use case?
a.
b.
c.
d.
e.
Collaboration Diagrams
Class diagrams
Sequence diagrams
Use case diagrams
Statecharts
Exercise 2: (8 points)
An airline reservation system has the following requirements:

Customers shall be able to see which destinations are available.

Customers shall be able to choose a flight from a selection available travelling from their
current location to their destination.

Customers shall be able to see which seats on a chosen flight are available.

Customers shall be able to book chosen seats on a chosen flight if they are available.

The system shall resolve concurrent booking requests from different customers for the
same seats on the same flight by accepting the first booking and rejecting later bookings.

The system shall notify the customer of success or failure and show booking details.
1. Identify 4 use cases by providing the actors, use case names, and brief descriptions.
2. Draw the use case diagram.
Solution:
Exercise 3: (16 points)
Description:
ClubRiyadh Video is a chain of 11 video stores scattered through out a major
metropolitan area. The owner of the chain is considered to have a new movie rental
system for it.
Each store has a stock of movies for rent. The system needs to keep track of each movie’s
title, category... Each video has many copies. In addition to tracking each title, the system
must track each individual copy to note its purchase date and rental status. Each time a
movie is rented, the system will keep track of which copies of which movies are rented,
the rental date and return date. Customers information are also processed by the system.
Therefore the ClubRiyadh Video has two kinds of customers authorized to rent movies:
SelverCustomers and GoldCustomers.
Tasks:
Based on the short description of the case, develop a domain model showing major
domain concepts, their attributes and associations between concepts.
Activities:
a. Use the category-list and noun phrase identification method to find the conceptual
classes
b. Draw those conceptual classes in UML class diagram.
c. Add possible attributes to the classes
d. Add “need to remember” relationships as association in the UML class diagram.
Properly Name each association as well.
Solution
Movie
-title
-catelogue
-type : string = New Release
-rating
-has
Store
*
1
-contains
ClubRiyadhVideo
11
1
1
1
-manages
-has
*
RentalRecord
-rent by
-rentalDate
-returnDate
*
*
MovieCopies
Customer
1
1
-record rent of
-rentalStatus
-PurchaseTime
1
SelverCustomers
GoldCustomers
Exercise 4: (6 points)
Convert the diagram below to an equivalent collaboration diagram.
Solution
Exercise 5: (8 points)
A motor control that is commonly used in household appliances has a safety shut-off system. The
motor control has a single attribute “switch” that determines whether the motor is operating. The
control will reset the switch to off if the motor is overheating, but it never set an off switch to on
by itself. A sensor in the control detects whether the motor is too hot. A class diagram is shown
below.
MotorControl
+ switch: boolean
The motor control is governed by the following rules:

In the off state the switch is off, the power is off and only a user can turn the switch on.

When the switch is turned on, the motor control goes to a starting state.

From the starting state, if the motor is not too hot the control enters the running state and
power is applied to the motor.

If the motor is too hot at any time other than the off state, the control enters the “too hot”
state.

Once in the too hot state, the control removes all power from the motor and resets the
switch to off, thus entering the off state.

A user can set the switch to off at any time and cause the motor control to remove power
and enter the off state.
Draw a statechart diagram showing these states and transitions. Include actions, events, entry &
exit conditions.
Solution