Design, Testing & IDE’s - 2.4/5 Flashcards

1
Q

What is a structure diagram (4)?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Advantages of structure diagrams?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What factors can help maintain a program (4)?

A

Comments - explain what key features of code does
Indentation - separate different statements
Naming of variable, sub programs, parameters
Using sub programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is defensive design?

A

Helps ensure a program functions properly
Program shouldn’t break or produce errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Ways programmers protect their programs with defensive design?

A

Anticipate how users may misuse data and attempt to prevent it
Ensure code is well-maintained
Reduce number of errors by testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is input validation (2)?

A

Checking if data meets a certain criteria before passing it on to the next criteria
Prevents misuse of data by users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Types of input validation (5):

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is authentication (3)?

A

Helps protect programs
Confirms the identity of a user before they have access to parts of a program
Passwords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Ways to increase security of passwords (3)?

A

Force users to create strong passwords and change them regularly
Limit number of failed attempts
Use 2 factor authentication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the types of common errors in a program?

A

Syntax errors
Logic errors
Run-time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are syntax errors?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are logic errors (3)?

A

When the compiler or interpreter can run the program but it does something unexpected
More difficult to diagnose
Found through general use of program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the main types of testing?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a test plan (3)?

A

Outlines what you’re going to test and how
Good test plan anticipates potential issues and selects appropriate test data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 4 categories test data fall into? What they mean?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a trace table?

A

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

17
Q

What are High-level computer languages?

A

Python, C++, Java

18
Q

Features of a high-level language (5):

A

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

19
Q

What are low level computer languages?

A

Assembly code, machine code

20
Q

Features of low-level languages (3):

A

Written for one type of processor
Difficult to read, undertone and modify
Don’t need a translator

21
Q

What are translators? Examples:

A

Translate high level languages into machine code that a computer can read and execute
Interpreters and compilers

22
Q

Features of compilers (5):

A

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

23
Q

Features of an interpreter (4):

A

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

24
Q

What is an IDE?

A

Integrated development environment
Piece of software what provides features for programmers to develop their code

25
Q

Features of an IDE (5):

A

Run-time environment - code runs more quickly
Line numbering - good for mentioning of errors
Debuggers - allows you to create breakpoints which stop the code at fixed points so the variables can be assessed
Syntax highlighting
Auto - indentation