Software development and testing – A Level Computer Science (9618)
31 questions · page 2 of 3
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
5
Several companies are developing websites to market a new type of games console. The company
that is first to create a website that can demonstrate the interactive features of the games console
will have an advantage over the others. The requirements for the website are likely to change as
more information about the features of the console are made available.
One company has decided to develop their website using a program development life cycle based
on the waterfall model.
(a) (i)
Give two reasons why this may not be the most appropriate model to use in this case.
Reason 1 …
…
Reason 2 …
…
[2]
(ii)
Identify a more appropriate program development life cycle model for this scenario.
… [1]
(b) The website has been running in test mode for several weeks.
Identify and describe a final stage of testing that should take place before the website is
made available to all customers.
Stage …
Description …
…
…
…
…
[3]
Question text
7
A school has a computerised library system that allows students to borrow books for a fixed length
of time. The system uses text files to store details of students, books and loans.
A new module is to be written which will generate emails to each student who has an overdue
book.
(a) Decomposition will be used to break down the problem of designing the new module into
sub-problems.
Identify three program modules that could be used in the design and describe their use.
Module 1 …
Use …
…
…
…
Module 2 …
Use …
…
…
…
Module 3 …
Use …
…
…
…
[3]
(b) The program designer produces a structure chart for the new module. Part of the structure
chart is shown:
Module-A()
Module-B()
Module-C()
Module-D()
(i)
Explain the relationship between the four modules shown.
…
…
…
… [2]
(ii)
Two new modules are added: Module‑X() and Module‑Y().
•
Module‑X() has no parameters.
•
Module‑Y() will take a string and a real number as parameters and return a
Boolean value.
•
Module‑D() will call either Module‑X() or Module‑Y().
Draw only the part of the structure chart that represents the relationship between
Module‑X(), Module‑Y() and Module‑D().
[3]
Question text
5
A program is designed, coded and compiled without errors. The compiled code is sent for testing.
(a) The program will be tested using the walkthrough method.
Additional information will be needed before this method can be used.
Identify this additional information and explain why it is needed.
Additional information …
…
Explanation …
…
…
…
[3]
(b) Testing is completed and the program is made available to users.
Some time later, changes are made to the program to improve the speed of response.
State the type of maintenance that has been applied to the program.
… [1]
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
2
Examine the following state-transition diagram.
Button-Y
Button-Z | Output-C
START
S1
S3
Button-Z
Button-Y
Button-Y | Output-A
Button-X
S2
S4
Button-Z | Output-B
(a) Complete the table with reference to the diagram.
Answer
The number of different inputs
The number of different outputs
The single input value that could result in S4
[3]
(b) The initial state is S1.
Complete the table to show the inputs, outputs and next states.
Input
Output
Next state
Button-Y
none
Button-Z
S2
none
[4]
Question text
1
(a) A programmer is testing a program using an Integrated Development Environment (IDE).
The programmer wants the program to stop when it reaches a specific instruction or program
statement in order to check the value assigned to a variable.
Give the technical term for the position at which the program stops.
… [1]
(b) The following table lists some activities from the program development life cycle.
Complete the table by writing the life cycle stage for each activity.
Activity
Life cycle stage
An identifier table is produced.
Syntax errors can occur.
The developer discusses the program requirements with the customer.
A trace table is produced.
[4]
(c) An identifier table includes the names of identifiers used.
State two other pieces of information that the identifier table should contain.
1 …
2 …
[2]
(d) The pseudocode statements in the following table may contain errors.
State the error in each case or write 'NO ERROR' if the statement contains no error.
You can assume that none of the variables referenced are of an incorrect type.
Statement
Error
TRUE AND FALSE
Status
IF LENGTH("Password") < "10" THEN
Code
LCASE("Electrical")
Result
IS_NUM(-27.3)
[4]
Question text
2
A program has been written to implement a website browser and maintenance is now required.
One type of maintenance is called perfective.
Name two other types of maintenance that the program may require and give a reason for each.
Type 1 …
Reason …
…
…
…
Type 2 …
Reason …
…
…
…
[4]
Question text
4
Items in a factory are weighed automatically. The weight is stored as an integer value representing
the item weight to the nearest gram (g).
A function is written to validate the weight of each item. The function will return "PASS" if the
weight of the item is within the acceptable range, otherwise the function will return "FAIL".
The acceptable weight range for an item is 150 g to 155 g inclusive.
The validation function is to be properly tested. Black-box testing will be used and a test plan
needs to be produced.
Complete the table by writing additional tests to test this function.
Type of
Example
Expected
Explanation
test data
test value
return value
Normal
153
"PASS"
Value within the acceptable range
[4]
Question text
8
The following diagram shows the incomplete waterfall model of the program development life
cycle.
(a) Complete the diagram.
Analysis
Maintenance
[3]
(b) Explain the meaning of the downward and upward arrows.
Downward arrows …
…
…
Upward arrows …
…
…
[2]
(c) Identify another type of model for the program development life cycle.
… [1]
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]
Question text
2
(a) An algorithm will:
1.
input an integer value
2.
jump to step 6 if the value is zero
3.
sum and count the positive values
4.
sum and count the negative values
5.
repeat from step 1
6.
output the two sum values and the two count values.
Draw a program flowchart on the following page to represent the algorithm.
Note that variable declarations are not required in program flowcharts.
[5]
(b) A software company is working on a project to develop a website for a school.
The school principal has some ideas about the appearance of the website but is unclear
about all the details of the solution. The principal would like to see an initial version of the
website.
(i)
Identify a life cycle method that would be appropriate in this case.
Give a reason for your choice.
Life cycle method …
Reason …
…
…
…
[2]
(ii)
The website project has progressed to the design stage.
State three activities that will take place during the design stage of the program
development life cycle.
1 …
2 …
3 …
[3]