S3 - Design, testing and translators (Done) Flashcards Preview

Computing - GCSE > S3 - Design, testing and translators (Done) > Flashcards

Flashcards in S3 - Design, testing and translators (Done) Deck (39)
Loading flashcards...
1

What is structured programming ?

Involves decomposing the program that you want to write into manageable modules, each of which is then further decomposed into smaller modules and then again until each module performs a single task. Which can be coded using simple subroutines which can be referenced in the overall program.

2

What does documenting the interface of a program ensue ?

Listing the modules name, any inputs, processes and the output/return value.

3

What are the advantages of structured programming ?

Coding is easier in small chunks, each module can be written independently so many people can work on it, it's easier to test as each module can be tested, individual modules can be edited without affecting whole program and you can reuse subroutines in future programs.

4

Why should you keep your program well maintained ?

Makes it easy for other people to know what's happening, and they should be able to change parts of the source code without causing problems elsewhere.

5

How can you keep a program well maintained ?

Comments - to explain whats happening at key points, indentation - to separate different statements, well named variables, subroutines and parameters - making it easier to keep track of them, and try to use local variables so changing them in subroutines won't affect other parts of the program.

6

What is authentication ?

Used to increase security of programs, can confirm identity of a user before they're allowed to access certain pieces of data or features of the program.

7

How can you increase the security of a password based authentication system ?

Force users to use strong passwords and get them to change regularly, limit number of failed attempts before an account ban, and ask for random selection of characters from the password on each authentication.

8

What is input validation ?

Checking if data meets certain criteria before passing it into the program.

9

What are some common types of input validation ?

Range check, presence check, format check, look-up table (compares against table of accepted values) and length check.

10

What are the types of programming error ?

Syntax errors or logic errors.

11

What is a syntax error ?

When the compilers or interpreters don't understand something you've typed because it doesn't follow rules or grammar of the programming language.

12

What is a logic error ?

When compiler or interpreter is able to run the program but the program does something unexpected.

13

How can syntax errors be diagnosed ?

Using compilers and interpreters which will be unable to turn the incorrect source code into machine code so a syntax error with it's location will be returned.

14

How can logical errors be diagnosed ?

Compilers and interpreters won't pick them up - so they're found through general use of the program and by systematically testing it using a testing plan.

15

What is a test plan ?

Plan to outline exactly what you're going to test and how, should cover all possible paths of a program.

16

What should a good test plan contain ?

Should anticipate potential issues with the program and select appropriate test data to test for these issues.

17

What three categories should test data fall under ?

Normal (typical) data - likely inputs, boundary (extreme) data - values at the limit of programs ability, and erroneous data - inputs that shouldn't be accepted.

18

What should a test plan table look like ?

Columns for 'type of (test) data', 'test data', 'reason for testing', 'expected outcome', 'actual outcome' and 'pass or fail'.

19

When do you use trace tables ?

When you've identified there's a logic error - helps trace values variables take through the program to pin-point where something's gone wrong.

20

What are trace tables ?

Simple way to see what a piece of code is doing, and if it's working correctly - each column in the trace table representing a variable, and each row represents the values variables take at points in the program.

21

What deems an algorithms efficiency ?

The amount of 'time' they take to complete a task - smaller the 'time' taken the more efficient. Also its 'space efficiency' - how much space in the memory it takes up.

22

What does the idea of 'time' mean in terms of an algorithms efficiency ?

Not the real-life time, things like the number of times memory was accessed, number of CPU cycles taken to execute commands or number of times a loop was executed.

23

What is a high level programming language ?

One which is easier for humans to write, but computers need to translate into machine code before they can read and run it - as it's written in a language closer to what people speak/write in.

24

What is a low level programming language ?

Ones that are difficult for humans to read and write but easier for a computer to run - consisting of machine code and assembly languages.

25

What is machine code ?

Series of 1s and 0s difficult for humans to understand - each processor or family of processors have their own specific machine code.

26

What is assembly code ?

More readable for humans and more memorable, so programmers less likely to make mistakes. Often used when developing software for embedded systems or when they need more control over specific hardware.

27

What are some advantages of high level languages ?

One instructions of high level equivalent to many in machine code, same code works for different processors, easy to store data in different structures without knowing about memory structure and easy to read, understand and modify.

28

What are some disadvantages of high level languages ?

Must be translated into machine code before it's understandable for computers and you have little control over what the CPU does specifically so it'll be less memory efficient and slower.

29

What are some advantages of low level languages ?

One instruction of assembly code equivalent to one in machine code, commands in machine code can be executed directly without a translator and you control what the CPU does and how it uses memory so it'll be more memory efficient and faster.

30

What are some disadvantages of low level languages ?

Usually written for one type of processor so won't work on others, programmer needs to know about internal structure of the CPU and how it manages memory and difficult to read, understand and modify.

31

What are translators for ?

Translating high level languages or assembly code into machine code.

32

What are the translators ?

Assemblers, compilers and interpreters.

33

What is an assembler ?

Used to turn assembly code into machine code, many different assembly languages to support different CPUs each one needing a unique assembler.

34

What are compilers and interpreters for ?

Translating high level languages into low level languages.

35

What does a compiler do ?

Translate whole source code at the same time and creates one executable file, returns list of errors for entire program once compiling completed, runs quickly after compiled but takes long time to do so, and only needed once to create executable file.

36

What does an interpreter do ?

Translates and runs source code one instruction at a time, doesn't create an executable file, needed every time you want to run a program, returns first error it finds then stops - useful for debugging, and program runs slowly because it's translating while running.

37

When are compilers used ?

For when you want to distribute software.

38

When are interpreters used ?

When you're developing software.

39

Flashcards

Done!