0% found this document useful (0 votes)
61 views8 pages

Desk Checking: Troubleshooting Techniques

Desk checking is a manual technique for checking the logic of an algorithm by having a person follow the steps and record the results. The desk checker creates a table with columns for line numbers, variables, conditions, and input/output to carefully execute each line of the pseudocode. This allows them to verify that the algorithm's logic and variable values progress as intended. In contrast, a test plan focuses on validating that the program outputs are correct for different inputs without worrying about internal workings. Examples demonstrate how desk checking can expose issues by stepping through sequences and selections in an algorithm.

Uploaded by

Judith Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views8 pages

Desk Checking: Troubleshooting Techniques

Desk checking is a manual technique for checking the logic of an algorithm by having a person follow the steps and record the results. The desk checker creates a table with columns for line numbers, variables, conditions, and input/output to carefully execute each line of the pseudocode. This allows them to verify that the algorithm's logic and variable values progress as intended. In contrast, a test plan focuses on validating that the program outputs are correct for different inputs without worrying about internal workings. Examples demonstrate how desk checking can expose issues by stepping through sequences and selections in an algorithm.

Uploaded by

Judith Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

DESK CHECKING

Troubleshooting Techniques
DESK CHECKING

• Desk checking is a manual (non computerised) technique for checking the


logic of an algorithm.
• The person performing the desk check effectively acts as the computer, using
pen and paper to record results.
• The desk checker carefully follows the algorithm being careful to rigidly
adhere to the logic specified. The desk check can expose problems with the
algorithm..
DESK CHECK LAYOUT

• A desk check is normally done as a table with columns for:


1. Pseudo code line number column (Pseudo code doesn't normally have lines numbers, but these are
necessary in a desk check to specify the line(s) being executed)
2. One column per variable used. The columns should be in alphabetical order on variable name with
the variable name at the top of the column. As the algorithm is executed, the new values of the
variables are put in the appropriate column. Show working for calculations. If variable names consist
of a number of words it is permissible to put a space between each word in the name so that the name
fits better in the column by wrapping to the next line. e.g. the variable column heading discount
Price could be used rather than the actual variable name discountPrice.
3. A condition column. The result of the condition will be true (T) or false (F). As the algorithm is
executed, conditions are evaluated and the details are recorded in the column. Show working when
evaluating the conditions. This is used whenever a condition is evaluated - IF WHILE or FOR
statements all have explicit or implicit conditions.
4. An Input/Output column is used to show what is input by the user and displayed by the program.
Show inputs with: the variable name, a "?" and the value input e.g. price ? 200. Show outputs with the
variable name, an =, and the value displayed (or just the value displayed) e.g. discountPrice= 180 .
DESK CHECKS VS TEST PLANS

• A Desk Check concentrates on the value of variables and the logic i.e. what is
the value of variable x after statement n; what is the next statement to be
executed? A Test Plan focuses on the values of inputs and outputs required to
test a program without concern for the internal workings i.e. are the results
(outputs) correct for the inputs?.
EXAMPLE 1
PROBLEM DESCRIPTION:
C A L C U L AT E T H E D I S C O U N T E D
PRICE OF AN ITEM PURCHASED.

• The following example


shows desk checking
involving sequence, executin
g instructions one after the
other.
• Sequence involves executing
all instructions once, from
top to bottom, one after the
other
DESK CHECK
T E S T D ATA
INPUTS: PRICE = £200, DISCOUNTPERCENT = 10%.
C O R R E C T R E S U LT S : D I S C O U N T = £ 2 0 , D I S C O U N T P R I C E = £ 1 8 0 .

Line Number discount discount Percent discount Price price Input/Output


1          
2   10   200 price ? 200;
discountPercent ? 10

3 200 * 10 / 100 = 20        
4     200 - 20 = 180    
5         discountPrice = 180

6          
EXAMPLE 2
PROBLEM DESCRIPTION:
C A L C U L AT E T H E D I S C O U N T E D
PRICE OF AN ITEM PURCHASED.
CUSTOMERS RECEIVE A
DISCOUNT OF 15% ON AN ITEM
IF THE PURCHASE PRICE OF THE
ITEM IS OVER £00.
.

The following example shows desk


checking involving selection using
an IF.
For an IF without an ELSE, if the
condition evaluates to True then
execution continues to the next
line and the lines between the IF
and ENDIF are executed
(inclusive), otherwise (the
condition is False) execution jumps
from the IF to the ENDIF.
DESK CHECK
T E S T D ATA
INPUTS: PRICE = $200
C O R R E C T R E S U LT S : P R I C E = $ 1 7 0 .

Line Number discount price Conditions Input/Output


1        
2   200   price ? 200
3     200 > 100 ? is T  
4 200 * 15 / 100 = 30      
5   200 - 30 = 170    
6        
7       price = 170
8        

You might also like