Design, Testing and Translators Flashcards
What is structured programming?
Structured programming decomposes the program that you want to write into manageable modules. Each of these modules is then decomposed even further into smaller modules and eventually into modules that perform individual tasks
Give some advantages of using structured programming.
1) coding is easier because you’re only writing subroutines that carry out very simple tasks
2) lots of programmers can work on one program as each module can be written independently
3) it’s easier to test structured programs as each module can be tested individually
4) individual subroutines and modules can be fixed and updated without affecting the rest of the program
5) you will be able to reuse the subroutines and modules in programs you write in the future
Give some features of maintainable source code.
1) comments are useful for explaining what the key features of a program do
2) indentation can be used to separate different statements in a program
3) variables, subroutines and parameters should be named so that they refer to what they actually are
4) only use global variables when necessary as they could affect the rest of your code
What is authentication?
Authentication can confirm the identity of a user before they’re allowed to access certain pieces of data or features of the program
Why is authentication used?
Authentication is used to improve security
What can be done to make a password-based authentication system more secure?
1) force users to use strong passwords and get them to change their passwords regularly
2) limit the number of failed authentication techniques before access to an account is lost
3) ask for a random selection of characters from the password on each authentication
Define the term ‘input validation’.
Checking if data meets certain criteria before passing it into the program
Give some input validation checks.
1) range check
2) presence check
3) format check
4) look-up table
5) length check
Define the term ‘syntax error’.
When the compiler or interpreter doesn’t understand something you’ve typed because it doesn’t follow the rules or grammar of the programming language
Define the term ‘logic error’.
When the compiler or interpreter is able to run the program but the program does something unexected
Why are logic errors more difficult to diagnose than syntax errors?
Compilers and interpreters won’t pick them up
What are the three different types of test data?
1) normal (typical) data
2) boundary (extreme) data
3) erroneous data
What are trace tables used for?
Dry running a subroutine or algorithm to make sure there are no logic errors
What is time efficiency?
The amount of time it takes an algorithm to complete a task
Define ‘machine code’.
Low-level code that represents how computer hardware and CPUs understand instructions. It is represented by binary numbers