Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary OCR GCSE Computer Science - 2.3 Producing Robust Programs Complete Notes

Rating
-
Sold
-
Pages
3
Uploaded on
18-07-2025
Written in
2023/2024

OCR GCSE Computer Science notes for 2.3 Producing Robust Programs - including all of the information you need to know and questions to practice your recall skills - which helped me to get a 9 at GCSE!

Institution
Course

Content preview

o Things may go wrong whilst a program is executed that could not be foreseen, so we must anticipate misuse
Defensive Design (plan for contingencies).
o Validation is checking data inputted by the user meets o Division by zero:
specific requirements or rules before processing. • In maths, no number when multiplied by zero returns a non-zero number - therefore, the ALU cannot
o Five validation checks: compute a division by zero.
• Type check - checking whether the data entered
was of the correct data type (eg. integer, real,
string).
• This line of code while syntactically correct will potentially crash a program.
▪ A program will crash if the input statement
• A programmer should always check that a variable is not zero before attempting division by it - this can be
requires an integer input, but data done using a simple if statement.
inputted cannot be converted to the
integer data type - it would be better to
use a simple input statement.



▪ o Communication error:
• Online systems require connections to host servers - if the connection is dropped, unable to be established
or the server is overloaded, it could potentially cause a program to crash or hang when loading/saving
data.
• Range check - checking whether the input is within
• A programmer should enable ways for the user to cancel requests or for them to fail gracefully, reporting
a correct range (eg. between 1 and 10/ between A
the connection error.
and Z).
• The program may be able to automatically resume when the connection is available.
• Presence check - checking whether some data has
been entered (eg. reject blank inputs). o Printer and other peripheral errors:
• Format check - checking whether the input is in the
• Peripherals can generate a whole host of unforeseeable errors, such as in printers.
correct format (eg. dd/mm/yyyy, postcodes).
• If a program outputs a hardcopy, the printer may run out of paper, ink or may have a jam.
• Length check - checking whether the input has the
• The programmer should not assume that an output to a printer was successful and always have options to
correct (or min/max) number of characters (eg.
reprint reports or receipts.
password, car licence plates, national insurance
numbers). o Disk errors:
o By using input validation techniques, a programmer can:
• Programs that read and write to files need to handle many types of exceptions, including:
make their program more robust, more user friendly,
▪ the file/folder not being found
and prevent further errors occurring later in the
▪ the disk being out of space (otherwise the program will crash)
algorithm.
▪ the data in the file being corrupt
▪ the end of the file being reached (causing an error)
o • Robust programs will handle all these situations by checking files and data before attempting to use them
What is validation?
o for further processing.
What are the five validation checks?
o What 3 things does input validation techniques allow a
programmer to do?

Written for

Institution
Study
Course
School year
200

Document information

Uploaded on
July 18, 2025
Number of pages
3
Written in
2023/2024
Type
SUMMARY

Subjects

$5.50
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
kuromouse

Also available in package deal

Get to know the seller

Seller avatar
kuromouse
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
48
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions