Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Analysis, Design and Implementation

10 November 2014

Marking Scheme
This marking scheme has been prepared as a guide only to markers. This is not a set of
model answers, or the exclusive answers to the questions, and there will frequently be
alternative responses which will provide a valid answer. Markers are advised that, unless a
question specifies that an answer be provided in a particular form, then an answer that is
correct (factually or in practical terms) must be given the available marks.

If there is doubt as to the correctness of an answer, the relevant NCC Education materials
should be the first authority.

Throughout the marking, please credit any valid alternative point.

Where markers award half marks in any part of a question, they should ensure that
the total mark recorded for the question is rounded up to a whole mark.
Answer ALL questions

Marks
Question 1

Outline the FIVE (5) stages of the Object Oriented Analysis and Design (OOAD) 10
process and identify the main documentation used at each stage in the process.

The maximum number of marks for this question is 10. Award up to 2 marks for
each bullet point.

 Identify the needs of users (1 mark). Documented via use case diagrams
(1 mark).
 Identify the steps needed for each of the requirements (1 mark).
Documented via activity diagrams (1 mark).
 Decompose the requirements for the system (1 mark). Documented via
class diagrams (1 mark)
 Define the interactions between components (1 mark). Documented via
sequence diagrams (1 mark) and component diagrams (1 mark|)
 Iterate over the process (1 mark).

Total: 10 Marks

Question 2

Write the program code for the following Class Diagram. This should include variable 10
declarations and method stubs. The code should include the appropriate data types
and access types for the variables, and the appropriate access types, parameter list
and return types for the methods.

Question 2 continues on next page

Page 2 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
public class Pet {
private String name;
private int age;
private double weight;
private String species;

public Pet(String n, int a, double w, String s) {


name = n;
age = a;
weight = w;
species = s;
}

public String getName () {


return name;
}

public void setName (String n) {


name = n;
}

public int getAge() {


return age;
}

public void setAge (int a) {


age = a;
}

public double getWeight() {


return weight;
}

public void setWeight (double w) {


weight = w;
}

public String getSpecies() {


return species;
}

public void setSpecies (double s) {


species = s;
}
}

The maximum number of marks awarded for this question is 10.

Award 1 mark for correct data types for all variables. 1 mark for correct access
types for all variables. 1 mark for correct parameter list for constructor method. 1
mark for no return type for constructor method, 1 mark for constructor method
having the same name as the class. 1 mark for initialising variables using
parameters passed into constructor method. 1 mark for correct access types for all
accessor and mutator methods. 1 mark for correct return types for all accessor and
mutator methods. 1 mark for correct parameter list (empty) for accessor methods. 1
mark for correct parameter list (one variable of the same data type as that of the
variable being altered) for mutator methods.

Total: 10 Marks
Page 3 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 3

Identifying classes, and which attributes and operations should belong to which 10
classes, can be carried out using Natural Language Analysis (NLA). From the
following scenario, use NLA to create an initial class diagram:

We are a large vehicle retailer and we need a system that allows us to manage our
inventory. We sell a range of cars, vans and motorcycles. For all types of vehicle, we
need to store details of the Vehicle Identification Number (VIN), manufacturer, model,
engine size, mileage and price. For cars, we also need to store details of the number
of doors (3 or 5 door) and style (hatchback, estate, or sedan). For vans, we need to
store the cubic capacity and height in centimetres. For motorcycles we need to store
the type (off road, on road, or hybrid) and number of wheels (2 or 3). For mini-vans,
we need to store the number of passengers it can carry (between 7 and 15).

The maximum number of marks awarded for this question is 10.

Award 1 mark for identifying correct classes, 1 mark for inheritance


relationship between Vehicle and Car, 1 mark for inheritance relationship
between Vehicle and Van, 1 mark for inheritance relationship between Vehicle
and Motorcycle, 1 mark for inheritance relationship between Vehicle and
MiniVan, 1 mark for each class for suitable attributes and methods.

Note: The above is one possible solution: some data types and exact names of
attributes and methods may vary. The inheritance between Vehicles and Cars
and MiniVans may also be modelled differently (e.g. with a common parent as
they share an attribute numDoors). Marks can be assigned more flexibly than
suggested above as long as the placement of attributes and methods is
appropriate to the different relationship structure.

Total: 10 Marks
Page 4 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 4

Produce a use case diagram for the following scenario: 10

Anderson Gibbs and Co is a letting agency which specialises in letting luxury flats in
the North East of Scotland to corporate clients on a short term basis. Landlords
supply details to the agency about the properties they have available. Corporate
clients supply details about the type of properties they are seeking and what they are
willing to pay. Letting Agents can receive these details from landlords and clients,
schedule viewings for properties, and update the status of properties (e.g. from let/
occupied to vacant/ available). Letting agents also schedule quarterly inspections, in
which clients must attend. Corporate clients can view properties and pay rent.
Landlords can receive rent payments.

The maximum number of marks awarded is 10.

