Dry run (testing)

The test writing is a procedure used in the field of software development to check algorithms or routines for correctness. The test writing is not performed by a computer but rather in the header of the developer. For this purpose, an input and a possible output quantity can be defined for a deterministic and terminating program execution. Then, with each element of the input set by stepping through computing the correctness of the program sequence verified. The selected program flow behaves for the selected input element exactly correct if the output element, so the result is part of the issue amount.

The fact that the input amount of an algorithm can be any size, such as a sub- set of natural numbers, requires the developer to verify the correctness of the test program, the steps of tracing all the elements of the input quantity. If there are no upper or lower bound on the amount of input, then the desk test can at most with some plausible inputs provide an indication that the algorithm was implemented correctly.

Requirements for the desktop test are therefore a deterministic and arbitrary terminating program run, the knowledge of plausible and meaningful input elements, and the knowledge of matching the input elements output elements in order to close out each issue on its correctness. The results for the corresponding input must therefore be known.

Example: power

For the following Pascal function a desk test is to be carried out:

1 function nHochM (n, m: integer); 2 var i: integer; 3 var product: integer; 4 begin 5 if m = 0 then nHochM: = 1 else 6 if m = 1 then nHochM: = n else 7 begin 8 product: = n; 9 for i: = 2 to m do 10 product: = product * n; 11 nHochM: = product; 12 end; 13 end; Calculation of 23:

  • Software Engineering
716753
de