| Concept | Description | Code |
|---|---|---|
| Validation | Automated checks to ensure reasonable data before acceptance. | |
| - Range Check | Verifies if a numerical value falls within specified upper and lower limits. | number < 0 or number > 100 |
| - Length Check | Ensures data has a precise number of characters or a reasonable range of characters. | if pin.length() > 5 |
| - Type Check | Verifies that the entered data corresponds to a specific data type. | if number ≠ round(number) |
| [if the number isnt equal to rounded number] | ||
| - Presence Check | Ensures that some data has been entered and not left blank. | if input = “” [checks if nothing been put] |
| - Format Check | Checks if the entered characters conform to a pre-defined pattern. | |
| - Check Digit | A calculated digit used for data integrity, often in codes like barcodes, ISBN, or VIN. | |
| Verification | Checking that data has been accurately copied from one source to another. | |
| - Double Entry | Data is inputted twice, and the system compares both entries for differences. | |
| - Screen/Visual Check | Users manually review entered data on the screen or paper document for accuracy. |
| Normal | normal data that would be entered — expected to be accepted — 2, 3, 4, 5 |
|---|---|
| Abnormal | weird data of different types and out of range — !@#$, two |
| Extreme | the maximum and minimum values that will be accepted |
| Boundary | the largest and smallest acceptable value is tested as well as the largest and smallest unacceptable value |
| Type of Iteration | Description | Loop Type |
|---|---|---|
| Count-controlled Loops | Used when the number of iterations is known beforehand. Also known as a definite loop. | FOR |
| Precondition Loops | Used when the number of iterations is not known beforehand and depends on a condition. Also known as an indefinite loop. | WHILE |
| Postcondition Loops | Used when the loop must execute at least once, even if the condition is false initially. | REPEAT-UNTIL |
MAINTAINABLE PROGRAM -
Including appropriate use of: – meaningful identifiers – the commenting feature provided by the programming language – procedures and functions – relevant and appropriate commenting of syntax
Use meaningful identifiers for: – variables – constants – arrays – procedures and functions