Award 1 mark for each correct use case (up to a maximum of 6 marks), 1 mark
for each correct actor (up to a maximum of 3 marks), and 1 mark for getting the
right relationships between actors and use cases.

Note: Other names for use cases are acceptable, the diagram shown is an
example solution rather than the only possible solution.

Total: 10 Marks

Page 5 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 5

a) One of the benefits of Object Oriented Design is the ability to use polymorphism. 2
Define the term ‘polymorphism’.

Polymorphism is the ability of OO classes to behave as instances of a more


general case (1 mark) rather than the more specific case (1 mark).

b) Describe the creational design pattern and briefly explain why creational design 4
patterns are useful in situations involving polymorphism.

Creational design patterns are used to handle the creation of objects: they
abstract the mechanism of this away from the developer (1 mark) meaning
that the developer never has to instantiate an object directly (1 mark).
Often, a developer will not know exactly what type of object they want – for
example in a drawing application where the user can select from a variety
of possible shapes so you don’t know which shape subclass to create (1
mark – also award this mark for any other suitable example or explanation).
Use of polymorphism by the pattern enables the creation of whichever
subclass is required, at runtime (1 mark).

c) The strategy design pattern is one of the structural design patterns. Describe how 4
this pattern works and state ONE (1) advantage and ONE (1) disadvantage of
using this pattern.

The strategy pattern works by decoupling compile and runtime


implementation (1 mark) by injecting simple implementations of
functionality into objects that can then have set functions invoked (1 mark).
The strategy patter allows the developer to resolve several systemic
problems in single inheritance languages (1 mark). However, this is at the
cost of (often considerable) obfuscation of code (1 mark).

Total: 10 Marks

Page 6 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 6

a) Briefly explain what is meant by the term coupling and explain why it can cause 2
problems.

Coupling is the degree to which classes are interconnected (1 mark). This


makes it hard to extract classes from their context, which makes re-use
difficult (1 mark).

b) Coupling is necessary for classes to communicate with each other. However, the 8
choice of coupling has a big impact on the ease of adding functionality, changing
existing functionality, or removing functionality. Given this, identify and briefly
describe FOUR (4) types of coupling. Rank these FOUR (4) types of coupling
from most to least preferable with regards to how easily they allow changes to be
made in a program.

The maximum number of marks awarded is 8. Award up to 2 marks for each


bullet point:

 Content coupling: When a module makes use of the local data of


another (1 mark). This is the worst kind of coupling (1 mark).
 Common coupling: when two modules share the same global data store
(1 mark). This is not as bad as content coupling but is worse than the
other types (1 mark).
 Data coupling: when modules share data via parameters (1 mark). This
is a much better type of coupling than the previous two, but is not the
best method (1mark).
 Callback coupling: Uses the observer design pattern to treat each
subsystem of your program as a black box component (1 mark). This is
the best and loosest form of coupling (1 mark).

Total: 10 Marks

Page 7 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 7

a) Software quality can be assessed using various metrics. One method of 4


assessing software quality is by using system measures. Identify, and briefly
outline, FOUR (4) types of system measure.

Award 1 mark for each bullet point up to a maximum of 4 marks.

 Functionality: does the system do what it is supposed to do?


 Performance: How efficiently does it accomplish its goals?
 Security: How well protected are the sensitive parts of the system?
 Reliability: How much can you rely on the software being available when
you need it?
 Usability: How easily can the system be manipulated by users?
 Interoperability: How well can the system work with other systems that it
needs to communicate with?
 Correctness: How correct is the functionality? Does it give answers that
are suitably precise?

b) System measures can be assessed using test driven development. Describe this 6
process.

Test driven development works by writing the tests before you write the
code (1 mark) and automating the running of those tests (1 mark).
Whenever you make a change to a piece of code, you run all the automated
tests (1 mark). This ensures the new functionality you are developing does
not break the existing functionality (1 mark). If the new functionality does
cause problems then you refactor to resolve issues (1 mark) and repeat the
process (1 mark).

Total: 10 Marks

Page 8 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 8

a) Consider the code below, and rewrite the code to demonstrate TWO (2) ways in 4
which it could be refactored to improve encapsulation and readability.

public double myValue;

public int getAccountBalance() {


return myValue;
}

public void setAccountBalance (double v) {


myValue = v;
}

Several possibilities exist for potential refactorings, but two suitable


examples would be changing 'myValue' to have a meaningful variable name
such as 'balance', which is suggested by context (2 marks), and changing
the visibility of the variable from public to private (2 marks). Any other
suitable refactoring should also receive credit.

b) Perfective maintenance often involves refactoring. Define the term refactoring 6


and state FOUR (4) rules for refactoring.

Definition:
Refactoring is the process of fixing code in place without impacting on the
rest of the program (1 mark) – mostly to fix problems before they occur or
to improve readability or maintainability (1 mark).

Refactoring rules:
 When refactoring, methods and variables may be made more visible, but
