SlideShare a Scribd company logo
1 of 10
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
SOFTWARE VERIFICATION AND VALIDATION
LAB 06
PERFORMING A FORMAL REVIEW WITH DESK CHECKING
Desk Checking
Desk Checking is one of the older practices of human error-detection process. A desk check
can be viewed as a one-person inspection or walkthrough: A person reads a program, checks
it with respect to an error list, and/or walks test data through it.
Desk checking involves first running a spellchecker, grammar checker, syntax checker, or
whatever tools are available to clean up the cosmetic appearance of the document. Then, the
author slowly reviews the document trying to look for inconsistencies, incompleteness, and
missing information. Problems detected in the contents should be corrected directly by the
author with the possible advice of the project manager and other experts on the project.
Once all corrections are made, the cosmetic testing is rerun to catch and correct all spelling,
grammar, and punctuation errors introduced by the content corrections.
Desk checking is a manual (non computerized) 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 checks are useful to check an algorithm (before coding) thereby confirming that the
algorithm works as expected and saves time possibly writing a program that doesn't do what
was intended. Another benefit of a desk check is that it confirms to the programmer/designer
that the algorithm performs as intended.
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.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
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.
Normally portrait page layout would be used for the desk check, however if the table is too
wide, landscape layout may be used.
Example 1
Problem Description: Calculate the discounted price of an item purchased. (Note: a problem
description is not normally specified in a desk check, it is only included to assist in
understanding the problem.)The following example shows desk checking involving sequence,
executing instructions one after the other.Sequence involves executing all instructions once,
from top to bottom, one after the other.
Algorithm (with line numbers added for the Desk Check)
1 calcDiscountPrice()
2 Input price, discountPercent
3 discount = price * discountPercent / 100
4 discountPrice = price - discount
5 Display discountPrice
6 STOP
Desk Check
Test Data
Inputs: price = $200, discountPercent = 10%.
Correct results: discount = $20, discountPrice = $180.
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
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Example 2
Problem Description: Calculate the discounted price of an item purchased.
Customers receive a discount of 15% on an item if the purchase price of the item is
over $100.
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.
Algorithm (with line numbers added for the Desk Check)
1 calcPrice()
2 Input price
3 IF price > 100 THEN
4 discount = price * 15 / 100
5 price = price - discount
6 ENDIF
7 Display price
8 STOP
Desk Check
Inputs: price = $200
Correct results: price = $170.
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
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Inputs: price = $50
Correct results: price = $50.
Line Number discount price Conditions Input/Output
1
2 50 price ? 50
3 50 > 100 ? is F
6
7 price = 50
8
Example 3
Problem Description: Calculate the cost of electricity based on the electricity used.The
following example shows desk checking involving selection using a linear nested IF-ELSEs.
Algorithm (with line numbers added for the Desk Check)
1 calcElectrictyCost()
2 Input electricityUsed
3 IF electricityUsed < 1000 THEN
4 cost = 100
5 usageLevel = "Low"
6 ELSE
7 IF electricityUsed < 5000 THEN
8 cost = 100 + (electricityUsed - 1000) * 0.1
9 usageLevel = "Moderate"
10 ELSE
11 cost = 500 + (electricityUsed - 5000) * 0.08
12 usageLevel = "High"
13 ENDIF
14 ENDIF
15 Display cost, usageLevel
16 STOP
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Desk Check
Inputs: electricityUsed = 500,
Correct results: cost = 100, usageLevel = "Low".
Line
Number
cost
electricity
Used
usage
Level
Conditions Input/ Output
1
2 500 electricityUsed ? 500
3 500 < 1000 ? is T
4 100
5 Low
14
15
cost = 100, usageLevel =
"Low"
16
Inputs: electricityUsed = 3000,
Correct results: cost = 300, usageLevel = "Moderate".
Line
Number
Cost
electricity
Used
usage
Level
Conditions Input/ Output
1
2 3000 electricityUsed ? 3000
3
3000 < 1000
? is F
6
7
3000 < 5000
? is T
8
100 + (3000-
1000) * 0.1 =
300
9 Moderate
13
14
15
cost = 300, usageLevel
= "Moderate"
16
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Inputs: electricityUsed = 15000,
Correct results: cost = 1300, usageLevel = "High".
Line
Number
Cost
electricity
Used
usage
Level
Conditions Input/ Output
1
2 15000
electricityUsed ?
15000
3
15000 < 1000
? is F
6
7
15000 < 5000
? is F
10
11
500 + (15000-
5000) * 0.08 =
1300
12 High
13
14
15
cost = 1300,
usageLevel = "High"
16
Example 4
Problem Description: Display a table of values of x and x squared. X is to start at 1 and
increase by 1 up to 3.
The following example shows desk checking involving iteration (repetition) using a FOR loop.
The counter variable is initialized once at the top of the loop, the first time through the loop.
The implied condition is evaluated at the top of the loop, with execution going to the next
line if the condition is True and going to the line after the ENDFOR if the condition is False. In
this case the implied condition is x <= 3 ?. On the ENDFOR line t he counter variable is
incremented by 1, then program execution loops from the ENDFOR line, back to the FOR
line.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Algorithm (with line numbers added for the Desk Check)
1 calcSquares()
2 Display "X", "X Squared"
3 FOR x = 1 TO 3 DO
4 xSquared = x * x
5 Display x, xSquared
6 ENDFOR
7 Display "-----------"
8 STOP
Desk Check
Test Data
Input: None
Correct results: x = 1, xSquared = 1; x = 2, xSquared = 4; x = 3, xSquared = 9.
Line Number X xSquared Conditions Input/ Output
1
2 X, X Squared
3 1 1 <= 3 ? is T
4 1 * 1 = 1
5 x = 1, xSquared = 1
6 1 + 1 = 2
3 2 <= 3 ? is T
4 2 * 2 = 4
5 x = 2, xSquared = 4
6 2 + 1 = 3
3 3 <= 3 ? is T
4 3 * 3 = 9
5 x = 3, xSquared = 9
6 3 + 1 = 4
3 4 <= 3? is F
7 -----------
8
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Lab tasks
****************************************************************
Lab Task 1
Problem Description: Display whether a student passed or failed a subject depending on their
mark.
Algorithm (with line numbers added for the Desk Check)
1 displayGrade()
2 Input mark
3 IF mark >= 50 THEN
4 grade = "Pass"
5 Display "Well done"
6 ELSE
7 grade = "Not pass"
8 ENDIF
9 Display grade
10 STOP
Perform Desk Check for the following sets of conditions
a. Inputs: mark = 75
Correct results: grade = "Pass", "Well done"
b. Inputs: mark = 40
Correct results: grade = "Not pass"
****************************************************************
Lab Task 2
Problem Description: Calculate the cost of water based on the water used and whether the
customer is a Domestic or Commercial user.
The following task shows desk checking involving selection using a non-linear nested IF-
ELSEs.ss
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Algorithm (with line numbers added for the Desk Check)
1 calcWaterCost()
2 Input waterUsed
3 IF waterUsed < 100 THEN
4 cost = 50
5 ELSE
6 Input customerType
7 IF customerType = "D" THEN
8 cost = waterUsed * 0.5
9 ELSE
10 cost = waterUsed * 0.6
11 Display "Commercial rate"
12 ENDIF
13 Display "High usage"
14 ENDIF
15 Display cost
16 STOP
Perform Desk Check for the following sets of conditions
a. Inputs: waterUsed = 70, customerType (not required)
Correct results: cost = 50
b. Inputs: waterUsed = 200, customerType = D
Correct results: cost = 100
c. Inputs: waterUsed = 200, customerType = C
Correct results: cost = 120
****************************************************************
Lab Task 3
Problem Description: Total a series of number input by the user. Allow the user to continue
inputting numbers until a negative number is input, then display the total of the numbers
input.
The following task shows desk checking involving iteration (repetition) using a WHILE loop.
The condition is evaluated at the top of the loop, with execution going to the next line if the
condition is True and going to the line after the ENDWHILE if the condition is False. Program
execution loops from the ENDWHILE line, back to the WHILE line.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Software verification and Validation 5th Term-SE UET Taxila
Algorithm (with line numbers added for the Desk Check)
1 totalNumbers()
2 total = 0
3 Input number
4 WHILE number >= 0 DO
5 total = total + number
6 Input number
7 ENDWHILE
8 Display total
9 STOP
Perform Desk Check for the following sets of conditions
Inputs: numbers = 10, 6, -1.
Correct results: total = 16
****************************************************************

