Chapter 48 - Thinking Ahead Flashcards

1
Q

What does thinking ahead lets us establish? all of them

A

Things necessary before starting development of software.

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

What is an input?

A

information relevant and necessary for the problem to be solved.

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

What is an output?

A

Solution/results to the problem

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

What are the benefits of identifying inputs?

A

We can see where the information is coming from, the format it is in, how we can get it where we need it and how to use it for the most optimal solution.

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

What are the benefits of identifying outputs?

A

We are able to determine processing stages required to transform inputs into what we want.

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

What are the possible inputs to a touchscreen navigation system?

A

Coordinates
Destination
Settings
location (GPS does it automatically)

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

What are the possible outputs of a touchscreen navigation system?

A

Map
Directions
Audio
Time and route estimates

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

What does thinking ahead involve?

A

Identifying inputs
Identifying outputs
Caching
Identifying reusable program components

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

What is the concept of caching in thinking ahead?

A

Using it in order to speed up retrieval of information, it prepares data before it is needed

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

What is a precondition?

A

A condition that must be true or correct prior to execution of program/procedure/subprocedure

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

Why are preconditions added?

A

To ensure values are initialised correctly, so that program operation is correct and solution operates as expected

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

What are the advantages of having preconditions?

A
  • The programmer/tester knows what checks must be made before a routine is entered where those conditions are used
  • Helps to make code more reusable, so less coding required
  • Easier to debug and maintain program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a program library?

A

series of predefined and compiled routines that are available for use in programs

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

Why do programmers and companies often use program libraries?

A

As it is impractical to start everything from scratch. Code will be simpler,easier and quicker to produce,easier to maintain,easier to read and understand.

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

Give some examples of program libraries

A
Windows DLL (dynamic link library) 
Python import modules 
C Library - using #include
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What should we think about when developing a routine in a program?

A

Whether it can be reused in the same program or be useful in future ones.

17
Q

What is cache memory?

A

High performance memory that stores frequently used data and information.

18
Q

What does implementing cache memory mean?

A

The rate of execution of programs is very quick. Also it is done automatically by OS.

19
Q

What are the benefits of having cache memory?

A
  • Speeds up program execution and throughput
  • Reduces load on server or memory
  • Increase in performance of processing data (especially effective in a server as it is less reliant on reliable connection)
20
Q

Why is caching in this topic?

A

It is a prime example of how thinking ahead is implemented into computer science,as data is ready prior to when it is needed.

21
Q

What can be used with cache memory. What is this process and how does work?

A

Prefetching , when CPU requests data to be placed in cache before it is necessary

22
Q

What is a downside of prefetching?

A

It requires very complex algorithms that determine the likelihood of data to be used in the near future.

23
Q

What is an upside to prefetching?

A

Data in cache is more likely to be useful and rate of program execution therefore increases.

24
Q

What are the drawbacks of cache memory?

A
  • Increases maintenance costs if applicable

- Expensive, increases development costs

25
Q

In programming what are often the preconditions?

A

The parameters and variables