You are on page 1of 15

Software Development Techniques

7 August 2015

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.

Marker's comments:

Moderator's comments:

Mark: Moderated mark: Final mark:

Penalties applied for academic malpractice:


Answer ALL questions

Marks
Question 1

a) Explain what is meant by the term compilation and explain its relationship to low 4
and high level languages.
Compilation is the process of turning human readable (1 mark) high level
languages (1 mark) into machine comprehensible (1 mark) low level
languages (1 mark).

b) Briefly explain what is meant by pseudocode and provide TWO (2) advantages 6
and TWO (2) disadvantages of its use.
Pseudocode is an implementation independent (1 mark) representation of
structured programming processes (1 mark).

Award 1 mark for each advantage and disadvantage, which might include:

Advantages:

 It can be applied to all programming languages.


 It is easier to modify than code on a computer.

Disadvantages:

 It must be ‘ported’ to individual systems.


 It must be desk-checked, which can be cumbersome.

Total: 10 Marks

Page 2 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 2

a) The function below implements a form of system login which requires both a 10
username and password before it allows for the next pieces of the code to be
executed. Using an appropriate technique, such as test cases or a desk check,
identify the flaw in the code and outline how it could be fixed. You should
describe the techniques you used to identify the error.

1. function checkLogin (needs u as string, needs p as password) returns


boolean
2. data username as string
3. data password as string
4.
5. username = "examination"
6. password = "password"
7.
8. if username does not equal u and password does not equal p then
9. return false
10. else
11. return true;
12. end if
13. end function

The maximum number of marks awarded for this question is 10. Award up
to 2 marks for:

 Choosing, and describing, an appropriate technique.


 Following the technique correctly
 Demonstrating how they found the flaw using the technique.
 Correctly identifying and describing the flaw
 Providing a solution to the flaw.

The flaw is in line 8, which returns false only if both the username and
password are incorrect – it will return true if one or the other or both are
correct. Students should identify the solution is to change the ‘and’ to an
‘or’.

Note: It is not possible to give samples for all the techniques students may
use, as these are wide-ranging and varied. However, appropriate
techniques would include desk-checks on data, running white box test
cases on the function, or black box testing.

Note 2: 1 mark can be awarded for partially correct applications of the


technique and solutions.

Total: 10 Marks

Page 3 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 3

a) Define the terms primitive and complex with relation to data types and provide 4
ONE (1) example of each term.
Primitive data types are the building blocks that are used to build all other
data types (1 mark). An example of a primitive data type is the real number
data type (1 mark)

Complex data types are those made up of combinations of primitive data


types (1 mark). An example of a complex data type is the string data type
which is a collection of characters (1 mark)

Note: Credit alternative valid examples.

b) For each of the following, suggest an appropriate data type and justify your
decision:

i) Student matriculation number in the form 01242221 2

Award 1 mark for a suitable data type and 1 mark for the justification

Student matriculation number should be a string, because it could


include leading zeros.
ii) Date of birth in the format DD/MM/YYYY 2

Award 1 mark for a suitable data type and 1 mark for the justification

Date of birth should be a string, because it has a format that includes


slashes.
iii) The BMI of a person, in the format 28.2 2

Award 1 mark for a suitable data type and 1 mark for the justification

BMI should be a real number, because it stores decimal information


and we may wish to perform arithmetic on it.

Total: 10 Marks

Page 4 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 4

a) Construct the truth table for the logical comparison ((A AND B) OR (B AND A)). 8
You should also explain why the second conditional may be redundant.

A B (A AND B) (B AND A) Result

T T
T F
F T
F F

The maximum number of marks awarded to this question is 8. Award up to


2 marks for correctly constructing the table as per the headings below.

Award 1 mark for each correct row up to a maximum of 4 marks.

A B (A AND B) (B AND A) Result

T T T T T
T F F F F
F T F F F
F F F F F

Award 2 marks for identifying that (A and B) and (B and A) are redundant
compounds and only one is required.

b) Provide ONE (1) example of a compound conditional operator and provide ONE 2
(1) example of a circumstance in which it might be used.
One mark for OR, AND, or even XOR. 1 mark for a suitable and relevant
circumstance, such as ‘If the age is greater than ten AND the age is less
than ten’

