GCSE Computer Science Fundamentals of Programming test

<< Previous: Testing Next: Boolean logic >>

Exam style questions

Download a pdf version of the test

Use the space below each question or a pen and paper to write your answer. When complete click the button for the answer and mark scheme.

NOTE: Answers typed into the browser will not be retained if you leave the page or refresh

Questions

Explain what authentication is and how it can help with defensive design (2 marks)


Authentication is using a system of usernames and passwords (1) this can prevent unauthorised people getting access to a system. (1)



Explain what is meant by validation and name and describe two specific types of validation. (5 marks)


Validation is making sure that input data is likely to be valid. (1) Plus any two pairs of type (1) and description (1) from: Presence check: Makes sure something has been entered; Length check: Checks that input is the right number of characters; Range check: Checks the input is within a valid range such as a number between 1 and 5; Format check: Checks that the input has an acceptable format e.g. an email containing an @ symbol; List check: Only allows values from a list of acceptable values

Describe two ways you can improve the maintainability of code (4 marks)


In pairs of method (1) and explanation (1). Any two sets from: Using sub programs - Makes code easier to understand or only have to edit individual sub-programs; Using naming conventions - makes it easier to remember names; Good indentation and spacing - makes the code easier to read; Use of commenting - explains what sections of code do

Explain the difference between iterative and final testing. (2 marks)


Iterative testing is testing during development to ensure code works as expected. (1) Final testing is testing the finished program to ensure it meets all of its objectives and functions as expected. (1)

A program asks a user to enter a mark on a test out of 25. If they get 13 or more it outputs 'Pass' and if they get 12 or less it outputs 'Fail'. Describe 4 tests that could be made of this program. You should ensure one test is for normal data, another for boundary data, a third for invalid data and the final one for erroneous data (4 marks)


Normal - any expected number not near the boundary outputting the expected result (1)
Boundary - That 12 outputs 'Fail' or that 13 outputs 'Pass' (1) Invalid - any number not in the range 0 to 25 (1) Erroneous - an attempt to enter the wrong data type e.g. "Twelve" (1)


Explain the difference between a syntax error and a logic error. (2 marks)



Syntax errors break the rules of the programming lanuage and stop the code from running. (1) Logic errors cause unexpected outputs but do not prevent the code from running. (1)


<< Previous: Testing Next: Boolean logic >>

© All materials created by and copyright S.Goff