next up previous contents index
Next: Reviewing Up: Correctness and Performance Previous: Testing   Contents   Index

Profiling

The line profiling8.1 tool that we already mentioned above can be used to check the coverage of the program with some query. We can easily find lines that are not executed at all, indicating the need for another test case. If we cannot construct a test which executes a program segment, then this indicates some problem.

We can use the same profile to find program parts which are executed very often and this can provide hints for optimization. Normally it is better not just to concentrate on those parts that are called very often, but on those which are calling these predicates.

Figure 8.1: Profiling Example
\begin{figure}
\psfig{figure=profile.eps,width=13.7cm}\end{figure}

Figure 8.1 shows the output of the profiling tool. Each line is marked with the number of times it is executed (the first number in green) and the number of times we backtrack over this line (the second number in red). In this example shown there are two parts of if-then-else predicates which have not been selected by the test example.


next up previous contents index
Next: Reviewing Up: Correctness and Performance Previous: Testing   Contents   Index
Warwick Harvey
2004-08-07