2.3 Producing robust programs Flashcards
Defensive design
the practice of planning for contingencies in the design stage of project or undertaking
Anticipating misuse
the ability of a programmer to consider how the end user might accidentally (or on purpose) break the program and then write additional code to handle these situations
Authentication
Verifying a user identity before they can use a program with a username and password
What must a strong password have? (authentication)
they must be over a certain length with symbols and mixed case are advised
Input validation
ensuring data input by the user meets the specific criteria before processing
Examples of input validation (5)
range check, type check, presence check, format check and length check
Maintainability
a selection of techniques and methods that make code easy to debug, update and maintain
Naming conventions
many programmers use certain naming conventions for their variables/ procedure names
Indentation
this makes it easy to see where structures begin and end
conditions and iterations should be indented
code inside procedures and functions should be indented
Commenting
this is used by programmers to explain sections of code which make it easier to understand the program
the comments are ignored by the complier
Testing
this is testing the program under various conditions to make sure it is going to work
you need to think about what devices it could be used on and what might cause the rash
Iterative testing
each module is tested while it is being developed
Final/ terminal testing
testing that all the modules of the program work together as expected
checking the program meets the expectations of the user with real data
Syntax error
when the rules of the language have been broken so the program will not run
Examples of syntax error
variables not being declared before use
incompatibility of variable types