Problem solving and programming Flashcards

1
Q

Alpha testing

A

Testing within the development company //
testing by the developers
Testing it in the way the end user would
Used when the program is complete
Used when white box/black box/system etc.
testing is complete
Takes place before Beta testing

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

Advantages of global variables

A

Simpler to program …
… because values do not need to be
passed/renamed/moved between different
subroutines
Do not need to worry about returning values //
do not need to decide between byval/byref …
… all parts of the program can access the
(same) value (in the same way)

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

Disadvantages of global variables

A

Uses more memory …
… because the memory space is declared when the program starts and remains in use throughout
Makes testing / debugging more difficult …
…. as it’s difficult to test an individual block of code
Reduces data accuracy / integrity …
…. changing a global variable may have an impact on another module

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

IDE for debugging

A

-Debugging tools allow inspection of variable values (1 – AO 1.1) this can allow run-time detection of errors (1 – AO 1.2).
-Code can be examined as it is running (1 – AO 1.1) which allows logical errors to be pinpointed (1 – AO 1.2).
-IDE debugging can produce a crash dump (1 – AO 1.1), which shows the state of variables at the point where an error occurs (1 – AO 1.2).
-It can display stack contents (1 – AO 1.1) which show the sequencing through procedures / modules (1 – AO 1.2).
-It can step through code (1 – AO 1.1), which allows the programmer to watch the effects each line of code (1 – AO 1.2).
-The insertion of a break-point (1 – AO 1.1) allows the program to be stopped at a predetermined point in order to inspect its state (1 – AO 1.2).

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

What is a function

A

-A function is a named section of program (1) that performs a specific task (1).
-It returns a value (1), it is often called inline (1).

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

What is recursion

A

The function calls itself from within the function

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

Recursion > iteration

A

-More natural to read (1)
-Quicker to write / less lines of code, (1) as some functions are naturally recursive (1)
-Suited to certain problems (1), for example those using trees (1)
-Can reduce the size of a problem with each call (1)

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

Recursion < iteration

A

-Can run out of stack space / memory (1) (due to too many calls (1)) causing it to crash (1) This can be avoided with tail recursion (1)
-More difficult to trace / follow (1) as each frame on the stack has its own set of variables (1)
-Requires more memory than the equivalent iterative algorithm.
-Usually slower than iterative methods (1) due to maintenance of the stack (1)

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