2.1.2 Thinking Ahead Flashcards
1
Q
What is the purpose of thinking ahead?
A
- Allows developers to consider problems/difficulties that may arise when software is used
- Makes programs easy and intuitive to use
1
Q
What are inputs?
A
- Any data that is required to solve a problem, often entered into a system by a user
- What the system needs to process
2
Q
What are outputs?
A
- The results that are passed back once the inputs have been processed and the problem solved
- What the system should produce
3
Q
Give examples of inputs
A
- Keyboard
- Mouse
- Microphone
4
Q
Give examples of outputs
A
- Speaker
- Printer
- Monitor
5
Q
What considerations do programmers need to make about inputs and outputs when thinking ahead?
A
- Data structure used
- Data types used
- Order of data
6
Q
What are pre-conditions?
A
- Conditions that already exist which may affect how you devise a solution to a problem
- Requirements which must be met before a program can be executed
7
Q
Where can preconditions be defined?
A
- Within the code or within documentation
8
Q
State three advantages of including preconditions within the documentation accompanying a sub-routine
A
- Reduces the length and complexity of the program
- Saves time to debug and maintain a longer program
- Makes subroutines more reusable
9
Q
What is caching?
A
- The process of storing instructions or values into cache memory after they have been used as they may need to be used again
- Instructions/programs retrieved from secondary storage and placed into RAM remain there in case they are needed again before the program using them ends
10
Q
How is caching used in storing web pages?
A
- The web pages a user frequently accesses will be cached so the next time it is accessed, content can be loaded without delay
- Reduces the requests from the client to the web server and vice versa
11
Q
What are the advantages of caching web pages?
A
- Content can be loaded without delay
- Images and texts do not have be downloaded multiple times
- Frees bandwidth for other tasks on a network
- Less time is spent waiting
12
Q
What is prefetching?
A
- Involves data being requested from RAM by the processor before it is actually required
13
Q
Give limitations of caching
A
- Accuracy of algorithms used in prefetching/wrong data is often fetched and cached which then has to be removed
- Maintaining correct sequence of data is problematic
- Predictive logic - caching algorithms are complicated to implement
14
Q
State some advantages of using reusable program components
A
- Shortens development time
- Saves systems resources
- Lowers development costs
- Reduces redundant code