they cannot be made less visible (1 mark).
 The functionality of public methods cannot change (1 mark).
 The return type of a method cannot change (1 mark).
 The name of a method or public/ protected variable cannot change (1
mark).

Total: 10 Marks

Page 9 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 9

a) Explain the role of static modelling and contrast this with the role of dynamic 8
modelling. Explain why both types of modelling are required when designing an
object oriented system.

The static model is used to represent the structure of a software system:


the architecture of the system and how the subsystems fit together (1
mark). The static model is time-independent (1 mark). The static model is
important for getting good class design with high cohesion (1 mark).
Dynamic modelling represents the state of the system as it changes over
time (1 mark) or as it reacts to user input (1 mark). Dynamic modelling
makes it easier to see the amount of information passing and
dependencies between different parts of the system (1 mark) which is hard
to identify from the static model and so complements it (1 mark). Dynamic
modelling can help to identify and reduce the amount of coupling in the
system (1 mark).

b) Object Oriented Analysis and Design (OOAD) allows for iteration. Explain what 2
is meant by iteration and provide ONE (1) reason why iteration is important.

Definition:
Iteration is the process of going back to previous stages of the design
process and adding to or modifying the design (1 mark).

Award 1 mark for each bullet point listed below, up to a maximum of 1


mark.

Why iteration is important:


 It is rare to impossible to get the design 100% correct first time.
 New requirements and new information will be introduced during the
project
 Iteration keeps the process more flexible and therefore more likely to
meet the business needs of the clients.

Total: 10 Marks

Page 10 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 10

a) SSADM is often described as a data oriented approach to systems modelling. 5


Describe what data orientated means and identify THREE (3) disadvantages of
this approach in relation to the documentation produced.

Award 1 mark for each bullet point listed below, up to a maximum of 2


marks.

Description:
 Data oriented means that it focuses on the flow of data through a
system
 Most of the diagrams emphasise the way in which data is stored,
manipulated, and passed through the system.

Award 1 mark for each bullet point listed below, up to a maximum of 3


marks.

Disadvantages:
 As systems became larger and more complex, so did the accompanying
diagrams.
 Data Flow Diagrams had to be broken down into several sub layers,
making it hard to understand parts of a complex program while also
understanding how the entire program fitted together.
 The focus on data led to unwieldy data dictionaries which recorded all
data used in the system and where it was used: these often ran to
hundreds of pages in length.

b) State THREE (3) advantages and TWO (2) potential disadvantages of using 5
Object Oriented Analysis and Design techniques.

Award 1 mark for each bullet point listed below, up to a maximum of 3


marks.

Advantages:
 OOAD permits for easier decomposition of systems.
 OOAD allows for the analysis and design of these systems in relative
isolation.
 OO systems tend to be more maintainable.
 OO systems also tend to more precisely map the logic of underlying
systems.

Award 1 mark for each bullet point listed below, up to a maximum of 3


marks.

Disadvantages:
 OOAD is large and unwieldy for large projects.
 OOAD suffers disproportionately when classes are badly designed.
Total: 10 Marks
End of Examination Paper
Page 11 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Learning Outcomes Matrix

Question Learning Outcomes Marker can differentiate between varying levels


Assessed of achievement
1 1.1, 1.2, 1.3 Y
2 2.2, 6.2 Y
3 1.3 5.2 Y
4 1.2, 5.1 Y
5 1.3, 3.1 Y
6 3.1 Y
7 1.3, 3.1, 3.2 Y
8 7.1, 4.1, 4.2 Y
9 1.1, 1.2, 1.3, 2.1 Y
10 1.2, 1.3 Y

Grade descriptors for Analysis, Design and Implementation


Learning Outcome Pass Merit Distinction
Understand the Demonstrate Demonstrate Demonstrate highly
seamless transition adequate level of robust level of comprehensive level
from OO Analysis to understanding understanding of understanding
OO Design.
Understand how to Demonstrate ability Demonstrate ability Demonstrate ability to
convert OO analysis to perform the task to perform the task perform the task to
and design models to consistently well the highest standard
code
Understand the Demonstrate Demonstrate Demonstrate highly
quality attributes adequate robust comprehensive
associated with an understanding of understanding of understanding of
OO development quality attributes quality attributes quality attributes
Understand the Demonstrate Demonstrate Demonstrate highly
concept of adequate level of robust level of comprehensive level
maintenance within understanding understanding of understanding
an OO development
environment
Be able to produce Demonstrate ability Demonstrate ability Demonstrate ability to
OO analysis and to perform the task to perform the task perform the task to
design models using consistently well the highest standard
a case tool
Be able to convert Demonstrate ability Demonstrate ability Demonstrate ability to
OO analysis and to perform the task to perform the task perform the task to
design models to consistently well the highest standard
code using an
appropriate IDE
Be able to refactor an Demonstrate ability Demonstrate ability Demonstrate ability to
OO programme to to perform the task to perform the task perform the task to
improve quality consistently well the highest standard

Page 12 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014

You might also like