More Related Content

What's hot

Report Group 4 Constants and Variables
Report Group 4 Constants and VariablesReport Group 4 Constants and Variables
Report Group 4 Constants and VariablesGenard Briane Ancero
 
CIS 1403 lab 4 selection
CIS 1403 lab 4 selectionCIS 1403 lab 4 selection
CIS 1403 lab 4 selectionHamad Odhabi
 
Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007simply_coool
 
e computer notes - Writing basic sql select statements
e computer notes - Writing basic sql select statementse computer notes - Writing basic sql select statements
e computer notes - Writing basic sql select statementsecomputernotes
 
Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Digvijaysinh Gohil
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structuresPradipta Mishra
 
Decision Table Based Testing
Decision Table Based TestingDecision Table Based Testing
Decision Table Based TestingHimani Solanki
 
MSc COMPUTER APPLICATION
MSc COMPUTER APPLICATIONMSc COMPUTER APPLICATION
MSc COMPUTER APPLICATIONMugdhaSharma11
 
Introduction to basic programming repetition
Introduction to basic programming repetitionIntroduction to basic programming repetition
Introduction to basic programming repetitionJordan Delacruz
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniquesfika sweety
 

What's hot (20)

Report Group 4 Constants and Variables
Report Group 4 Constants and VariablesReport Group 4 Constants and Variables
Report Group 4 Constants and Variables
 
