Section 3-Design, Testing and Transalators Flashcards
What is structured programming?
Structured programming involves decomposing the program that you want to write into manageable modules. Each of those modules is then decomposed even further into smaller modules and eventually into modules that perform individual tasks.
How do you list a module?
You need to list the module’s name, any inputs, processes and the output return value if any.
Advantages of structured programming
Coding is easier because you’re only writing subroutines that can carry out simple tasks.
Lots of programmers can work on one program as each module can be written independently.
It’s easier to test structured programs as each can be tested individually.
Individual subroutines and modules can be fixed and updated without affecting the rest of the program.
You will be able to reuse the subroutines and modules in programs you write in the future.
What should a well maintained program enable you or others to do?
They should be able to change parts in your code without risking of causing problems elsewhere I the code.
What are the features that can improve the maintainability of the source code?
Comments are useful for explaining what the key features of a program do.
Indentation can be used to separate different statements in a program.
Variables, subroutines and parameters should be named so that they refer to what they are.
Only use global variables when necessary as they could affect the rest of the code.
What does authentication mean?
Authentication can confirm the identity of a user before they’re allowed to access certain pieces of data or feature of the program.
What does validation do?
Prevents users from accidentally or intentionally misusing a program.
What is input validation?
Checking if data meets certain criteria before passing into the program.
What are the different types of validation checks?
Range check- checks the data is within a specific range
Presence check- checks the data has actually been entered
Format check- checks the data has the correct format.
Look-up table- checks the data against a table of acceptable values.
Length check- checks the data is the correct length
What is a syntax error?
When the compiler or interpreter doesn’t understand something you have typed because it doesn’t follow the rules or grammar of the programming language.
What is a logic error?
When the compiler or interpreter is able to run the program but the program does something unexpected.
How can a syntax error be diagnosed?
It can be diagnosed by compilers and interpreters-they’ll be unable to turn the source code into machine code and a syntax error will be returned.
How can a logic error be diagnosed?
It more difficult to diagnose and track down- compilers and interpreters won’t pick them up. Logic errors are found through the general use of the program and by systematically testing it using a test plan.
What is a test plan?
A test plan will outline what you are going to test and how you’re going to test it. A good test plan will anticipate potential issues with the program and select appropriate test data to test for these issues.
What are the data types for the test data testing thing?
Normal data- things that a user is likely to input into the program.
Boundary data- values at the limit of what the program should be able to handle.
Erroneous data- inputs that the program should not accept.