robust programs
functions correctly even if input is unexpected
input validation
checking whether data matches certain rules
maintainability
ensuring a program is easy to understand and modify
examples of maintainability
-subprograms
-clear variable names
-indentation
-commenting
advantages of commenting
explain sections of code
advantages of indentation
show which code belongs inside a particular block
advantages of subprograms
reduces need to copy and paste code
purpose of testing
ensures a program functions as expected
iterative testing
testing during development
terminal testing
tests entire program at end
syntax error
stops program running
logic error
gives unexpected output
normal test data
correct data type accepted by program
boundary test data
maximum or minimum correct data type accepted by program
invalid test data
correct data type not accepted by program
erroneous test data
incorrect data type not accepted by program
example of syntax error
forgetting brackets
example of logic error
wrong operator
examples of input validation
-range check
-Prescence check
-length check
-format check
-type check
how does a range check work
-ensures value falls between the range of two specific numbers
how does a prescence check work
-ensures that input field has not been left empty
how does a length check work
-ensures data is a specific length or falls between a range of lengths
how does a format check work
-ensures data follows a predefined format e.g. a-z
how does a type check work
-ensures data is a specific type e.g. integer/string