SlideShare a Scribd company logo
SOFTWARE TESTING
Prepared by
Ms. S. Shanmuga Priya
Sr. AP/CSE,
New Horizon College of Engineering
Bangalore
Karnataka
India
CONCEPTS DISCUSSED
• Fundamentals of testing:
Basic Definitions, Test Cases, Identifying Test
Cases, Fault Taxonomies, Levels of Testing,
Generalized Pseudocode, The Triangle
Problem, The NextDate Function, The
Commission Problem, The SATM System, The
Currency Converter, Saturn Windshield Wiper
Controller, Garage Door Opener
SAMPLE TEST CASE
SAMPLE TEST CASE FOR A CALCULATOR
SAMPLE QUESTION(s)
• Explain about the various terminologies
involved in understanding the basic testing
concepts.
• List out the various testing terminologies and
explain it.
• Describe the life cycle of software testing with
suitable diagram.
A TESTING LIFE CYCLE
INSIGHT FROM A VENN DIAGRAM
• Software view
– Code-based view  Considers what it is
– Behavioral view  Considers what it does
• Testing is fundamentally concerned with behavior
• Difficulty for tester
– the base documents are usually written by and for
developers
– the emphasis is therefore on code-based, instead of
behavioral, information
• Consider a universe of program behaviors
• Given a program and its specification, consider
– set S  specified behaviors and
– set P  programmed behaviors
• PROBLEMS FACED BY TESTER
What if certain specified behaviors have not been
programmed?
– Faults of omission
What if certain programmed (implemented) behaviors
have not been specified?
–Faults of commission
CORRECT PORTION
“Correct” portion  Behaviors that are both
specified and implemented
How to identify the test cases?
IDENTIFYING TEST CASES
• Two fundamental approaches aka traditional
testing methods are used to identify test cases
1. Functional Testing aka Specification-based
Testing aka Black Box Testing
2. Structural Testing aka Code-based Testing
aka White Box Testing
• Specification-based Testing
–program can be considered to be a function
that maps values from its input domain to
values in its output range
• How test cases are identified?
–With the information used is the
specification of the software
• Advantage of this approach / method:
– Independent of how the software is implemented,
so if the implementation changes, the test cases are
still useful; and
– test case development can occur in parallel with
the implementation thereby reducing the overall
project development interval
• Disadvantages
– significant redundancies may exist among test
cases
– Possibility of gaps of untested software
• Code-based Testing
– Lends itself to the definition and use of test
coverage metrics
– Test coverage metrics provide a way to explicitly
state the extent to which a software item has been
tested
FAULT TAXONOMIES
SAMPLE QUESTION(S)
Classify the errors and faults based on the
anomalies.
Explain IEEE fault and error taxonomy.
• Process  refers to how we do something
• Product  end result of a process
• The point at which testing and Software Quality
Assurance (SQA) meet is that SQA typically tries to
improve the product by improving the process.
• In that sense, testing is clearly more product oriented.
• Faults can be classified in several ways:
–the development phase in which the
corresponding
• error occurred,
• the consequences of corresponding failures,
• difficulty to resolve,
• risk of no resolution, and so on.
• Software Anomalies  “a departure from the
expected” (IEEE)
ERRORS AND FAULT TAXONOMIES
LEVELS OF TESTING
• Explain the various levels of testing with a
neat diagram.
SAMPLE QUESTION(S)
Also known as
“V Model”
EXAMPLES
• Draw the dataflow diagram for a structured
triangle program implementation.
• With a neat diagram, explain the currency
converter system.
• With a neat diagram, explain the SATM
system.
SAMPLE QUESTION(S)
• The Triangle problem
• The NextDate function
• The Commission problem
• The Automated Teller Machine
• The Currency Converter
• The Windshield-Wiper Controller
• Garage Door Opener
TRIANGLE PROBLEM – PROBLEM
STATEMENT
• Simple Version: The triangle program accepts three
integers, a, b, and c, as input. These are taken to be
sides of a triangle. The output of the program is the type
of triangle determined by the three sides:
Equilateral, Isosceles, Scalene, or Not A Triangle
• Improved Version: “Simple version” plus better
definition of inputs: The integers a, b and c must satisfy
the following conditions:
c1: 1<=a<=200 c4: a<=b+c
c2: 1<=b<=200 c5: b<=a+c
c3: 1<=c<=200 c6: c<=a+b
Program triangle1 ‘Fortran-like version
Dim a, b, c, match As INTEGER
FLOWCHART FOR
TRIANGLE PROBLEM
DFD FOR TRIANGLE PROBLEM
TRIANGLE PROBLEM CONT…
Final Version: “Improved version” plus better definition of outputs: If an
input value fails any of conditions c1, c2, or c3, the program notes this
with an output message. For example:
– “Value of a is not in the range of permitted values.”
– “Value of b is not in the range of permitted values.”
– “Value of c is not in the range of permitted values.”
If values of a, b, and c satisfy conditions c1, c2, and c3, one of four
mutually exclusive outputs is given:
1. If all three sides are equal, the program output is Equilateral.
2. If exactly one pair of sides is equal, the program output is Isosceles.
3. If no pair of sides is equal, the program output is Scalene.
4. If any of conditions c4, c5, and c6 is not met, the program
output is NotATriangle.
THE NEXTDATE FUNCTION
PROBLEM STATEMENT
NextDate is a function of three variables: month,
date, and year.
It returns the date of the day after the input date.
The month, date, and year variables have integer
values subject to these conditions:
c1: 1<= month <=12
c2: 1<=day<=31
c3: 1812<=year<=2012
NEXTDATE FUNCTION – PROBLEM
STATEMENT CONT…
• If any of conditions c1, c2, or c3 fails,
NextDate produces an output indicating the
corresponding variable has an out-of-range
value.
• For example:
– “Value of month not in the range 1..12”.
– Because numerous invalid day–month–year
combinations exist, NextDate collapses these into
one message: “Invalid Input Date.”
An example for relationship among the variables
LEAP YEAR
• Any year that is evenly divisible by 4 is a leap year. For example:
1988, 1992, and 1996
However, there is still a small error that must be accounted for. To
eliminate this error, the Gregorian calendar stipulates that a year that is
evenly divisible by 100 (for example, 1900) is a leap year only if it
is also evenly divisible by 400. For this reason, the following years are
not leap years:
1700, 1800, 1900, 2100, 2200, 2300, 2500, 2600
• This is because they are evenly divisible by 100 but not by 400
The following years are leap years:1600, 2000, 2400
• This is because they are evenly divisible by both 100 and 400
12 MONTHS OF THE YEAR
• The Gregorian calendar and the Julian calendar both consist of
the following twelve months:
1. January - 31 days
2. February - 28 days; 29 days in Leap Years
3. March - 31 days
4. April - 30 days
5. May - 31 days
6. June - 30 days
7. July - 31 days
8. August - 31 days
9. September - 30 days
10. October - 31 days
11. November - 30 days
12. December - 31 days
How many have 28, 30 or 31 days?
The Gregorian calendar has:
4 months with a length of 30 days
7 months that are 31 days long
February is the only month that is 28
days long in common years and 29 days
long in leap years
Case 4: month is 2: 'February
If day < 28
Then tomorrowDay = day +1
Else
If day = 28
Then
If ((year is a leap year)
Then tomorrowDay = 29 'leap year
Else ‘not a leap year
tomorrowDay = 1
tomorrowMonth = 3
Endif
Else if day = 29
Then tomorrowDay = 1
tomorrowMonth = 3
Else Output (“Cannot have Feb”, day)
EndIf
EndIf
EndCase
Output (“Tomorrow’s date is “, tomorrowMonth, tomorrowDay, TomorrowYear)
End NextDate
THE COMMISSION PROBLEM
PROBLEM STATEMENT
A rifle salesperson in the former Arizona Territory sold rifle locks,
stocks, and barrels made by a gunsmith in Missouri.
Locks cost $45, stocks cost $30, and barrels cost $25.
The salesperson had to sell at least one complete rifle per month, and
production limits were such that most of the salesperson could sell in a
month was 70 locks, 80 stocks, and 90 barrels.
THE COMMISSION PROBLEM STATEMENT
CONT…
After each town visit, the salesperson sent a telegram to the Missouri gunsmith
with the number of locks, stocks, and barrels sold in that town.
At the end of a month, the salesperson sent a very short telegram showing –1
locks sold.
The gunsmith then knew the sales for the month were complete and computed
the salesperson’s commission as follows:
10% on sales up to (and including) $1000,
15% on the next $800, and
20% on any sales in excess of $1800
The commission program produced a monthly sales report that gave the total
number of locks, stocks, and barrels sold, the salesperson’s total dollar
sales, and, finally, the commission.
10% on sales up to (and including) $1000,
15% on the next $800, and
20% on any sales in excess of $1800
Locks cost $45, stocks cost $30, and barrels
cost $25.
End Commission
10% on sales up to (and including) $1000,
15% on the next $800, and
20% on any sales in excess of $1800
THE SIMPLE AUTOMATIC TELLER MACHINE
(SATM)
THE SATM TERMINAL
SATM PROBLEM STATEMENT CONT…
• Using a terminal with features, SATM
customers can select any of the transaction
types: deposits, withdrawals, and balance
inquiries
• These transactions can be done on two types of
accounts: checking and savings
• The SATM system communicates with bank
customers via 15 screens (shown in figure)
SCREEN 1 – WELCOME SCREEN
• When the bank customer arrives at an SATM
station, SCREEN 1 is displayed
SCREEN 2 and SCREEN 4
• Bank customer accesses the SATM system with a
plastic card encoded with a Personal Account
Number (PAN) which is a key to an internal
customer account file, containing, among other
things, the customer account name and account
information
• If the customers’ PAN matches the information in
the customer account file, the system presents
screen 2 to the customer.
• If the customer’s PAN is not found, screen 4 is
displayed, and the card is kept.
SCREEN 3 and SCREEN 5
• At Screen 2, the customer is prompted to enter his or her
Personal Identification Number (PIN)
• If the PIN is correct, the system displays Screen 5; otherwise
Screen 3 is displayed
SCREEN 4
• The customer has 3 chances to get the PIN
correct; after three failures, Screen 4 is
displayed, and the card is kept
SCREEN 6
• On entry to screen 5, the system adds two
pieces of information to the customer’s
account file, the current date and an
increment to the number of ATM sessions
• The customer selects the desired transaction
from the option shown on screen 5; then the
system immediately displays screen 6, where
the customer chooses the account to which the
selected transaction will be applied
• If balance is requested, the system checks the
local ATM file for any unposted transactions
and reconciles these with the beginning
balance for that day from the customer account
file.
• Screen 14 is then displayed
THE CURRENCY CONVERTER
CURRENCY CONVERTER GUI
PROBLEM STATEMENT
• The application converts US dollars to any of four
currencies:
– Brazilian Reals,
– Canadian Dollars,
– European Union Euros
– Japanese Yen
• Currency selection is governed by the radio buttons
which are mutually exclusive
• When a country is selected, the system responds by
completing the label; for examples, “Equivalent in…”
becomes “Equivalent in Canadian dollars” if the
Canada button is clicked
• Also, a small Canadian flag appears next to the output
position for the equivalent currency amount
PROBLEM STATEMENT CONT…
• Either before or after currency selection, the user inputs
an amount in US dollars
• Once both tasks are accomplished, the user can click on
the Compute button, the Clear button or Quit button
• Clicking on Compute button results in the conversion
of the US dollar amount to the equivalent amount in the
selected currency
• Clicking on the Clear button resets the currency
selection, the US dollar amount and the equivalent
currency amount and the associated label
• Clicking on the Quit button ends the application
THE WINDSHIELD WIPER
CONTROLLER
• Windshield wiper is controlled by a lever with a dial
• The lever has four positions – OFF, INT (for intermittent),
LOW, and HIGH
• The dial has three positions, numbered simply 1, 2, and 3
• The dial position indicate three intermittent speeds, and
dial position is relevant only when the lever is at the INT
position
The decision table wiper speeds (in wipes per minute) for the lever and dial positions
PROBLEM STATEMENT CONT…
• The decision table below shows the windshield
wiper speeds (in wipes per minute) for the
lever and dial positions
GARAGE DOOR OPENER
Components :
A drive motor,
A drive chain,
The garage door wheel tracks,
A lamp, and
An electronic controller
A system to open a garage door is composed of several components: a drive
motor, a drive chain, the garage door wheel tracks, a lamp, and an electronic
controller. This much of the system is powered by commercial 110 V
electricity. Several devices communicate with the garage door controller—a
wireless keypad (usually in an automobile), a digit keypad on the outside of
the garage door, and a wall-mounted button. In addition, there are two safety
features, a laser beam near the floor and an obstacle sensor. These latter two
devices operate only when the garage door is closing. If the light beam is
interrupted (possibly by a pet), the door immediately stops, and then reverses
direction until the door is fully open. If the door encounters an obstacle while it
is closing (say a child’s tricycle left in the path of the door), the door stops and
reverses direction until it is fully open. There is a third way to stop a door in
motion, either when it is closing or opening. A signal from any of the three
devices (wireless keypad, digit keypad, or wall-mounted control button). The
response to any of these signals is different—the door stops in place. A
subsequent signal from any of the devices starts the door in the same direction
as when it was stopped. Finally, there are sensors that detect when the door has
moved to one of the extreme positions, either fully open or fully closed. When
the door is in motion, the lamp is lit, and remains lit for approximately 30
seconds after the door reaches one of the extreme positions.
REFERENCE
• Paul C. Jorgensen: Software Testing, A
Craftsman’s Approach, 4th Edition, Auerbach
Publications, 2013.
END
THANKS FOR VIEWING 

More Related Content

What's hot

Special value testing
Special value testingSpecial value testing
Special value testingBapi Das
 
Software quality assurance activites
Software quality assurance activitesSoftware quality assurance activites
Software quality assurance activites
Golu Gupta
 
Path testing, data flow testing
Path testing, data flow testingPath testing, data flow testing
Path testing, data flow testing
priyasoundar
 
Defect removal effectiveness
Defect removal effectivenessDefect removal effectiveness
Defect removal effectiveness
Roy Antony Arnold G
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
AMITJain879
 
TOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite AutomataTOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite Automata
Mohammad Imam Hossain
 
Software Engineering Unit 1
Software Engineering Unit 1Software Engineering Unit 1
Software Engineering Unit 1
Abhimanyu Mishra
 
Software Verification & Validation
Software Verification & ValidationSoftware Verification & Validation
Software Verification & Validation
university of education,Lahore
 
Basis path testing
Basis path testingBasis path testing
Basis path testing
Hoa Le
 
Chapter 15 software product metrics
Chapter 15 software product metricsChapter 15 software product metrics
Chapter 15 software product metrics
SHREEHARI WADAWADAGI
 
Testing Metrics
Testing MetricsTesting Metrics
Testing Metrics
PM Venkatesha Babu
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and typesConfiz
 
Software testing principles
Software testing principlesSoftware testing principles
Software testing principles
Donato Di Pierro
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
Mohammad Faizan
 
Unit I Software Testing and Quality Assurance
Unit I Software Testing and Quality AssuranceUnit I Software Testing and Quality Assurance
Unit I Software Testing and Quality Assurance
VinothkumaR Ramu
 
Software Process Improvement
Software Process ImprovementSoftware Process Improvement
Software Process Improvement
Bilal Shah
 
Deciability (automata presentation)
Deciability (automata presentation)Deciability (automata presentation)
Deciability (automata presentation)
Sagar Kumar
 

What's hot (20)

Special value testing
Special value testingSpecial value testing
Special value testing
 
Software quality assurance activites
Software quality assurance activitesSoftware quality assurance activites
Software quality assurance activites
 
Path testing, data flow testing
Path testing, data flow testingPath testing, data flow testing
Path testing, data flow testing
 
Defect removal effectiveness
Defect removal effectivenessDefect removal effectiveness
Defect removal effectiveness
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
TOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite AutomataTOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite Automata
 
Software Engineering Unit 1
Software Engineering Unit 1Software Engineering Unit 1
Software Engineering Unit 1
 
Software Verification & Validation
Software Verification & ValidationSoftware Verification & Validation
Software Verification & Validation
 
Basis path testing
Basis path testingBasis path testing
Basis path testing
 
Chapter 15 software product metrics
Chapter 15 software product metricsChapter 15 software product metrics
Chapter 15 software product metrics
 
Testing Metrics
Testing MetricsTesting Metrics
Testing Metrics
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
Software testing principles
Software testing principlesSoftware testing principles
Software testing principles
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
 
Unit I Software Testing and Quality Assurance
Unit I Software Testing and Quality AssuranceUnit I Software Testing and Quality Assurance
Unit I Software Testing and Quality Assurance
 
Software quality management standards
Software quality management standardsSoftware quality management standards
Software quality management standards
 
Software Process Improvement
Software Process ImprovementSoftware Process Improvement
Software Process Improvement
 
White box ppt
White box pptWhite box ppt
White box ppt
 
Deciability (automata presentation)
Deciability (automata presentation)Deciability (automata presentation)
Deciability (automata presentation)
 
Black box & white-box testing technique
Black box & white-box testing techniqueBlack box & white-box testing technique
Black box & white-box testing technique
 

Similar to Software testing - EXAMPLE

Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolving
Md. Ashikur Rahman
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
PMILebanonChapter
 
Coursework Assignment Design of a taxi meter .docx
Coursework Assignment   Design of a taxi meter .docxCoursework Assignment   Design of a taxi meter .docx
Coursework Assignment Design of a taxi meter .docx
vanesaburnand
 
blckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ yk
blckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ ykblckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ yk
blckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ yk
SMayankSharma
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01
abdalodainat
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
shyamuopeight
 
Algorithm Design and Problem Solving.pdf
Algorithm Design and Problem Solving.pdfAlgorithm Design and Problem Solving.pdf
Algorithm Design and Problem Solving.pdf
IRENE PATRIC
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challenges
Dhanu Srikar
 
Testing
TestingTesting
Model based testing using finite state machine(FSM)
Model based testing using finite state machine(FSM)Model based testing using finite state machine(FSM)
Model based testing using finite state machine(FSM)
Kumaresh Chandra Baruri
 
Telecom Churn Analysis
Telecom Churn AnalysisTelecom Churn Analysis
Telecom Churn Analysis
Vasudev pendyala
 
9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf
Naeem Mughal
 
2.1.1 PROBLEM SOLVING & DESIGN
2.1.1 PROBLEM SOLVING & DESIGN2.1.1 PROBLEM SOLVING & DESIGN
2.1.1 PROBLEM SOLVING & DESIGN
Buxoo Abdullah
 
Flow charts week 5 2020 2021
Flow charts week 5 2020  2021Flow charts week 5 2020  2021
Flow charts week 5 2020 2021
Osama Ghandour Geris
 
Flowcharting week 5 2019 2020
Flowcharting week 5  2019  2020Flowcharting week 5  2019  2020
Flowcharting week 5 2019 2020
Osama Ghandour Geris
 
'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015
Georgina Tilby
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
Models ABC
Models ABCModels ABC
Models ABC
Sergey Sviridenko
 
Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...
Sunny Mervyne Baa
 
Software metrics by Dr. B. J. Mohite
Software metrics by Dr. B. J. MohiteSoftware metrics by Dr. B. J. Mohite
Software metrics by Dr. B. J. Mohite
Zeal Education Society, Pune
 

Similar to Software testing - EXAMPLE (20)

Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolving
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
 
Coursework Assignment Design of a taxi meter .docx
Coursework Assignment   Design of a taxi meter .docxCoursework Assignment   Design of a taxi meter .docx
Coursework Assignment Design of a taxi meter .docx
 
blckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ yk
blckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ ykblckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ yk
blckboxtesting.ppt il.;io'/ ulio'[ yjko8i[0'-p/ yk
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Algorithm Design and Problem Solving.pdf
Algorithm Design and Problem Solving.pdfAlgorithm Design and Problem Solving.pdf
Algorithm Design and Problem Solving.pdf
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challenges
 
Testing
TestingTesting
Testing
 
Model based testing using finite state machine(FSM)
Model based testing using finite state machine(FSM)Model based testing using finite state machine(FSM)
Model based testing using finite state machine(FSM)
 
Telecom Churn Analysis
Telecom Churn AnalysisTelecom Churn Analysis
Telecom Churn Analysis
 
9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf
 
2.1.1 PROBLEM SOLVING & DESIGN
2.1.1 PROBLEM SOLVING & DESIGN2.1.1 PROBLEM SOLVING & DESIGN
2.1.1 PROBLEM SOLVING & DESIGN
 
Flow charts week 5 2020 2021
Flow charts week 5 2020  2021Flow charts week 5 2020  2021
Flow charts week 5 2020 2021
 
Flowcharting week 5 2019 2020
Flowcharting week 5  2019  2020Flowcharting week 5  2019  2020
Flowcharting week 5 2019 2020
 
'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
 
Models ABC
Models ABCModels ABC
Models ABC
 
Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...
 
Software metrics by Dr. B. J. Mohite
Software metrics by Dr. B. J. MohiteSoftware metrics by Dr. B. J. Mohite
Software metrics by Dr. B. J. Mohite
 

Recently uploaded

Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 

Recently uploaded (20)

Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 

Software testing - EXAMPLE

  • 1. SOFTWARE TESTING Prepared by Ms. S. Shanmuga Priya Sr. AP/CSE, New Horizon College of Engineering Bangalore Karnataka India
  • 2. CONCEPTS DISCUSSED • Fundamentals of testing: Basic Definitions, Test Cases, Identifying Test Cases, Fault Taxonomies, Levels of Testing, Generalized Pseudocode, The Triangle Problem, The NextDate Function, The Commission Problem, The SATM System, The Currency Converter, Saturn Windshield Wiper Controller, Garage Door Opener
  • 4.
  • 5. SAMPLE TEST CASE FOR A CALCULATOR
  • 6.
  • 7. SAMPLE QUESTION(s) • Explain about the various terminologies involved in understanding the basic testing concepts. • List out the various testing terminologies and explain it. • Describe the life cycle of software testing with suitable diagram.
  • 9. INSIGHT FROM A VENN DIAGRAM • Software view – Code-based view  Considers what it is – Behavioral view  Considers what it does • Testing is fundamentally concerned with behavior • Difficulty for tester – the base documents are usually written by and for developers – the emphasis is therefore on code-based, instead of behavioral, information
  • 10. • Consider a universe of program behaviors • Given a program and its specification, consider – set S  specified behaviors and – set P  programmed behaviors • PROBLEMS FACED BY TESTER What if certain specified behaviors have not been programmed? – Faults of omission What if certain programmed (implemented) behaviors have not been specified? –Faults of commission
  • 11. CORRECT PORTION “Correct” portion  Behaviors that are both specified and implemented How to identify the test cases?
  • 12. IDENTIFYING TEST CASES • Two fundamental approaches aka traditional testing methods are used to identify test cases 1. Functional Testing aka Specification-based Testing aka Black Box Testing 2. Structural Testing aka Code-based Testing aka White Box Testing
  • 13. • Specification-based Testing –program can be considered to be a function that maps values from its input domain to values in its output range • How test cases are identified? –With the information used is the specification of the software
  • 14. • Advantage of this approach / method: – Independent of how the software is implemented, so if the implementation changes, the test cases are still useful; and – test case development can occur in parallel with the implementation thereby reducing the overall project development interval • Disadvantages – significant redundancies may exist among test cases – Possibility of gaps of untested software
  • 15.
  • 16. • Code-based Testing – Lends itself to the definition and use of test coverage metrics – Test coverage metrics provide a way to explicitly state the extent to which a software item has been tested
  • 18. SAMPLE QUESTION(S) Classify the errors and faults based on the anomalies. Explain IEEE fault and error taxonomy.
  • 19. • Process  refers to how we do something • Product  end result of a process • The point at which testing and Software Quality Assurance (SQA) meet is that SQA typically tries to improve the product by improving the process. • In that sense, testing is clearly more product oriented.
  • 20. • Faults can be classified in several ways: –the development phase in which the corresponding • error occurred, • the consequences of corresponding failures, • difficulty to resolve, • risk of no resolution, and so on. • Software Anomalies  “a departure from the expected” (IEEE)
  • 21. ERRORS AND FAULT TAXONOMIES
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 28. • Explain the various levels of testing with a neat diagram. SAMPLE QUESTION(S)
  • 29. Also known as “V Model”
  • 31. • Draw the dataflow diagram for a structured triangle program implementation. • With a neat diagram, explain the currency converter system. • With a neat diagram, explain the SATM system. SAMPLE QUESTION(S)
  • 32. • The Triangle problem • The NextDate function • The Commission problem • The Automated Teller Machine • The Currency Converter • The Windshield-Wiper Controller • Garage Door Opener
  • 33. TRIANGLE PROBLEM – PROBLEM STATEMENT • Simple Version: The triangle program accepts three integers, a, b, and c, as input. These are taken to be sides of a triangle. The output of the program is the type of triangle determined by the three sides: Equilateral, Isosceles, Scalene, or Not A Triangle
  • 34. • Improved Version: “Simple version” plus better definition of inputs: The integers a, b and c must satisfy the following conditions: c1: 1<=a<=200 c4: a<=b+c c2: 1<=b<=200 c5: b<=a+c c3: 1<=c<=200 c6: c<=a+b
  • 35. Program triangle1 ‘Fortran-like version Dim a, b, c, match As INTEGER
  • 37. DFD FOR TRIANGLE PROBLEM
  • 38.
  • 39. TRIANGLE PROBLEM CONT… Final Version: “Improved version” plus better definition of outputs: If an input value fails any of conditions c1, c2, or c3, the program notes this with an output message. For example: – “Value of a is not in the range of permitted values.” – “Value of b is not in the range of permitted values.” – “Value of c is not in the range of permitted values.” If values of a, b, and c satisfy conditions c1, c2, and c3, one of four mutually exclusive outputs is given: 1. If all three sides are equal, the program output is Equilateral. 2. If exactly one pair of sides is equal, the program output is Isosceles. 3. If no pair of sides is equal, the program output is Scalene. 4. If any of conditions c4, c5, and c6 is not met, the program output is NotATriangle.
  • 40.
  • 42. PROBLEM STATEMENT NextDate is a function of three variables: month, date, and year. It returns the date of the day after the input date. The month, date, and year variables have integer values subject to these conditions: c1: 1<= month <=12 c2: 1<=day<=31 c3: 1812<=year<=2012
  • 43. NEXTDATE FUNCTION – PROBLEM STATEMENT CONT… • If any of conditions c1, c2, or c3 fails, NextDate produces an output indicating the corresponding variable has an out-of-range value. • For example: – “Value of month not in the range 1..12”. – Because numerous invalid day–month–year combinations exist, NextDate collapses these into one message: “Invalid Input Date.”
  • 44. An example for relationship among the variables
  • 45. LEAP YEAR • Any year that is evenly divisible by 4 is a leap year. For example: 1988, 1992, and 1996 However, there is still a small error that must be accounted for. To eliminate this error, the Gregorian calendar stipulates that a year that is evenly divisible by 100 (for example, 1900) is a leap year only if it is also evenly divisible by 400. For this reason, the following years are not leap years: 1700, 1800, 1900, 2100, 2200, 2300, 2500, 2600 • This is because they are evenly divisible by 100 but not by 400 The following years are leap years:1600, 2000, 2400 • This is because they are evenly divisible by both 100 and 400
  • 46. 12 MONTHS OF THE YEAR • The Gregorian calendar and the Julian calendar both consist of the following twelve months: 1. January - 31 days 2. February - 28 days; 29 days in Leap Years 3. March - 31 days 4. April - 30 days 5. May - 31 days 6. June - 30 days 7. July - 31 days 8. August - 31 days 9. September - 30 days 10. October - 31 days 11. November - 30 days 12. December - 31 days How many have 28, 30 or 31 days? The Gregorian calendar has: 4 months with a length of 30 days 7 months that are 31 days long February is the only month that is 28 days long in common years and 29 days long in leap years
  • 47.
  • 48. Case 4: month is 2: 'February If day < 28 Then tomorrowDay = day +1 Else If day = 28 Then If ((year is a leap year) Then tomorrowDay = 29 'leap year Else ‘not a leap year tomorrowDay = 1 tomorrowMonth = 3 Endif Else if day = 29 Then tomorrowDay = 1 tomorrowMonth = 3 Else Output (“Cannot have Feb”, day) EndIf EndIf EndCase Output (“Tomorrow’s date is “, tomorrowMonth, tomorrowDay, TomorrowYear) End NextDate
  • 49. THE COMMISSION PROBLEM PROBLEM STATEMENT A rifle salesperson in the former Arizona Territory sold rifle locks, stocks, and barrels made by a gunsmith in Missouri. Locks cost $45, stocks cost $30, and barrels cost $25. The salesperson had to sell at least one complete rifle per month, and production limits were such that most of the salesperson could sell in a month was 70 locks, 80 stocks, and 90 barrels.
  • 50. THE COMMISSION PROBLEM STATEMENT CONT… After each town visit, the salesperson sent a telegram to the Missouri gunsmith with the number of locks, stocks, and barrels sold in that town. At the end of a month, the salesperson sent a very short telegram showing –1 locks sold. The gunsmith then knew the sales for the month were complete and computed the salesperson’s commission as follows: 10% on sales up to (and including) $1000, 15% on the next $800, and 20% on any sales in excess of $1800 The commission program produced a monthly sales report that gave the total number of locks, stocks, and barrels sold, the salesperson’s total dollar sales, and, finally, the commission.
  • 51. 10% on sales up to (and including) $1000, 15% on the next $800, and 20% on any sales in excess of $1800 Locks cost $45, stocks cost $30, and barrels cost $25.
  • 52. End Commission 10% on sales up to (and including) $1000, 15% on the next $800, and 20% on any sales in excess of $1800
  • 53. THE SIMPLE AUTOMATIC TELLER MACHINE (SATM) THE SATM TERMINAL
  • 54. SATM PROBLEM STATEMENT CONT… • Using a terminal with features, SATM customers can select any of the transaction types: deposits, withdrawals, and balance inquiries • These transactions can be done on two types of accounts: checking and savings • The SATM system communicates with bank customers via 15 screens (shown in figure)
  • 55. SCREEN 1 – WELCOME SCREEN • When the bank customer arrives at an SATM station, SCREEN 1 is displayed
  • 56. SCREEN 2 and SCREEN 4 • Bank customer accesses the SATM system with a plastic card encoded with a Personal Account Number (PAN) which is a key to an internal customer account file, containing, among other things, the customer account name and account information • If the customers’ PAN matches the information in the customer account file, the system presents screen 2 to the customer. • If the customer’s PAN is not found, screen 4 is displayed, and the card is kept.
  • 57.
  • 58. SCREEN 3 and SCREEN 5 • At Screen 2, the customer is prompted to enter his or her Personal Identification Number (PIN) • If the PIN is correct, the system displays Screen 5; otherwise Screen 3 is displayed
  • 59. SCREEN 4 • The customer has 3 chances to get the PIN correct; after three failures, Screen 4 is displayed, and the card is kept
  • 60. SCREEN 6 • On entry to screen 5, the system adds two pieces of information to the customer’s account file, the current date and an increment to the number of ATM sessions • The customer selects the desired transaction from the option shown on screen 5; then the system immediately displays screen 6, where the customer chooses the account to which the selected transaction will be applied
  • 61.
  • 62. • If balance is requested, the system checks the local ATM file for any unposted transactions and reconciles these with the beginning balance for that day from the customer account file. • Screen 14 is then displayed
  • 63.
  • 64.
  • 65.
  • 68. PROBLEM STATEMENT • The application converts US dollars to any of four currencies: – Brazilian Reals, – Canadian Dollars, – European Union Euros – Japanese Yen • Currency selection is governed by the radio buttons which are mutually exclusive • When a country is selected, the system responds by completing the label; for examples, “Equivalent in…” becomes “Equivalent in Canadian dollars” if the Canada button is clicked • Also, a small Canadian flag appears next to the output position for the equivalent currency amount
  • 69. PROBLEM STATEMENT CONT… • Either before or after currency selection, the user inputs an amount in US dollars • Once both tasks are accomplished, the user can click on the Compute button, the Clear button or Quit button • Clicking on Compute button results in the conversion of the US dollar amount to the equivalent amount in the selected currency • Clicking on the Clear button resets the currency selection, the US dollar amount and the equivalent currency amount and the associated label • Clicking on the Quit button ends the application
  • 71. • Windshield wiper is controlled by a lever with a dial • The lever has four positions – OFF, INT (for intermittent), LOW, and HIGH • The dial has three positions, numbered simply 1, 2, and 3 • The dial position indicate three intermittent speeds, and dial position is relevant only when the lever is at the INT position The decision table wiper speeds (in wipes per minute) for the lever and dial positions
  • 72. PROBLEM STATEMENT CONT… • The decision table below shows the windshield wiper speeds (in wipes per minute) for the lever and dial positions
  • 74. Components : A drive motor, A drive chain, The garage door wheel tracks, A lamp, and An electronic controller
  • 75. A system to open a garage door is composed of several components: a drive motor, a drive chain, the garage door wheel tracks, a lamp, and an electronic controller. This much of the system is powered by commercial 110 V electricity. Several devices communicate with the garage door controller—a wireless keypad (usually in an automobile), a digit keypad on the outside of the garage door, and a wall-mounted button. In addition, there are two safety features, a laser beam near the floor and an obstacle sensor. These latter two devices operate only when the garage door is closing. If the light beam is interrupted (possibly by a pet), the door immediately stops, and then reverses direction until the door is fully open. If the door encounters an obstacle while it is closing (say a child’s tricycle left in the path of the door), the door stops and reverses direction until it is fully open. There is a third way to stop a door in motion, either when it is closing or opening. A signal from any of the three devices (wireless keypad, digit keypad, or wall-mounted control button). The response to any of these signals is different—the door stops in place. A subsequent signal from any of the devices starts the door in the same direction as when it was stopped. Finally, there are sensors that detect when the door has moved to one of the extreme positions, either fully open or fully closed. When the door is in motion, the lamp is lit, and remains lit for approximately 30 seconds after the door reaches one of the extreme positions.
  • 76.
  • 77. REFERENCE • Paul C. Jorgensen: Software Testing, A Craftsman’s Approach, 4th Edition, Auerbach Publications, 2013.