Computational Thinking (III) - Design, Testing and IDEs Flashcards

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

For a computer language to be processed what must happen?

A

It needs to be translated into machine code

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

What are the advantages of high level programming languages?

A

They are close to the spoken and written language of the programmer making it much easier to work with

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

Name some high level languages

A

Python

Java

C++

C#

Visual Basic

JavaScript

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

Programs written in high level language are known as what?

A

Source code

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

What are low level languages?

A

They sit close to the computer’s instruction set

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

What are the two types of low level language?

A

Machine Code

Assembly Language

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

What is machine code?

A

Instructions that a process understands and can act upon

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

What are the advantages of writing in machine code?

A

More flexibility

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

What are the disadvantages of writing in machine code?

A

Very difficult to write in, understand and debug (consisting of binary and hexadecimal)

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

When programmers need direct control of machine code, what is used?

A

Another low level language – assembly language

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

What does assembly language use?

A

Mnemonics, for example:

LDA – load a value from a memory address
STA – store a value in a memory address
ADD – adds the value held in a memory address to the value held in the accumulator
SUB – subtracts from the accumulators the value held in a memory address
MOV – moves the contents of one memory address to another

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

What is Opcode and Operand?

A

Opcode – actual instructions

Operand – this is a value that the instruction uses or manipulates

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

What are translators?

A

A program that converts source code (high level language written program) into object code (a form the computer understand)

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

What are the three types of translator?

A

Compilers

Interpreters

Assemblers

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

What is a compiler?

A

A compiler takes the source code as a whole and translates it into object code, in one go

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

What is an interpreter?

A

An interpreter translates source code into object code one instruction at a time

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

What is an assembler?

A

An assembler translates assembly language into object code

18
Q

What is an IDE?

A

Tools which are gathered together to help write programs

19
Q

What is the Python IDE?

A

IDLE

20
Q

What are editors?

A

Editors are software which allow programmers to write and edit code. Editors are often fairly simple, but usually offer facilities such as:

Automatic line numbering
Colour coding
Auto-correct
Auto-suggest
Auto-indent
21
Q

What do editors help with (and are unable to help with)?

A

Editors help the readability of code

They are unable to help identify errors

22
Q

What is a runtime environment?

A

A runtime environment (RTE) is special software that allows a program to run on a computer, even if it is not designed to run on it

23
Q

What debugging tools exist to locate and fix errors?

A

Breakpoints (pause / stop code to check)

Variable tracing (identify changing variable values)

Syntax error pinpoint (error trapping)

24
Q

What is the purpose of defensive design?

A

To ensure that a program runs correctly and continues to run no matter what actions a user takes

25
Q

List some defensive design considerations

A

Protection against unexpected user inputs or actions, such as a user entering a letter where a number was expected

Maintainability - ensuring code is readable and understandable

Minimising / removing bugs

26
Q

What is validation?

Give some examples

A

Validation applies rules to inputted data, rejecting it if it doesn’t follow the rules

E.g. range check, length check, presence check, format check, type check etc…

27
Q

What is data sanitisation?

A

Hide / protect data so it cannot be seen or disclosed

E.g. masking hides visible data (password entry becomes *****)

28
Q

What is authentication?

A

Authentication is the process of a user confirming that they are who they say they are on a computer system

29
Q

What are the three authentication groups?

A

Something you are - username, bank account number, or anything that identifies the user uniquely

Something you know - password, pin, secret answer to a question

Something you have - swipe card, biometrics, any other physical identifying device

30
Q

What is the purpose of maintainability?

A

To ensure that, over time, a program can be maintained

31
Q

List how a program can be written in a maintainable style

A

Comments

Sensible variable names

Indentation

32
Q

What are the two types of programming error?

A

Syntax error

Logic error

33
Q

What is a syntax error?

Give some examples

A

A syntax error occurs when code written does not follow the rules of the programming language.

Misspelling a statement, e.g. writing pint instead of print
Using a variable before it has been declared
Missing brackets, e.g. opening a bracket but not closing it

34
Q

What is a logic error?

A

A logic error is an error in the way a program works. The program simply does not do what it is expected to do (usually the program continues to run).

35
Q

Give some examples of a logic error

A

Incorrectly using logical operators, e.g. expecting a program to stop when the value of a variable reaches 5, but using <5 instead of <=5

Incorrectly using Boolean operators

Unintentionally creating a situation where an infinite loop may occur

Incorrectly using brackets in calculations

Unintentionally using the same variable name at different points in the program for different purposes

Referring to an element in an array that falls outside of the scope of the array

36
Q

What is the difference between iterative testing and final (terminal) testing?

A

Iterative testing – carried out why a program is being being developed

Final (terminal) testing – carried out when all modules are complete and the program is tested as a whole

37
Q

What should test data include?

A

Valid data - sensible, possible data that the program should accept and be able to process

Extreme data - valid data that falls at the boundary of any possible ranges

Invalid (erroneous) data - data that the program cannot process and should not accept

38
Q

What should a good testing plan include?

A

The test number

A description of what the test intends to check

The test data being used

The type of test (valid, extreme or invalid)

Expected outcome

Actual outcome

39
Q

What is a trace table? Complete one for the following code (adding the integers 5, 7 and 9 to make 21)

A

Trace tables contain all the variable a program contains (and when their value changes, the table indicates this)

40
Q

What can potentially happen if programs aren’t tested fully?

A

Bugs