Pseudocode By ZAK
Pseudocode By ZAKPseudocode By ZAK
Pseudocode By ZAK
 
COM1407: C Operators
COM1407: C OperatorsCOM1407: C Operators
COM1407: C Operators
 
Csc240 -lecture_5
Csc240  -lecture_5Csc240  -lecture_5
Csc240 -lecture_5
 
CIS 1403 lab 4 selection
CIS 1403 lab 4 selectionCIS 1403 lab 4 selection
CIS 1403 lab 4 selection
 
Flowcharts
FlowchartsFlowcharts
Flowcharts
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
 
Grade 5 Computer
Grade 5 ComputerGrade 5 Computer
Grade 5 Computer
 
Grade 6 Computer
Grade 6 Computer Grade 6 Computer
Grade 6 Computer
 
Basic Input and Output
Basic Input and OutputBasic Input and Output
Basic Input and Output
 
Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007
 
e computer notes - Writing basic sql select statements
e computer notes - Writing basic sql select statementse computer notes - Writing basic sql select statements
e computer notes - Writing basic sql select statements
 
Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
Decision Table Based Testing
Decision Table Based TestingDecision Table Based Testing
Decision Table Based Testing
 
MSc COMPUTER APPLICATION
MSc COMPUTER APPLICATIONMSc COMPUTER APPLICATION
MSc COMPUTER APPLICATION
 
Introduction to basic programming repetition
Introduction to basic programming repetitionIntroduction to basic programming repetition
Introduction to basic programming repetition
 
Error analysis
Error analysisError analysis
Error analysis
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniques
 
c-programming
c-programmingc-programming
c-programming
 

Similar to 06

Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine LearningStudent
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersSheila Sinclair
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchartlotlot
 
Ml2 train test-splits_validation_linear_regression
Ml2 train test-splits_validation_linear_regressionMl2 train test-splits_validation_linear_regression
Ml2 train test-splits_validation_linear_regressionankit_ppt
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Alpro
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Amairullah Khan Lodhi
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptxZohairMughal1
 
05 control structures 2
05 control structures 205 control structures 2
05 control structures 2Jomel Penalba
 
Android tutorials7 calulator_improve
Android tutorials7 calulator_improveAndroid tutorials7 calulator_improve
Android tutorials7 calulator_improveVlad Kolesnyk
 
The java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfThe java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfakaluza07
 
control statements of clangauge (ii unit)
control statements of clangauge (ii unit)control statements of clangauge (ii unit)
control statements of clangauge (ii unit)Prashant Sharma
 
Fitnesse Testing Framework
Fitnesse Testing Framework Fitnesse Testing Framework
Fitnesse Testing Framework Ajit Koti
 
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxYASHU40
 

Similar to 06 (20)

Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
Ch03
Ch03Ch03
Ch03
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
 
Ml2 train test-splits_validation_linear_regression
Ml2 train test-splits_validation_linear_regressionMl2 train test-splits_validation_linear_regression
Ml2 train test-splits_validation_linear_regression
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptx
 
05 control structures 2
05 control structures 205 control structures 2
05 control structures 2
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem Solving
 
Android tutorials7 calulator_improve
Android tutorials7 calulator_improveAndroid tutorials7 calulator_improve
Android tutorials7 calulator_improve
 
