Module Examination 2016 Software Engineering: Friday, 3 June 2016 2:30 PM - 5:30 PM Time Allowed: 3 Hours
Module Examination 2016 Software Engineering: Friday, 3 June 2016 2:30 PM - 5:30 PM Time Allowed: 3 Hours
Module Examination 2016 Software Engineering: Friday, 3 June 2016 2:30 PM - 5:30 PM Time Allowed: 3 Hours
TM3541606F1
TM354/H
SOFTWARE ENGINEERING
Question 1 (a) What is the main motivation for, and benefit from, agile software
development?
(3 marks)
(b) What is the purpose of modelling in agile development?
(2 marks)
Question 3 (a) Consider the following extract from a business description of a youth choir.
A youth choir takes children as members from 5 to 18 years old. The choir is
organized in different sections per age. The choir accepts both boys and girls
up to the age of 10. From the age of 11 onwards all members of the choir are
girls and they need to audition to continue as, or become members. The choir
organizes two events per year for all its sections and a tour for a chamber
section for girls from the age of 15.
From the description identify one business process and two business rules
in this domain.
(3 marks)
(b) Suggest an advantage and a disadvantage of expressing business rules
using a formal language like OCL.
(2 marks)
Figure 1
(a) (i) What fact is expressed by the {subset} constraint?
(ii) Suggest an alternative that could be used instead of the special
{subset} notation.
(2 marks)
(b) Consider the association loop with classes Ground, Club, Team and Fixture.
Write in OCL the following invariant that applies to this association loop: The
ground where a fixture is played is the ground of one of the clubs whose
teams are playing in that fixture.
(3 marks)
Question 5 Imagine we want to implement a use case assign player, where the goal of the
use case is to assign a player to a team (see Figure 1).
The use case assign player will have the following pre- and postconditions:
Preconditions:
The instance of the class Member and the instance of the class Team are
linked to the same instance of the class Club.
Fewer than 11 instances of Member are currently linked to the instance of
the class Team in the role of player.
Postcondition:
The instance of the class Member and the instance of the class Team will
have been linked with the instance of the class Member in the role of player
This use case requires the following operations (Table 1).
Class Operation
Member addTeam(t : Team)
Team addPlayer(m : Member)
(a) Draw a pair of object diagrams, before and after, to illustrate the effect of the
use case.
(2 marks)
(b) Assuming the associations between Member and Team are bidirectional,
there will be a consistency requirement. To illustrate, if player1 is linked to
team1, then team1 must be linked to player1.
What do the GRASP patterns suggest for handling this requirement? What
impact would this suggestion have in terms of the operations in Table 1?
(3 marks)
Question 6 An online agency arranges lettings for holiday cottages. This question is
concerned with the lifecycle of a reservation, which represents the fact that a
customer has booked a particular property between given dates.
When a customer submits a booking request a provisional reservation is created
and a confirmation invoice sent within two working days. If the customer decides
to accept and the start date of the rental is more than 10 weeks away they must
then pay a deposit of 25% of the rental cost; otherwise they must pay the full
rental.
If the customer decides not to accept, the reservation is cancelled.
Where the full cost was not due at the time of booking, the balance must be paid
not later than 10 weeks before the start date of the rental. Failure to pay by the
due date results in the reservation being cancelled with no refund of the deposit.
If a customer cancels a fully paid reservation they receive a refund of 50%
providing the cancellation is made more than 5 weeks before the start date of the
rental. Otherwise no refund is made.
When the start date of the rental is reached a fully paid reservation which has not
been cancelled will then be recorded as fulfilled.
Consider the following states for an instance of Reservation: provisional,
reserved, fully paid, and two final states cancelled and fulfilled. Draw a statechart
diagram showing the lifecycle of an instance of Reservation.
(5 marks)
Question 7 (a) Suggest one reason why reuse is desirable in software development.
(2 marks)
(b) Briefly outline the purpose of the Adapter pattern, explaining when you
would use it.
(3 marks)
Question 9 (a) Compare the code excerpts in Table 2 below using the lines-of-code (LOC)
and cyclomatic-complexity metrics. What can be said about the relative
complexity of the two pieces of code?
Table 2
Code A Code B
int[] w = new int[3]; int[] w = new int[3];
w[0] = u[0] + v[0]; for (int i = 0; i < 3;
i++)
w[1] = u[1] + v[1];
w[i] = u[i] + v[i];
w[2] = u[2] + v[2];
return w;
return w;
(3 marks)
(b) A precondition of both the code excerpts in Table 2 is that arrays u and v
must both have at least three elements. Write an executable assertion to
express this precondition.
(2 marks)
Question 10 Consider two agile practices and discuss how/whether they can be adapted by
teams that are not co-located.
(5 marks)
Question 11 This question concerns the development of a small software system. Figure 2
below outlines the problem domain. This description is not complete but it
contains all the information needed to answer the questions that follow.
Proposed system
Currently students cannot enrol or cancel online and are only able to view the
courses brochure in printed form. NUCED wants to introduce a new Enrolment
System which will allow web browsing of the course catalogue, as well as online
enrolments and cancellations. Students need to register once for online access
and then login every time they want to cancel or enrol online. When the new
system is introduced, students who prefer will still be able to enrol by completing
a form or by telephone, as at present, with the administrator now using the new
system to process their application. The administrator will also use the new
system to process cancellations.
Department
*
Course
* * Location
Figure 4
(i) From the problem description for the NUCED Enrolment System decide
what the missing attributes of Course should be and list them together
with their corresponding data types. In some cases you may need to
use a placeholder (i.e. a made-up name used temporarily) for the type.
(2 marks)
(ii) Consider two further classes Student and Enrolment, which model a
registered student and a course enrolment respectively.
1. List suitable attributes, including their types, for each of the classes
Student and Enrolment
2. (1 mark)
1.1. Suppose classes Enrolment and Student are to be added to Figure
4. Explain any relevant association(s) you would need to create
(and their multiplicities) and justify your choice.
(3 marks)
1.1.1. Consider the association between classes Course and Location.
How would you represent the fact that a course has a different
code for each location where it is presented?
(2 marks)
Figure 5
Table 4
Identifier and
UC7 make appointment
name
Initiator Receptionist
an appointment is made for a given patient, with a given dentist, at a
Goal
given date and time
the given patient and dentist exist, and the dentist is available at the
Precondition
given date and time
The appointment will have been created and linked to the patient and
Postcondition
the dentist
Table 5
5. Response supporting
learning
6. Measure task time
(3 marks)