Design, Testing & IDE’s - 2.4/5 Flashcards
What is a structure diagram (4)?
Show the smaller tasks to a larger problem
Made by decomposing the program into manageable modules
Each module is decomposed further until their individual tasks which can be written as sub programs
They main program can be written by these sub programs
Advantages of structure diagrams?
Coding is easier
Easier to test
Each module can be individually improved/updated without affecting the whole program
Can reuse sub programs in the future
What factors can help maintain a program (4)?
Comments - explain what key features of code does
Indentation - separate different statements
Naming of variable, sub programs, parameters
Using sub programs
What is defensive design?
Helps ensure a program functions properly
Program shouldn’t break or produce errors
Ways programmers protect their programs with defensive design?
Anticipate how users may misuse data and attempt to prevent it
Ensure code is well-maintained
Reduce number of errors by testing
What is input validation (2)?
Checking if data meets a certain criteria before passing it on to the next criteria
Prevents misuse of data by users
Types of input validation (5):
Range check - checks if data is in a certain range
Presence check - checks data has been entered
Format check - checks data is in 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 authentication (3)?
Helps protect programs
Confirms the identity of a user before they have access to parts of a program
Passwords
Ways to increase security of passwords (3)?
Force users to create strong passwords and change them regularly
Limit number of failed attempts
Use 2 factor authentication
What are the types of common errors in a program?
Syntax errors
Logic errors
Run-time
What are syntax errors?
When the compiler or translator doesn’t understand something written as it doesn’t follow the rules of the programming language
Found by compilers and interpreters
What are logic errors (3)?
When the compiler or interpreter can run the program but it does something unexpected
More difficult to diagnose
Found through general use of program
What are the main types of testing?
Iterative - program is tested while being developed
Foxes smaller details, helps prevent errors occurring later on
Final - program is tested at the end of the development
What is a test plan (3)?
Outlines what you’re going to test and how
Good test plan anticipates potential issues and selects appropriate test data
What are the 4 categories test data fall into? What they mean?
Normal - things that a user is likely to input into the program
Boundary - values at the limit of what the program should handle
Invalid - inputs with correct data type that should be rejected
Erroneous - inputs with an incorrect data type that should be rejected by the program
What is a trace table?
Helps you find logic errors
Gives a simple way of testing that a piece of code works
Keep track of values of variables
‘Dry run’ a program
What are High-level computer languages?
Python, C++, Java
Features of a high-level language (5):
One instruction of high level code = many machine code instructions
Same code will work with different processors
Easily store data
Code is easy to read, understand and modify
Must be translated
What are low level computer languages?
Assembly code, machine code
Features of low-level languages (3):
Written for one type of processor
Difficult to read, undertone and modify
Don’t need a translator
What are translators? Examples:
Translate high level languages into machine code that a computer can read and execute
Interpreters and compilers
Features of compilers (5):
Translates all source code at the same time and creates one executable file
Only needed once
Returns a list of errors once compiling is complete
Compiled program runs quickly
Compiling takes a long time
Features of an interpreter (4):
Translates and runs the source code one instruction at a time
Needed every time you want to run a program
Return first error then stop - food for debugging
Programs will run more slowly as code is being translated while program runs
What is an IDE?
Integrated development environment
Piece of software what provides features for programmers to develop their code