Fitness for Purpose
Once a software project has been completed, it should be evaluated to assess whether or not it solves the problem that its supposed to solve.
Software is said to be fit for purpose if it fulfils the requirement which were identified at the analysis stage.
Efficient Code
A program is efficient if the length of its code or speed of execution is proportional to the scale of the program.
Use of Loops
The use of repetition can improve the efficiency by repeating instructions in a loop rather than using a sequence of individual instructions.
Arrays
Using arrays for a list of related data is much more efficient than using separate variables. Using an array allows the elements to be processed in a loop rather than having repeated code to process each separate variable.
Nested If’s
Using nested IF’s instead of multiply IF’s produces more efficient code since less execution of instruction is required.
What do we mean by efficiency?
The term efficiency is usually used to refer to the demands that code places on RAM or the processor. Only using RAM and the processor when necessary leads to efficient use of system resources.
However, at National 5 level it is also important to take account of how long it takes to create code. Sometimes it may be possible to make more efficient use of programmer time without impacting on efficiency as it relates to RAM or the processor.
Robustness
A program is robust if it can cope with unexpected inputs or mishaps without crashing
If a program is expecting a number to be entered and the user enters a piece of text, then the program should give an error message and request the user to re-enter the numbers, and should not simply crash
Readability
Means how easy is it for somebody else to understand your code.
Readability of your program can be improved by:
- Using meaningful variable, array and function names
- Using indentation properly especially with loops and if structures
- Using white space (blank lines) to divide up sections of code
- Including helpful internal commentary These lines of code are ignored by Python but help to explain to humans reading the code what is being done.