Before a process can be controlled it has first to be measured. This chapter will introduce techniques which can be used to make a numerical measurement of some attributes of individual algorithms. The measurements which can be made are collectively referred to as software metrics and can be divided into two major classes, static metrics and dynamic metrics . Static metrics refer to the measurements which can be made with only the source code, design or specification available.
Dynamic metrics are measurements which can only be made on the software as it is executing.
The first topic which will be explored in this chapter is a static analysis of algorithms which attempts to predict dynamic behaviour. In particular this measure attempts to predict the effects of increasing the size of the data set which the algorithm will process. The searching and sorting algorithms which were introduced in previous chapters will be analysed with a view to predicting their behaviour as the size of the list to be searched or sorted increases. This measurable attribute of an algorithm is known as the order of an algorithm . Subsequently a number of simple practical dynamic measurements will be introduced, the results of which can be used to attempt to validate the predictions made regarding the order of sorting and searching algorithms.