OCR A Level Computer Science Paper Q & And Study
Guide
Benefits of modularization
Large problems are broken down into smaller problems which are easier to manage
Each subroutine (module) can be easily tested
Modules can be reused several times in a program
Frequently used modules can be saved in a library and used by other programs
Lots of programmers can work on different modules at the same time saving time
It is easier to find errors taking less time to debug
Programs are easier to maintain
Track progress
Abstraction
a way of separating logical and physical parts of a problem e.g. the London underground map. You get
rid of unnecessary details
,Problem abstraction
where you keep removing details until the problem reduces to one that has already been solved
Modeling and Simulation
Building a model of a real world object can be used to solve a particular problem such as Aircraft
simulation, Climate change models
Precondition
is the logic part of a statement that has to be true for the processing part of the algorithm before it can
function
Specifying a precondition before creating an algorithm ensures
The data is ok to process e.g. if it was empty it could cause the program to crash.
The function is reusable
It reduces unnecessary checks
It makes programs easier to debug and maintain
It makes programs clearer and shorter
Programming standards that make programs easy to re-use include
Documenting inputs, outputs and preconditions
Variables should use camelCase or PascalCase
, All variables should be local to that module
The documentation should contain information such as who made it, what it does and when it was
written.
The code should be annotated where necessary
The module should not be greater than one page of code
Caching
the temporary storage of data instructions so that the information can be achieved quicker than
performing a calculation e.g. frequently accessed web pages can be stored locally
The advantages pf caching
It's faster to access information that is cached
This saves the cost of bandwidth
It also reduces the load on web services in a client-server environment
Disadvantages of caching
There is slower performance if the result is not found in the cache
Sometimes the cache can be "stale" meaning that it doesn't contain the latest updated data. E.g. When
using a cached database on available products you might think an item is still available when it is
actually not
Decomposition
Guide
Benefits of modularization
Large problems are broken down into smaller problems which are easier to manage
Each subroutine (module) can be easily tested
Modules can be reused several times in a program
Frequently used modules can be saved in a library and used by other programs
Lots of programmers can work on different modules at the same time saving time
It is easier to find errors taking less time to debug
Programs are easier to maintain
Track progress
Abstraction
a way of separating logical and physical parts of a problem e.g. the London underground map. You get
rid of unnecessary details
,Problem abstraction
where you keep removing details until the problem reduces to one that has already been solved
Modeling and Simulation
Building a model of a real world object can be used to solve a particular problem such as Aircraft
simulation, Climate change models
Precondition
is the logic part of a statement that has to be true for the processing part of the algorithm before it can
function
Specifying a precondition before creating an algorithm ensures
The data is ok to process e.g. if it was empty it could cause the program to crash.
The function is reusable
It reduces unnecessary checks
It makes programs easier to debug and maintain
It makes programs clearer and shorter
Programming standards that make programs easy to re-use include
Documenting inputs, outputs and preconditions
Variables should use camelCase or PascalCase
, All variables should be local to that module
The documentation should contain information such as who made it, what it does and when it was
written.
The code should be annotated where necessary
The module should not be greater than one page of code
Caching
the temporary storage of data instructions so that the information can be achieved quicker than
performing a calculation e.g. frequently accessed web pages can be stored locally
The advantages pf caching
It's faster to access information that is cached
This saves the cost of bandwidth
It also reduces the load on web services in a client-server environment
Disadvantages of caching
There is slower performance if the result is not found in the cache
Sometimes the cache can be "stale" meaning that it doesn't contain the latest updated data. E.g. When
using a cached database on available products you might think an item is still available when it is
actually not
Decomposition