2.3 Producing robust programs Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are structured diagrams?

A

They are diagrams showing smaller tasks in larger program

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

Why use structure diagrams?

A
  • easier for programmer as they can work on sections at a time
  • Improves organisation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages of using structure diagrams?

A
  • coding is easier as each part is simple
  • easier to test individually
  • easier to spot issues to fix and update them
  • reuse subprograms in future
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to make the program have more maintainability?

A
  • Comments - explain each key feature of a program
  • indentation - makes control flow clearer
  • variable names - should be relevant fir better understanding
  • Sub Programs - Makes code more understandable as it is split up.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is defensive design?

A

When programmers protect their program

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

How can programmers protect their code?

A

Predict misuse
ensure code is well maintained
reduce errors through extensive testing

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

What are the methods that programmers can use to protect their code?

A

Input validation

Authentication

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

What are the type of checks that input validation uses?

A
Range
Presence
Format (eg a date)
length 
look-up table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is input validation?

A

Is checking data meets criteria before passing it on

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

What is Authentication?

A

Confirms the user identity before they’re able to access certain areas of the program (passwords)

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

What are the common ways to increase the security on passwords?

A
  • use strong passwords - combination of number and letters
  • limit for failed authentication attempts
  • ask for random selection of characters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is syntax errors?

A

where the interpretor doesn’t understand something due to a grammatical mistake

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

What is logic errors?

A

Is where the program runs, but does something unexpected

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

What is the difficulty of diagnosing syntax errors and logical errors?

A

Syntax error - easy to identify as complier returns the error and location.
Logical error - harder to track as they are not picked up by compliers

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

What are the 2 type of testing?

A

iterative testing

Final (terminal) testing

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

What is Iterative testing?

A

Is testing while the programing is being developed

17
Q

What is Final testing?

A

The program is tested at the end of the development process. The whole program is tested at the same time to check that it is working correctly.

18
Q

What is a Test plan?

A

Outlines exactly what you are testing and how you’re intended to do that.
(A good test plan anticipates potential issues)

19
Q

What are the 4 test datas?

A

Normal data
Boundary data
Invalid data
Erroneous data

20
Q

What is normal data?

A

Things that a user is likely to input

21
Q

What is Boundary data?

A

Values at the limit of what a program can handle.

22
Q

What is invalid data?

A

Data that should be rejected

23
Q

What is erroneous data?

A

use of incorrect data type and should be rejected

24
Q

What is machine code?

A

0 and 1s (binary)

25
Q

What is high level language?

A

easy for humans to understand and are programming languages such as python.

26
Q

What is low level language?

A

Hard for humans to read nd write but are easier for the computer to run. It has machine code and assembly languages.

27
Q

Comparison of high level language and low level language.

A
  • instructions - high level has one instruction that represents many lines of machine code. Low level has one instruction is one line of machine code
  • Readable - High level is easy to read and understand. low level is hard to read and understand.
  • CPU internal structure - high level doesn’t need CPU internal structure knowledge. Low level has internal structure of CPU knowledge needed
  • translation - high level requires translation before the computer can understand. Low level doesn’t need translation.
28
Q

The difference between compliers and translators

A

Translates - complier uses all source code at once and creates an EXE file but translator translates and run code line by line.

Returns- complier returns list or errors for entire program but translator returns first error it finds.

speed - complier the compiling is long but runs quickly when done but translator runs slow.

29
Q

What is a Integrated Development Environment?

A

Are pieces of software that help programmers develop a program.

30
Q

What are examples of IDE’s?

A
Syntax Completion
Run-time environment
breakpoints
Version control
Error diagnostics
stepping
31
Q

What is syntax completion?

A

Uses Al to predict what you’re writing and gives option for completion

32
Q

What is run-Time environment

A

Allows code to be quickly run within the IDE

33
Q

What is breakpoints

A

Runs code until a set “breakpoint”

34
Q

What is version control?

A

Allows you to quickly switch between versions of the programming language you are using.

35
Q

What is Error diagnostics

A

Helps find and fix errors in a program

36
Q

what is Stepping?

A

Runs code line by line.