Software development and testing – A Level Computer Science (9618)
16 questions · page 1 of 2 · Clear filters
Question text
7
There are several different ways to express an algorithm during the design of a program.
(a) One part of the program contains an algorithm which is represented by a state-transition
diagram.
The table shows the inputs, outputs and states for the algorithm:
Current state
Input
Output
Next state
S1
A2
X2
S3
S1
A1
X1
S2
S2
A4
X4
S5
S3
A1
S3
S3
A3
X3
S2
S3
A2
X4
S4
S4
A1
X1
S4
S4
A3
S2
S4
A4
X4
S5
Complete the state-transition diagram to represent the information given in the table.
A2 | X2
START
S1
[5]
ĬÙĊ®Ġ´íÈõÏĪÅĊÝù·Ā×
,
,
(b) A structure chart is used to document a different part of the program.
This part of the program contains six modules:
Pseudocode module header
PROCEDURE Setup()
PROCEDURE Restart(H1 : STRING, C1 : INTEGER)
FUNCTION Modify(B1 : BOOLEAN) RETURNS INTEGER
PROCEDURE Final(T1 : INTEGER)
PROCEDURE Update(BYREF R2 : STRING)
FUNCTION Confirm() RETURNS BOOLEAN
Module Setup will repeatedly call three of the modules.
Complete the structure chart to document the information given in the table.
Setup
H1
B1
R2
[5]
ĬÛĊ®Ġ´íÈõÏĪÅĊÝû·Ā×
Question text
5
A program is developed to satisfy a specific customer requirement.
The project follows a program development life cycle model. This model divides the development
process into several different stages.
(a) The table lists some of the development activities.
Complete the table by writing the name of the life cycle stage for each activity:
Activity
Name of life cycle stage
a structure chart is produced
a program is modified to allow it to run on new hardware
the programmer identifies the customer’s requirements
an Integrated Development Environment (IDE) provides
context-sensitive help such as ‘auto-complete’
[4]
(b) Alpha and beta testing has been completed. The final testing stage is carried out by the
customer.
Identify this final testing stage.
… [1]
ĬÙĊ®Ġ´íÈõÏĪÅĊßûµĀ×
,
,
ĬÛĊ®Ġ´íÈõÏĪÅĊßùµĀ×
Question text
7
The structure chart shows part of a program design:
Convert
Count
P2
T1
Key
Analyse
Update
Sort
(a) Explain the meaning of the curved arrow symbol in this structure chart.
…
…
…
… [2]
(b) The program designer has noted that:
•
Count is the number of elements in an array
•
T1 is a value representing the number of elements in an array that have been modified
•
Key is of type STRING
Write the pseudocode module headers for analyse, update and sort.
Analyse:
…
…
Update:
…
…
Sort:
…
…
[4]
ĬÙĊ®Ġ´íÈõÏĪÅĊàû·Ā×
Question text
7
There are several different ways to express an algorithm during the design of a program.
(a) One part of the program contains an algorithm which is represented by a state-transition
diagram.
The table shows the inputs, outputs and states for the algorithm:
Current state
Input
Output
Next state
S1
A1
S2
S2
A2
X4
S3
S3
A1
X1
S3
S3
A2
X1
S3
S3
A3
X3
S4
S3
A4
S2
S4
A3
X4
S5
S4
A4
X4
S5
S4
A1
S2
Complete the state-transition diagram to represent the information given in the table:
START
S1
[5]
ĬÍĊ¾Ġ´íÈõÏĪÅĊßüµĄ×
,
,
(b) A structure chart is used to document a different part of the program, made up of five modules.
Program notes:
•
module Setup calls either module Restart, or module Confirm
•
module Confirm takes a string as a parameter and returns an integer
•
module Modify has no parameters and returns a Boolean
•
module Update takes a string as a parameter
•
module Restart repeatedly calls module Update followed by module Modify
•
module Restart takes a string as a parameter that is passed by reference.
Draw a structure chart to represent the relationship between the five modules, including all
parameters and return values.
[4]
ĬÏĊ¾Ġ´íÈõÏĪÅĊßúµĄ×
Question text
5
A software developer follows a program development life cycle. The life cycle divides the
development process into various stages.
(a) The following table lists some development activities.
Complete the table by writing the name of the life cycle stage for each activity.
Activity
Name of life cycle stage
The walkthrough method is used.
An algorithm is implemented in a programming language.
The client is interviewed about problems with the current system.
The program is modified to run on new hardware.
Records and file structures are defined.
[5]
(b) The program contains a validation function.
(i)
The function will:
•
take an integer value as a parameter
•
return TRUE if the value is within the range 24 to 37, inclusive
•
otherwise return FALSE.
Complete the table to define a test plan to thoroughly test the operation of the function.
Type of test data
Test data value
Expected result
Normal
30
TRUE
[4]
(ii)
The function is to be tested on its own. When it is shown to work correctly the function
will be combined with other modules and testing will continue.
Identify the type of testing that this represents.
… [1]
ĬÙĊ®Ġ´íÈõÏĪÅĊÞú¸þ×
Question text
1
A program has been developed and released for general use. After a few months of use an error is
detected where under certain circumstances it outputs an unexpected value.
(a) The error in the program needs to be corrected.
Identify the stage of the program development life cycle that this correction is made in.
… [1]
(b) The program contains a function Lookup(). After investigation, it is found that this is the
function that sometimes returns an incorrect value.
An Integrated Development Environment (IDE) is used to help locate the error.
The IDE features of watch window, single stepping and breakpoint will be used.
Explain these features including the order that they will be used in to locate the error in
Lookup().
…
…
…
…
…
… [3]
(c) To solve the error a programmer decides to create a new module.
The design of the new module has been completed and the module is being coded.
Identify two features of an IDE that will help during the coding of this new module.
1 …
2 …
[2]
(d) The new module referred to in part (c) introduces three new variables.
Complete the following table by giving the appropriate data type for each.
Variable name
Used to store
Data type
Name
A customer name.
Index
An array index.
The result of the division of any two
Result
non-zero numbers.
[3]
ĬÍĊ¾Ġ´íÈõÏĪÅĊÝú¸þ×
Question text
7
A coffee shop runs a computerised loyalty card system.
Customers are issued with a loyalty card with their name together with a unique customer ID.
Loyalty points are added to their card each time they spend money at the shop.
The following information is stored for each customer: ID, name, home address, email address,
mobile phone number, date of birth, number of points, date of last visit and amount of money
spent at last visit.
A new module will generate a personalised email message to each loyalty card customer who has
not visited the coffee shop in the last three months. The message will include a unique voucher
code which can be used to authorise a discount if the customer goes to the shop within the next
two weeks.
(a) Identify three items of customer information that will be used by the new module and justify
your choices.
Item 1 …
Justification …
…
Item 2 …
Justification …
…
Item 3 …
Justification …
…
[3]
(b) Identify the computational thinking skill that you needed to use to answer part (a).
… [1]
(c) It is decided to adopt a formal program development life cycle model for the development of
the new module.
The analysis of the new module is complete and the project moves on to the design stage.
During this stage all the necessary algorithms and module designs will be defined.
State three other items that will be defined for the new module during the design stage.
1 …
2 …
3 …
[3]
ĬÏĊ¾Ġ´íÈõÏĪÅĊàû¶Ă×
,
,
(d) Part of the coffee shop program contains three program modules as follows:
•
Module Init() has no parameters and returns a Boolean.
•
Module Reset() takes a string as a parameter and returns an Integer.
•
Module Check() repeatedly calls Init() followed by Reset().
Draw a structure chart to represent the relationship between the three modules, including all
parameters and return values.
[3]
ĬÍĊ¾Ġ´íÈõÏĪÅĊÞù¶Ą×
Question text
5
A software developer follows a program development life cycle. The life cycle divides the
development process into various stages.
(a) The following table lists some development activities.
Complete the table by writing the name of the life cycle stage for each activity.
Activity
Name of life cycle stage
A compiler is used.
A program that has been released for general use is modified.
The dry run method is used.
The program structure is specified.
[4]
(b) A software developer has written modules Test_A() and Test_B(). These have been
written but contain errors. These modules are called from several places in the main program
and testing of the main program (integration testing) has to stop.
Identify a method that can be used to continue testing the main program before the errors in
these modules have been corrected and describe how this would work.
Method …
Description …
…
…
…
[3]
ĬÙĊ®Ġ´íÈõÏĪÅĊÝû¸þ×
Question text
7
A coffee shop owner wants to introduce a computerised loyalty card system.
A programmer discusses the details of the system with the shop owner.
(a) Identify the stage of the program development life cycle that this discussion is part of and
give a document that will be produced during this stage.
Stage …
Document …
…
[2]
(b) The shop will give each customer a loyalty card that displays a unique customer ID as a
bar code. A customer will be able to present their card each time they make a purchase. The
system will scan the bar code, calculate points, and add them to the customer’s total. When
the customer next makes a purchase and presents their card, they will have the option to
exchange points for a discount.
The designer decides that this activity will be handled by a new module. Decomposition
will be used to break the problem of designing the new module down into sub-problems
(sub-modules).
Identify four sub-modules that could be used in the design of the new module and describe
their use.
Sub-module 1 …
Use …
…
Sub-module 2 …
Use …
…
Sub-module 3 …
Use …
…
Sub-module 4 …
Use …
…
[4]
ĬÙĊ®Ġ´íÈõÏĪÅĊßû¸Ā×
Question text
7
An algorithm is represented by a state-transition diagram.
The table shows the inputs, outputs and states for the algorithm:
Current state
Input
Output
Next state
S1
A1
X1
S2
S2
A3
none
S1
S2
A2
X4
S5
S5
A1
X1
S5
S5
A4
X2
S2
S5
A3
none
S3
S1
A9
X9
S3
S3
A9
X9
S4
Complete the state-transition diagram to represent the information given in the table.
A1 | X1
START
S1
A3
[5]
Question text
4
A procedure Count() will:
1.
input a value (all values will be positive integers)
2.
count the number of odd values and count the number of even values
3.
repeat from step 1 until the value input is 99
4.
output the two count values, with a suitable message.
The value 99 must not be counted.
(a) Write pseudocode for the procedure Count().
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
… [6]
(b) The procedure Count() is to be tested.
Typical test data would consist of odd and even values, for example:
23, 5, 64, 100, 2002, 1, 8, 900, 99
The purpose of this test would be to test a typical mix of even and odd values and check the
totals.
Give three test data sequences that may be used to test different aspects of the procedure.
Do not include invalid data.
Sequence 1:
Test data …
Purpose of test. …
…
Question text
2
(a) An algorithm will process data from a test taken by a group of students. The algorithm will
prompt and input the name and test mark for each of the 35 students.
The algorithm will add the names of all the students with a test mark of less than 20 to an
existing text file Support_List.txt, which already contains data from other group tests.
(i)
Describe the steps that the algorithm should perform.
Do not include pseudocode statements in your answer.
…
…
…
…
…
…
…
…
…
…
…
… [5]
(ii)
Explain why it may be better to store the names of the students in a file rather than in an
array.
…
…
… [1]
(iii)
Explain why WRITE mode cannot be used in the answer to part 2(a)(i).
…
…
… [1]
(b) Examine the following state-transition diagram.
Input-A Output-X
Input-B Output-W
Input-B
START
S2
S1
S3
Input-A
Input-A
Input-B
Input-A Output-W
S4
Complete the table to show the inputs, outputs and next states.
Input
Output
Next state
S1
Input-A
S2
Output-W
Output-W
[4]
Question text
1
A program is required for a shopping website.
(a) Part of the program requires four variables. The following table describes the use of each
variable.
Complete the table by adding the most appropriate data type for each variable.
Variable use
Data type
Store the number of days in the current month
Store the first letter of the customer’s first name
Store an indication of whether a year is a leap year
Store the average amount spent per customer visit
[4]
(b) The designer considers the use of a development life cycle to split the development of the
website into several stages.
(i)
State one benefit of a development life cycle when developing the website.
…
… [1]
(ii)
Analysis is one stage of a development life cycle.
State one document that may be produced from the analysis stage of the website project.
…
… [1]
(c) The program will be developed using the Rapid Application Development (RAD) life cycle.
(i)
State one principle of this life cycle.
…
… [1]
(ii)
Give two benefits and one drawback of its use compared to the waterfall life cycle.
Benefit 1 …
…
Benefit 2 …
…
Drawback …
…
[3]
(d) Adaptive maintenance needs to be carried out on the website program.
Give two reasons why adaptive maintenance may be required.
1 …
…
2 …
…
[2]
Question text
1
Sylvia is testing a program that has been written by her colleague. Her colleague tells her that the
program does not contain any syntax errors.
(a) (i)
State what her colleague means by “does not contain any syntax errors”.
…
…
… [1]
(ii)
Identify and describe one other type of error that the program may contain.
Type of error …
Description …
…
[2]
(b) Complete the following table by giving the appropriate data type in each case.
Use of variable
Data type
The average mark in a class of 40 students
An email address
The number of students in the class
To indicate whether an email has been read
[4]
(c) An airline wants to provide passengers with information about individual flights and allow
them to book their flight using an online booking system.
(i)
Tick (3) one box in each row of the table to indicate whether each item of information
would be essential for the customer when making the booking.
Information
Essential
Not essential
Departure time
Flight number
Departure airport
Aircraft type
Ticket price
Number of seats in aircraft
[3]
(ii)
Identify the technique used to filter out information that is not essential when designing
the booking system and state one benefit of this technique.
Technique …
Benefit …
…
[2]
(iii)
Identify two additional pieces of essential information that a passenger might need
when booking a flight.
1 …
2 …
[2]
Question text
4
A program controls the heating system in a sports hall.
Part of the program involves reading a value from a sensor. The sensor produces a numeric value
that represents the temperature. The value is an integer, which should be in the range 0 to 40
inclusive.
A program function has been written to validate the values from the sensor.
(a) A test plan is needed to test the function.
Complete the table. The first line has been completed for you.
You can assume that the sensor will generate only integer data values.
Test
Test data value
Explanation
Expected outcome
1
23
Normal data
Data is accepted
2
3
4
5
[4]
(b) A program module controls the heaters. This module operates as follows:
•
If the temperature is below 10, switch the heaters on.
•
If the temperature is above 20, switch the heaters off.
Complete the following state-transition diagram for the heating system:
Start
Heaters
Heaters
On
Off
[3]