Computer Science - 9210 OxfordAQA

Robust And Secure Programming

Overview

Ask a program for a number between 1 and 10 and somebody will type 0, and somebody else will type 11, and somebody else will type seven, and somebody else will press Enter without typing anything at all. None of those people is being difficult. They are what a user is, and a program that only works when it is given exactly what it expected is not finished.

This lesson covers the three things the specification asks for here. Writing simple data validation routines, using the checks it names by example: a minimum length, an empty string, and a number within a given range. Writing a simple authentication routine using a username and a password. And selecting suitable test data that covers normal, or typical, boundary and erroneous cases, and being able to justify the choice. That last objective is the one candidates prepare for least and it is worth as many marks as the other two.

Objectives

  1. Be able to write simple data validation routines.
  2. Be able to write simple authentication routines.
  3. Be able to select suitable test data that covers normal (typical), boundary and erroneous data. Be able to justify the choice of test data.

Mind map

This topic is mapped out so you can see how the ideas connect.

Open the mind map in the app

Lesson Note

Robust describes a program that keeps working sensibly when it is given input it did not expect. A program that stops with an error message full of internal detail when somebody types a letter into a number box is not robust, and neither is one that carries on silently with a meaningless value.

Complete Note Available on the Green Bridge App

Get the Green Bridge CBT app on your phone or computer for the complete IGCSE library: past papers, mark schemes, mind maps, flashcards and audio lessons.

Full lesson notes with diagrams
AI-powered learning assistant
Timed mock exams marked the moment you finish
Available on Android, Windows, macOS, and Linux iOS app coming soon

Lesson Evaluation

Congratulations on completing the lesson on Robust And Secure Programming. Now that youve explored the key concepts and ideas, its time to put your knowledge to the test. This section offers a variety of practice questions designed to reinforce your understanding and help you gauge your grasp of the material.

You will encounter a mix of question types, including multiple-choice questions, short answer questions, and essay questions. Each question is thoughtfully crafted to assess different aspects of your knowledge and critical thinking skills.

Use this evaluation section as an opportunity to reinforce your understanding of the topic and to identify any areas where you may need additional study. Don't be discouraged by any challenges you encounter; instead, view them as opportunities for growth and improvement.

  1. Which of these is a data validation check named in the specification? A. Checking that a password has been encrypted B. Checking that a string is not empty C. Checking that a name is spelled correctly D. Checking that a user is over 18 by asking twice Answer: B
  2. A routine accepts values from 20 to 40 inclusive. Which is a boundary test value? A. 0 B. 30 C. 41 D. forty Answer: C
  3. Which loop structure is most appropriate for a validation routine? A. A FOR loop B. A REPEAT UNTIL loop C. A nested FOR loop D. No loop is needed Answer: B
  4. In an authentication routine, why should the failure message not say which of the username and the password was wrong? A. It would make the message too long B. It would confirm to a guesser that a username exists C. The program cannot tell which was wrong D. The specification forbids messages Answer: B
  5. What does validation check? A. That the data entered is true B. That the data entered is reasonable C. That the user is who they claim to be D. That the program has no syntax errors Answer: B

Work through these questions in the app

Work through these questions in the app

Practice Mock Questions

Want to practice mock questions on Robust And Secure Programming? Download the Green Bridge CBT app to access mock questions and full practice assessments for this topic.

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning