2.1.2 Thinking Ahead Flashcards
What are preconditions?
Requirements which must be met before a program can be executed
What are inputs?
Data required to solve a problem
Entered by user
What are outputs?
Results that are passed back
Produced after inputs have been processed
What are reusable program components?
Commonly used functions can be packaged into libraries for reuse
State the three types of reusable components.
Abstract data structures
Classes
Subroutines
State 2 advantages of using reusable program components.
More reliable as already tested
Save time, money & resources
What disadvantage do reusable program components have?
May need to be modified to be compatible with existing software
Can be more costly and time-consuming than developing from scratch
What is caching?
Storing instructions or values in cache memory after use for possible future use
Give 2 advantages of caching.
Save time retrieving instructions from secondary storage
Frees up bandwidth for other tasks on network
What is prefetching?
Algorithms predict which instructions are likely to soon be fetched
Instructions loaded & stored in cache
What is the advantage of using prefetching?
Less time waiting for instructions to be fetched
Give 2 disadvantages of prefetching.
Difficult to implement well
Effectiveness depends on caching algorithm’s ability to manage cache