Total: 10 Marks

Page 5 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 5

a) Explain what is meant by the term assigned memory and allocated memory and 4
provide ONE (1) pseudocode example of each term.

Allocated memory is created when we set up a variable (1 mark), and


assigned memory is used when we give a variable a value (1 mark).

Award 1 mark for each pseudocode example, such as:

data name as string // allocated


Name = “Michael” // Assigned

b) Define the terms bounded loop and unbounded loop and provide ONE (1) 6
pseudocode example of each term.
A bounded loop is one where we know at runtime how many times to run
the loop (1 mark), and an unbounded loop is one that will terminate only
when some unknowable condition is met (1 mark).

Award up to 2 marks for each pseudocode example, such as:

Bounded loop:

dim counter as number

loop while counter is less than 10

Unbounded loop:

dim userinput as number

loop while userinput does not equal -1


input userinput

Total: 10 Marks

Page 6 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 6

a) What is the difference between unit testing and integration testing? 4


With unit testing we take each function in turn (1 mark) and run it against
our test cases (1 mark). With integration testing, we test the
communication between units (1 mark) making the complementary
techniques (1 mark).

b) Explain the difference between black box and white box testing and explain what 6
program deficiencies each method is best suited to identifying.
Black box testing involves testing inputs against expected outcomes (1
mark), whereas white box testing stresses each path through a program (1
mark) to make sure all branches can be reached (1 mark).

Black box testing finds areas where functionality is incorrect (1 mark) by


focusing on unexpected output (1 mark). White box testing is suitable for
finding errors on rare paths through a program (1 mark).

Total: 10 Marks

Page 7 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 7

a) Briefly describe the term invalid input in relation to a computer program and 4
provide ONE (1) example of a scenario in which it may cause problems to a
developer.
Invalid input is when data comes from a user or external source (1 mark) in
a form that we are not expecting in our code (1 mark). For example, we
may ask a user for two numbers, expecting them to be whole numbers but
we are provided them as words (1 mark). This requires us to have
additional handling of user data in our programs (1 mark).

b) Choice of representation for data is the most critical part of software 6


development’. Discuss this statement and say whether you think it is valid or
misleading.
One of the first things that must be done when developing a program is to
choose what format our data will take (1 mark), and this statement is
arguing that this is the single most important decision we will take (1 mark).

Award 4 marks for a suitable discussion, of which the following is an


exemplar.

The statement is correct because it is the point from which all future
decisions flow (1 mark). Bad choice of data representation will lead to
more complex code (1 mark) and considerable converting and processing
of data to suit the needs of the algorithms (1 mark), adding a processing
overhead (1 mark).

Note: candidates should get the marks provided they put together a cogent
statement of validity, whether for or against.

Total: 10 Marks

Page 8 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 8

a) Explain what is meant by an object in software development and explain why a 4


developer may wish to use one when developing software products.

An object is a collection of heterogeneous data (1 mark) held in a single


structure (1 mark). A developer may wish to use one when trying to hold
together contextually related (1 mark) data in an easily transferred structure
(1 mark).

b) Write the pseudocode for a program that does the following: 6

 Declares a ten element array of whole numbers


 Goes over every element and places the square of the index at that location
 Outputs each to the user

data myArray as array (10) of whole numbers


data counter as whole number
data calc as whole number
counter = 0
repeat while counter is less than 10
calc = calc * calc
myArray[counter] = calc
counter = counter + 1
output myArray[counter]
next loop

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

 Stating correct data type and size of array,


 Calculating square
 Correct loop structure
 Storing user input in correct elements
 Incrementing counter inside the loop after the user input has been
stored
 Correct output

Total: 10 Marks

Page 9 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 9

a) Define the term recursion and briefly describe the differences between recursion 6
and traditional forms of iteration. You should provide ONE (1) example of a
scenario in which it could not make sense to use recursion.
Recursion is a form of iteration that works by calling the function in which
the calling code is contained (1 mark), thus creating a function which calls
itself (1 mark) until some logical termination point is reached (1 mark).

This offers a somewhat cleaner form of some kinds of repetition than


standard iteration (1 mark). It would not make sense to use this technique
in situations where many loops would be required (1 mark) as it is a costly
technique (1 mark).

