Dry Run
- Tracing code manually is a dry run
- Dry run needs practice to overcome mistakes in tracing codes.
Common Mistakes:
- Skipping lines or incomplete tracing
- Do not open down variable value updates
- Not tracing the code but tracing what is in your mind
- Reading mistakes
- Conceptual mistakes.
Dry run is a static test and should be performed by the programmer to mitigate the effects of a failure of the code - meaning before the end user gets the output and discovers it doesn't do what it says it will. In dry run, no hardware is used, but it is assumed that the programmer who is testing the code is aware of what each line of code is supposed to do and gives him or her the opportunity to make corrections to the code before it becomes an issue for the actual output. Basically, a dry run test consists of programmers manually reading their code line by line to find errors and fix them
Code Example
#includeint main(){
int m,n,k=0;
for(m=1;m<=3;m++){
for(n=m;n<=4;n++){
k = m+n+k;
printf("m = %d n = %d k = %d \n",m,n,k);
}
printf("\n");
printf("m = %d n = %d k = %d \n",m,n,k);
}
return 0;
}
