Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Summative Assessment for the unit «12.

1С System testing»
Learning objectives 12.5.3.1 describe execution errors when a program is started
12.5.3.2 perform testing using normal data
12.5.3.4 perform testing using erroneous data
12.5.3.5 describe a syntax error in a program code
12.5.3.6 describe a logical error in a program code
Assessment criteria A learner
 state two causes of runtime errors;
 explain what normal data and gives examples;
 give an example of erroneous data for different situations;
 explain a syntax error in a program code;
 explain a logical error in a program code.

Level of thinking skills Knowledge and comprehension, application


Duration 20 min

Tasks:
1. A company owns 50 cars that are available for hire. The cars are numbered from 1 to
50. The size of a car can be small, medium, or large.
The following pseudocode procedure, SetOut(), takes as input the size of the car the customer
has requested for hire and outputs details of the cars that are available for hire for that size of
car.
Line numbers are given for reference only.

Refer to the Appendix on table 1 for a list of built-in pseudocode functions and operators.

NUM_TO_STRING(x : REAL) RETURNS STRING returns a string representation of a


numeric value
Note: This function will also work if x is of type INTEGER Example:
NUM_TO_STRING(87.5) returns "87.5"
Operator Description
Concatenates (joins) two strings
&
Example: "Summer" & " " & "Pudding" produces "Summer Pudding"
Performs a logical AND on two Boolean values
AND
Example: TRUE AND FALSE produces FALSE
Performs a logical OR on two Boolean values
OR
Example: TRUE OR FALSE produces TRUE
table 1

01 DECLARE Available : ARRAY[1:50] OF BOOLEAN


02 DECLARE CarSize : ARRAY[1:50] OF STRING
03 PROCEDURE SetOut (Size: STRING)
04 DECLARE Index : REAL
05 INPUT(Size)
06 FOR Index 0 TO 50
07 IF Size = CarSize[Index] AND Available[Index] = "TRUE"
08 THEN
09 OUTPUT NUM_TO_STRING(Index) & ": " & Size & " Available"
10 ENDIF
11 ENDFOR
12 ENDPROCEDURE

(a) Complete the table by identifying four line numbers that contain errors and give the
correct pseudocode statement.
Line number Correct pseudocode statement
Procedure SetOut() (no parameter needed)
03
04
DECLARE Index: INTEGER
06
FOR Index 1 TO 50
IF Size = CarSize[Index] AND Available[Index] = TRUE (no
07
brackets needed)

[4]

2. The table below contains descriptions of the types of errors that can occur during
programming. Drag and drop the types of errors into the correct positions in the table.

Items: SYNTAX, LOGIC, RUNTIME


Description Type of error
When code runs correctly but the program does not work as expected or LOGIC
produce the expected output.
When an error occurs during the use of the program. Common errors of this RUNTIME
type include trying to divide by 0 or access an item in an array that does not
exist or also can be as example of infinite loop
When the translator does not recognise the keywords or commands entered. SYNTAX
Common errors of this type include mistyping a keyword or missing out
brackets.

[3]

3. Errors in code can be found using test data.


For example, erroneous/abnormal data for algorithm to find the average percentage marks from
ten end of term examinations (percentage marks should only be in the range 0 to 100)

Provide the following:

1 Two sets of normal data 5, 99


expected results: it is going to work out
2 Some erroneous/abnormal data: 101, -7
expected results: it is not going to work out
3 Two sets of boundary data: 0, 100
.expected results: it is going to work out

4. Describe feature of black-box testing.


Testing a system without a prior knowledge of its working. A tester provides an input and
observes the output generated by the system.

5. Describe feature of white-box testing.


Testing a system inspecting and verifying its internal structures (algorithms).

6. Test Plan
Uses normal/extreme/erroneous data to test solution
Let’s take the registration form in which we have following rules: at least 24 characters,
at least one digit and at least one special character.

Normal data set: B!teme323, 555baskeTBaolll


They will work out because they satisfy all the rules.

Abnormal data set: JZeekenov7 (no special characters), xxx@DastenEwe (no digits)

Extreme data set: Elnur7$, ElnurBestLion6%


They will also work out because they satisfy each rule at least once.

[3]

Assessment criteria Task Descriptor Mark


A learner be able to
Identify type of errors 1 write down errors and correct pseudocode 1
in a program code statement in the program code
write down errors and correct pseudocode 1
statement in the program code
write down errors and correct pseudocode 1
statement in the program code
write down errors and correct pseudocode 1
statement in the program code
Explains an error in a 2 Give descriptions for syntax error 1
program code Give descriptions for logic of errors 1
Give descriptions for runtime of errors 1
Provides examples for 3 Provide two sets of normal data and 1
types of data and expected results
expected results Provide erroneous/abnormal data and 1
expected results
Provide two sets of boundry data and 1
expected results
Explains what 4 describes White box testing 1
methods of the testing 5 describes black box testing 1
Creates a test plan 7 Creates table with normal data 1
Creates table with abnormal data 1
Creates table with extreme data 1
Total marks 14

You might also like