GCSEBeast

Standard methods, validation and testing

GCSE Computer Science practice questions on standard methods, validation and testing. Try 3 for free below — with hints, the answer and why the wrong answers are tempting. GCSE Beast has 22 questions on this topic.

Question 1 of 3Difficulty ●●●●●

A bowling alley gives every booking a lane code made of one digit, a hyphen and then two capital letters, for example 7-QB.

Which validation check makes sure that a lane code typed in follows this pattern?

Question 2 of 3Difficulty ●●●●●

A reaction-time game records how long a player takes to hit a target. It accepts a time in whole seconds from 1 to 30 inclusive.

A tester wants to use boundary data to test the upper limit. Which pair of values should be used?

Question 3 of 3Difficulty ●●●●●

A gaming leaderboard stores five scores in the array Points[1:5]:

Points[1]Points[2]Points[3]Points[4]Points[5]
3041253812

This algorithm sorts them:

Last ← 5Passes ← 0REPEAT Swapped ← FALSE Passes ← Passes + 1 FOR Index ← 1 TO Last - 1 IF Points[Index] < Points[Index + 1] THEN Temp ← Points[Index] Points[Index] ← Points[Index + 1] Points[Index + 1] ← Temp Swapped ← TRUE ENDIF NEXT Index Last ← Last - 1UNTIL Swapped = FALSE OR Last = 1OUTPUT Passes

What is output?