Errors!
Where do errors occur? Anywhere data is transferred, processed, stored, etc. Input user error Storage magnetic hard drive errors physical tampering (hax0ring) Communication electrical interference / noise physical tampering (hax0ring)
How do we detect errors? verification “making sure that the data on the source documents is exactly the same as the input to the computer system” ve ~equal data = input validation “making sure that the data input into the system makes sense” va ~ acceptable data makes sense
Verification visual verification proofreading double entry force re-entry of data (e.g. passwords or s)
Validation Range checks Is this birthday acceptable (M/D/YY)? 1/62/07 Type checks How old are you? 8a years old Format checks Please enter your birthday (M/D/YY): 1/16/2007
Which of these numbers has an error? How do you detect errors if you had nothing to compare your data against?
Check Digits Append additional data for comparison 1. Apply some algorithm on the data to generate a check digit 2. Attach the check digit to the data 3. To verify the data in the future, apply the same algorithm to the data to generate the check digit again – compare against old check digit to verify
Parity Bit Even Parity Check digit (1 or 0) is added to make sure there are an even number of 1s Odd Parity Check digit (1 or 0) is added to make sure there are an odd number of 1s
Parity Bit Examples Even parity w/ NO ERROR Even parity w/ ERROR Odd parity w/ NO ERROR Odd parity w/ ERROR
Parity Bit Creation Assume you have the following bit string: with even parity, add the parity bit to the right end to maintain even parity
Unweighted Check Digit 1. Add up each of the digits to get a number 2. If number is multidigit, then add up digits of that number 3. Repeat until you have a single digit Example: 2345 = = 5 Check digit for 2345 is 5 Attach at the end, so we store 23455
Other Errors Hardware errors defective hard drive Software errors e.g., decimal in the wrong place Logic errors Runtime errors Syntax errors
How do we fix errors? Re-input Prompt the user to re-enter data Re-transmission If there was electrical interference/noise over a cable, we can always resend the data Transmission Control Protocol (TCP) Backup your data! Verify data against backups