Font size
WorksheetsDefensive Programming Intro
Total questions: 10
Worksheet time: 5mins
Defensive design is about ...
Stopping other countries attacking your code
Writing boring programs
programs not breaking or doing "the wrong thing"
stopping other people stealing your code
The number of errors in programs can be reduced by
Making your program simpler
Testing thoroughly
Using a bigger font
Choosing a more restrictive language
Whitelisting inputs means...
Having a list of allowed characters
Ensuring that there are "whitespace" characters in passwords
Ensuring that there are no "whitespace" characters in passwords
Having writing in white so it's clearer
Cleaning up user's input is called
validation
sanitisation
normalisation
authentication
Checking that the user is genuine is called
Authorisation
Validation
Augmentation
Authentication
Logic errors mean that your program
might not make sense to the user
will not run
will not compile
might do something unexpected
The best idea for testing is to
write the whole program and test it at the end
test a simple version and keep testing as you develop
test the different parts of your program
get an alpha version out ASAP and let the users loose
Comments help
your code run better
slow down your code
make your code more maintainable
the computer to understand your code
Which of these can help maintenance (CHOOSE ALL)
indentation
commenting
compiling
blacklisting
Auto-documentation is when
the computer guesses what your program does and displays it in a nice diagram
you hire someone to explain your code and write a manual
you rely on the program being well written and easy to read so people can tell what you mean
your comments are structured so that a summary of your program can be made by an external utility