b) Outline the difference between a stack and a queue. You should support your 4
answer with a brief definition of each term.
A stack is a data structure in which we operate in a LIFO manner (1 mark),
where data comes off in the reverse order in which it was added (1 mark).
A queue is a data structure which operates in a FIFO manner (1 mark) in
which data comes off in the order it was added (1 mark).

Total: 10 Marks

Page 10 of 15
Software Development Techniques © NCC Education Limited 2015
Marks
Question 10

a) Give a pseudocode outline of a class called Sofa. Its attributes are length, width, 6
height and colour. The length, width and height are stored in millimetres. The
colour is stored as a string.

Mark scheme for question 10 (a) is on next page

Page 11 of 15
Software Development Techniques © NCC Education Limited 2015
The maximum number of marks awarded to this question is 6. Award ½ marks for
each attribute up to a maximum of 2 marks. Award ½ marks for each setter up to a
maximum of 2 marks. Award ½ marks for each getter up to a maximum of 2 marks.

Class Sofa

data length as whole number

data width as whole number

data height as whole number

data colour as string

Function setLength (needs l as whole number)

length = l

End Function

Function queryLength() returns whole number

return length

End Function

Function setWidth (needs w as whole number)

width = w

End Function

Function queryWidth() returns whole number

return width

End Function

Function setHeight (needs h as whole number)

height = h

End Function

Function queryHeight () returns whole number

return height

End Function

Function setColour (needs c as string)

colour = c

End Function
Page 12 of 15
Software Development Techniques © NCC Education Limited 2015
b) Using the class above, add a constructor method that allows for all four of these 4
values to be set when the object is instantiated.

Function Sofa (needs l as whole number, w as whole number, h


as whole number, c as string)

length = l

width = w

height = h

colour = c

End Function

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

 Correct method header


 Correct arguments list
 Correct data types
 Initialising variables correctly

Total: 10 Marks

End of Examination Paper

Page 13 of 15
Software Development Techniques © NCC Education Limited 2015
Learning Outcomes matrix

Question Learning Outcomes Marker can differentiate


assessed between varying levels of
achievement
1 3 Yes
2 1, 2, 3 Yes
3 2, 4 Yes
4 3, 4, 5 Yes
5 3, 4, 5, 6 Yes
6 2, 3, 4, 7 Yes
7 5, 6 Yes
8 1, 2 Yes
9 3, 4 Yes
10 2, 5 Yes

Page 14 of 15
Software Development Techniques © NCC Education Limited 2015
Grade descriptors

Learning Pass Merit Distinction


Outcome
Identify and Provide adequate Provide detailed and Provide comprehensive,
explain the key ability to explain the coherent explanation lucid explanation of the
stages of subject matter of the subject matter subject matter
software
development
lifecycles
Express, design Demonstrate ability Demonstrate ability Demonstrate ability to
and evaluate to perform the task to perform the task perform the task to the
algorithms consistently well highest standard
Identify and use Demonstrate ability Demonstrate ability Demonstrate ability to
programming to perform the task to perform the task perform the task to the
language consistently well highest standard
constructs
Identify and use Demonstrate ability Demonstrate ability Demonstrate ability to
common data to perform the task to perform the task perform the task to the
structures consistently well highest standard
Explain and use Demonstrate Demonstrate Demonstrate
common adequate ability to detailed and comprehensive, lucid
algorithms explain the subject coherent explanation explanation of the
matter; of the subject matter; subject matter;
Demonstrate Demonstrate Demonstrate highly
adequate and appropriate and appropriate and
appropriate use effective use effective use
Explain and use Demonstrate Demonstrate Demonstrate
test strategies adequate ability to detailed and comprehensive, lucid
explain the subject coherent explanation explanation of the
matter; of the subject matter; subject matter;
Demonstrate Demonstrate Demonstrate highly
adequate and appropriate and appropriate and
appropriate use effective use effective use
Explain how Provide adequate Provide detailed and Provide comprehensive,
software is ability to explain the coherent explanation lucid explanation of the
modularised subject matter of the subject matter subject matter

Page 15 of 15
Software Development Techniques © NCC Education Limited 2015

You might also like