The java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfThe java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdf
 
control statements of clangauge (ii unit)
control statements of clangauge (ii unit)control statements of clangauge (ii unit)
control statements of clangauge (ii unit)
 
Fitnesse Testing Framework
Fitnesse Testing Framework Fitnesse Testing Framework
Fitnesse Testing Framework
 
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
 

Recently uploaded

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 

Recently uploaded (20)

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 

06

  • 1. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila SOFTWARE VERIFICATION AND VALIDATION LAB 06 PERFORMING A FORMAL REVIEW WITH DESK CHECKING Desk Checking Desk Checking is one of the older practices of human error-detection process. A desk check can be viewed as a one-person inspection or walkthrough: A person reads a program, checks it with respect to an error list, and/or walks test data through it. Desk checking involves first running a spellchecker, grammar checker, syntax checker, or whatever tools are available to clean up the cosmetic appearance of the document. Then, the author slowly reviews the document trying to look for inconsistencies, incompleteness, and missing information. Problems detected in the contents should be corrected directly by the author with the possible advice of the project manager and other experts on the project. Once all corrections are made, the cosmetic testing is rerun to catch and correct all spelling, grammar, and punctuation errors introduced by the content corrections. Desk checking is a manual (non computerized) 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 checks are useful to check an algorithm (before coding) thereby confirming that the algorithm works as expected and saves time possibly writing a program that doesn't do what was intended. Another benefit of a desk check is that it confirms to the programmer/designer that the algorithm performs as intended. 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.
  • 2. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila 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. Normally portrait page layout would be used for the desk check, however if the table is too wide, landscape layout may be used. Example 1 Problem Description: Calculate the discounted price of an item purchased. (Note: a problem description is not normally specified in a desk check, it is only included to assist in understanding the problem.)The following example shows desk checking involving sequence, executing instructions one after the other.Sequence involves executing all instructions once, from top to bottom, one after the other. Algorithm (with line numbers added for the Desk Check) 1 calcDiscountPrice() 2 Input price, discountPercent 3 discount = price * discountPercent / 100 4 discountPrice = price - discount 5 Display discountPrice 6 STOP Desk Check Test Data Inputs: price = $200, discountPercent = 10%. Correct results: discount = $20, discountPrice = $180. 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
  • 3. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Example 2 Problem Description: Calculate the discounted price of an item purchased. Customers receive a discount of 15% on an item if the purchase price of the item is over $100. 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. Algorithm (with line numbers added for the Desk Check) 1 calcPrice() 2 Input price 3 IF price > 100 THEN 4 discount = price * 15 / 100 5 price = price - discount 6 ENDIF 7 Display price 8 STOP Desk Check Inputs: price = $200 Correct results: price = $170. 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
  • 4. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Inputs: price = $50 Correct results: price = $50. Line Number discount price Conditions Input/Output 1 2 50 price ? 50 3 50 > 100 ? is F 6 7 price = 50 8 Example 3 Problem Description: Calculate the cost of electricity based on the electricity used.The following example shows desk checking involving selection using a linear nested IF-ELSEs. Algorithm (with line numbers added for the Desk Check) 1 calcElectrictyCost() 2 Input electricityUsed 3 IF electricityUsed < 1000 THEN 4 cost = 100 5 usageLevel = "Low" 6 ELSE 7 IF electricityUsed < 5000 THEN 8 cost = 100 + (electricityUsed - 1000) * 0.1 9 usageLevel = "Moderate" 10 ELSE 11 cost = 500 + (electricityUsed - 5000) * 0.08 12 usageLevel = "High" 13 ENDIF 14 ENDIF 15 Display cost, usageLevel 16 STOP
  • 5. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Desk Check Inputs: electricityUsed = 500, Correct results: cost = 100, usageLevel = "Low". Line Number cost electricity Used usage Level Conditions Input/ Output 1 2 500 electricityUsed ? 500 3 500 < 1000 ? is T 4 100 5 Low 14 15 cost = 100, usageLevel = "Low" 16 Inputs: electricityUsed = 3000, Correct results: cost = 300, usageLevel = "Moderate". Line Number Cost electricity Used usage Level Conditions Input/ Output 1 2 3000 electricityUsed ? 3000 3 3000 < 1000 ? is F 6 7 3000 < 5000 ? is T 8 100 + (3000- 1000) * 0.1 = 300 9 Moderate 13 14 15 cost = 300, usageLevel = "Moderate" 16
  • 6. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Inputs: electricityUsed = 15000, Correct results: cost = 1300, usageLevel = "High". Line Number Cost electricity Used usage Level Conditions Input/ Output 1 2 15000 electricityUsed ? 15000 3 15000 < 1000 ? is F 6 7 15000 < 5000 ? is F 10 11 500 + (15000- 5000) * 0.08 = 1300 12 High 13 14 15 cost = 1300, usageLevel = "High" 16 Example 4 Problem Description: Display a table of values of x and x squared. X is to start at 1 and increase by 1 up to 3. The following example shows desk checking involving iteration (repetition) using a FOR loop. The counter variable is initialized once at the top of the loop, the first time through the loop. The implied condition is evaluated at the top of the loop, with execution going to the next line if the condition is True and going to the line after the ENDFOR if the condition is False. In this case the implied condition is x <= 3 ?. On the ENDFOR line t he counter variable is incremented by 1, then program execution loops from the ENDFOR line, back to the FOR line.
  • 7. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Algorithm (with line numbers added for the Desk Check) 1 calcSquares() 2 Display "X", "X Squared" 3 FOR x = 1 TO 3 DO 4 xSquared = x * x 5 Display x, xSquared 6 ENDFOR 7 Display "-----------" 8 STOP Desk Check Test Data Input: None Correct results: x = 1, xSquared = 1; x = 2, xSquared = 4; x = 3, xSquared = 9. Line Number X xSquared Conditions Input/ Output 1 2 X, X Squared 3 1 1 <= 3 ? is T 4 1 * 1 = 1 5 x = 1, xSquared = 1 6 1 + 1 = 2 3 2 <= 3 ? is T 4 2 * 2 = 4 5 x = 2, xSquared = 4 6 2 + 1 = 3 3 3 <= 3 ? is T 4 3 * 3 = 9 5 x = 3, xSquared = 9 6 3 + 1 = 4 3 4 <= 3? is F 7 ----------- 8
  • 8. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Lab tasks **************************************************************** Lab Task 1 Problem Description: Display whether a student passed or failed a subject depending on their mark. Algorithm (with line numbers added for the Desk Check) 1 displayGrade() 2 Input mark 3 IF mark >= 50 THEN 4 grade = "Pass" 5 Display "Well done" 6 ELSE 7 grade = "Not pass" 8 ENDIF 9 Display grade 10 STOP Perform Desk Check for the following sets of conditions a. Inputs: mark = 75 Correct results: grade = "Pass", "Well done" b. Inputs: mark = 40 Correct results: grade = "Not pass" **************************************************************** Lab Task 2 Problem Description: Calculate the cost of water based on the water used and whether the customer is a Domestic or Commercial user. The following task shows desk checking involving selection using a non-linear nested IF- ELSEs.ss
  • 9. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Algorithm (with line numbers added for the Desk Check) 1 calcWaterCost() 2 Input waterUsed 3 IF waterUsed < 100 THEN 4 cost = 50 5 ELSE 6 Input customerType 7 IF customerType = "D" THEN 8 cost = waterUsed * 0.5 9 ELSE 10 cost = waterUsed * 0.6 11 Display "Commercial rate" 12 ENDIF 13 Display "High usage" 14 ENDIF 15 Display cost 16 STOP Perform Desk Check for the following sets of conditions a. Inputs: waterUsed = 70, customerType (not required) Correct results: cost = 50 b. Inputs: waterUsed = 200, customerType = D Correct results: cost = 100 c. Inputs: waterUsed = 200, customerType = C Correct results: cost = 120 **************************************************************** Lab Task 3 Problem Description: Total a series of number input by the user. Allow the user to continue inputting numbers until a negative number is input, then display the total of the numbers input. The following task shows desk checking involving iteration (repetition) using a WHILE loop. The condition is evaluated at the top of the loop, with execution going to the next line if the condition is True and going to the line after the ENDWHILE if the condition is False. Program execution loops from the ENDWHILE line, back to the WHILE line.
  • 10. UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT Software verification and Validation 5th Term-SE UET Taxila Algorithm (with line numbers added for the Desk Check) 1 totalNumbers() 2 total = 0 3 Input number 4 WHILE number >= 0 DO 5 total = total + number 6 Input number 7 ENDWHILE 8 Display total 9 STOP Perform Desk Check for the following sets of conditions Inputs: numbers = 10, 6, -1. Correct results: total = 16 ****************************************************************