Still loading. This can take a moment on a slow connection.
Still loading. This can take a moment on a slow connection.
Unit 7 · Algorithm Design and Problem-Solving
Test a validation routine with normal, abnormal, extreme and boundary data, and say which data each check rejects.
A mark out of 100 must be a whole number from 0 to 100.
Run a test to see what each check does with it.
0 of 8 planned tests run on the mark. For each piece of test data, choose its type and the result you expect, then run the test.
The test plan is on the stage. For each piece of test data, choose what type it is and whether the routine should accept it, then run the test.
Type your own test data, or tap the number line, and run it: find data that each check rejects, and data for which a check is not tested.
After you run a test, this says why each piece of data is the kind it is.
Try what you found on the lesson’s 34 marked questions. Practise in The Program Development Life Cycle
Validation checks that data is reasonable, not that it is right: a mark of 75 passes every check even if the real mark was 57. Verification, such as typing the data twice or checking it against the original, is what catches that.
Each routine runs its checks in the order listed, and stops at the first that fails. Spaces at either end of what is typed are ignored. A mark typed with a minus sign, − or -, is read as a negative number.
The number line is not to scale: the values either side of each edge are spread out so that they can be told apart. The ISBN’s check digit is worked out as a barcode’s is, with weights of 1 and 3.