You are on page 1of 10

UNIVERSITY OF MAURITIUS

FACULTY OF ENGINEERING

PAPER NO EXAMINATION DATE

Second Semester 2005/2006

BScCSE/05S/9 BSc (Hons) Computer Science Friday


and Engineering 19 May 2006
Level 2

BScIS/05S/8 BSc (Hons) Information Systems


Level 2

SERIES PAPER TIME

May 2006 Software Engineering 9:30 – 12:30 Hours


[CSE 2001Y(5)]

This paper contains SIX (6) Questions, THREE (3) Questions in SECTION A
and THREE (3) Questions in SECTION B. Candidates are required to answer
ANY FIVE (5) Questions.

USE SEPARATE ANSWER BOOKS FOR EACH SECTION.

CANDIDATES ARE REQUIRED TO WRITE THE NAME OF THEIR TUTOR ON


THE COVER OF THEIR ANSWER BOOKS.
SECTION A
Use separate Answer Books for each Section.

Question 1 (20 marks)

(a) Consider the following code:


class A {
int i;
private int j;
int total;
void setij(int x, int y) {
i = x;
j = y;
}
void sum(){
total = i + j;
}
}
class B extends A {
int k;
void setk(int z) {
k = z;
}
void sum() {
total = i + j + k;
}
}
class Access {
public static void main(String args[]) {
A superOb = new A();
superOb.setij(6, 8);
superOb.sum();
System.out.println("Total is " + superOb.total);
B subOb = new B();
subOb.setij(10, 12);
subOb.setk(14);
subOb.sum();
System.out.println("Total is " + subOb.total);
}
}
(continued next page)

Page 1 of 9
Question 1(a) (continued)

(i) What happens when the above code is compiled/executed? Explain your
answer. [2 marks]

(ii) Why is it possible to have two methods with the same name and
performing different tasks in classes A and B? [2 marks]

(iii) What is the relationship between the classes A, B and Access if any?
[2 marks]

(b) The Sleeper interface defines the wakeUp method but does not implement it.
It also defines a useful constant.
public interface Sleeper {
public void wakeUp();
public long ONE_SECOND = 1000; // in milliseconds
}
The GUIClock class implements the Sleeper interface. The GUIClock class is an
applet that displays the current time and uses an AlarmClock object to wake it up
every second so that it can update its display:
class GUIClock extends Applet implements Sleeper {
...
public void wakeUp() {
repaint();
clock.letMeSleepFor(this, ONE_SECOND);
}
}
(i) In the above example, could the abstract class given below have been used
instead of the interface? Explain your answer.
abstract class Sleeper {
public abstract void wakeUp();
}
[2 marks]

(ii) What are the differences between an interface and an abstract class?
[3 marks]

(c) What are packages and how are they used in a Java program? [2 marks]

(d) An object has state, behaviour and identity. Briefly explain, what you understand
by this statement? [3 marks]

(e) State with an appropriate example what is meant by the term abstraction and
discuss the importance of abstraction in making software reuse possible. [4 marks]

Page 2 of 9
Question 2 (20 marks)

The University of Mauritius provides parking facilities for its staff and students. Parking
areas are dispersed in various locations within the institution. Each parking area consists
of several parking slots and each slot is given a distinct number. Any interested person
may apply for a parking facility. He needs to provide his ID (Staff or Student), his
contact details (name and phone number) as well as details of the vehicle(s) (Registration
Number, Model, Type). He also needs to state his order of preference on parking areas.

Parking areas are allocated on a first-come-first-served basis. Only one slot is allocated
for any person. However, staff may register two vehicles (whereas students can register
only one).

Parking areas are protected by block-bars. Users are given electronic cards (with
information such as Card Number and Park Area Code) to access these areas. Labels
(with information such as Registration Number, Park Area Code and Slot Number) are
provided for the vehicles.

The Services department wants to automate the above-described system.

The following requirement is considered most important:

Allocate parking space for a new applicant

For a new applicant, after making necessary checks, system should handle the details of
the applicant and her vehicle(s), and then it should automatically select the most suitable
parking area and then allocate the next free slot in that area. Finally, it should prepare the
required access card and label.

(a) Draw a use-case diagram only for the given requirement ‘Allocate parking space
for a new applicant’. [4 marks]

(b) Choose two use-cases identified in part (a) and draw a sequence diagram for each.
[8 marks]

(c) Draw a class diagram for the parking system described in the above case study. It
should include all the main attributes (properties) and responsibilities of classes,
and all the relationships between classes. [8 marks]

Clearly state any assumptions you make, if any, regarding the above problem.

Page 3 of 9
Question 3 (20 marks)

Youssuf is currently writing a game in Java and he needs to implement a Stack with the
following class definition:

As he is a good programmer, he knows that he can reuse an already written LinkedList


class to implement the Stack. This is a partial list of methods of LinkedList:

LinkedList

Please note that

• LinkedLists contain Objects whereas a Stacks contain Weapons,

• size() returns the number of elements in the LinkedList and

• clear() in both Stack and LinkedList empty the corresponding data structure.

(a) Implement Stack using the LinkedList class. [6 marks]

(b) Give two reasons why it is useful to implement a class using a preexisting class?
[2 marks]

(c) Give one other programming example where this pattern might also occur.
[2 marks]

(continued next page)

Page 4 of 9
Question 3 (continued)

This pattern (i.e. a class implemented in terms of a preexisting class which has a different
public interface) is called the Adapter design pattern.

Julie is another programmer in the same company and she is trying to make sure that
only one instance of Stack can exist at any one time. She wants to modify Stack to ensure
that no other instance can be created (by intercepting requests to create new objects) and,
at the same time, provide a way to access the sole instance.

She has decided to make the constructor of Stack private and to have a static method
called Instance() that returns the same Stack each time it is called. She has also decided to
have a private attribute called uniqueInstance.

(d) Implement Julie's version of Stack (there is no need to show the definitions of
push, pop, etc. again).
[6 marks]

(e) List and explain the motivations for using patterns and frameworks in software
development.
[4 marks]

Page 5 of 9
SECTION B
Use separate Answer Books for each Section.

Question 4 (20 marks)

A Tsunami Warning System (TWS) which will give advance warning of possible tsunami
dangers to coastal areas is to be procured by the Governments of Indian Ocean Rim
countries.

The system will include:

• a set of automated sensors to monitor the rate of change of water levels and send
this information to a central tsunami database;

• links to earthquake-monitoring centers;

• links to the communication systems of emergency services of each country (head


of state, police, coastguard, etc.);

• video cameras installed at selected locations;

• and a control room in each country equipped with multi-media operator consoles
and video monitors.

Controllers in each control room can access database information, display it graphically
and integrate the inputs from the video monitors and seismograph readings into their
display. The current meteorological control rooms, though they have a heterogeneous
variation in equipment have at least a few SUN workstations as operator consoles. The
local meteorological authorities have a number of IT staff who are trained in C, C++ and
in the use of Oracle databases.

Tsunami warnings have to be displayed prominently on the operator screen along


relevant information such as: water-levels at various sites, earthquake readings, live
video sequences of monitored sites. Since it is not feasible to have staff monitoring the
warning system on a permanent basis, on-call staff may be notified by system-generated
phone-calls on their mobile phone in the event that the operators are not at work.

All users will be authenticated by the system and given access only to those features as
allowed by the permissions allocated to them by the system administrator. The system
administrator will create and manage accounts for the users of the system. All
communications between the control rooms will be encrypted using a 128-bit key.

(continued next page)

Page 6 of 9
Question 4 (continued)

(a) Why should a number of stakeholders be consulted during the requirements


engineering process for a computer-based system? List four stakeholders that
might be a source of requirements for the TWS.
[4 marks]

(b) Identify two functional & two non-functional requirements for the Tsunami
Warning System from the case-study given above.
[4 marks]

(c) Why do requirements change during development? Using one of the requirements
that you have proposed in part (b), suggest a change that might occur and explain
why it is plausible.
[3 marks]

(d) After discovering requirements from various stakeholders, these requirements


must be analysed and a number of checks made on them. Explain two types of
checks that should be performed on requirements?
[2 marks]

(e) Rewrite the following (vague) requirements so that they may be objectively
validated.
The system must be operated with minimum training.
The system must be reliable.
[2 marks]

(f) Describe a development life-cycle model that will be more appropriate for the
Tsunami Warning System. Justify your answer by explaining why the chosen life
cycle model is appropriate for the TWS.
[5 marks]

Page 7 of 9
Question 5 (20 marks)

(a) Kenny Soft, a newly established software company in the country has just
managed to employ a number of staff personnel and has promised to offer a more
attractive salary package. Many of them are fresh university graduates and may
require some training. The company is now involved in developing a software
product that will be launched in 14 months time. A somewhat similar product is
already on the market and is selling very well. The project is in the analysis phase
and the customers are requesting to have a prototype to get a feel of the product.
Being a new company, its design standards and quality requirements are not yet
set.
(i) Briefly explain what are project risks, technical risks and business risks.
[3 marks]

(ii) Identify five risks from the above problem statement, and categorise them
under project, business, technical risk. [5 marks]

(iii) State risk mitigation strategies for two of the risks identified in part (ii).
[2 marks]

(b) The tables below show the information domain characteristics for a project and the
complexity value associated with each count respectively.
Domain characteristics Number Weighting
User inputs 53 Simple
User outputs 40 Average
User inquiries 20 Average
DB Tables 15 Average
External interfaces 4 Complex

Parameter Simple Average Complex


User inputs 3 4 5
User outputs 5 6 8
User inquiries 3 6 8
DB Tables 9 11 16
External interfaces 7 9 12
(i) State the strengths of function-oriented metrics over size-oriented metrics.
[2 marks]

(ii) Calculate the function point value for the above project. Assume an average
complexity for all “technical complexity factors”. [4 marks]

(iii) From records of past projects undertaken in the company, the average
productivity and the average cost have been 25 function points per person per
month, and Rs 15 000 per function point respectively. Assuming the development
team of the company consists of 15 developers, estimate the duration and cost of
the above project. [4 marks]
Page 8 of 9
Question 6 (20 marks)

(a) “Cohesion” and “coupling” are two ways of measuring the degree of modularity
in software. Define what is meant by these two terms and indicate what degrees of
each are desirable. [3 marks]

(b) Consider the following flow graph.

(i) Based on the Basis Path Testing technique, calculate the value of Cyclomatic
Complexity of the flow graph given above. [2 marks]

(ii) Based on the value of Cyclomatic Complexity calculated, derive the set of
basis test paths. [4 marks]

(c) The following are the three categories of McCall’s Quality factors: product
operations, product revision, and product transition.

(i) Briefly explain each category. [3 marks]

(ii) Identify, and explain in detail, any two factors associated with each of
these categories.
[3 marks]

(d) Formal technical review is a technique used to enhance software quality. Discuss
the objectives of formal technical reviews and the positive effects of conducting
such reviews. [5 marks]

END OF QUESTION PAPER


/nr

Page 9 of 9

You might also like