SlideShare a Scribd company logo
1 of 78
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

Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)ShudipPal
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...priyasoundar
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debuggingsvilen.ivanov
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategiesSHREEHARI WADAWADAGI
 
scenario testing in software testing
 scenario testing in software testing scenario testing in software testing
scenario testing in software testingdurgaaarthi
 
Cause effect graphing technique
Cause effect graphing techniqueCause effect graphing technique
Cause effect graphing techniqueAnkush Kumar
 
Chapter 15 software product metrics
Chapter 15 software product metricsChapter 15 software product metrics
Chapter 15 software product metricsSHREEHARI WADAWADAGI
 
Goal stack planning.ppt
Goal stack planning.pptGoal stack planning.ppt
Goal stack planning.pptSadagopanS
 
Spiral model explanation
Spiral model  explanationSpiral model  explanation
Spiral model explanationUmar Farooq
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisniharika5412
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented TestingAMITJain879
 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4 Mohammad Faizan
 
Test Execution
Test ExecutionTest Execution
Test ExecutionRajathi-QA
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxSyed Zaid Irshad
 
Decision Table Based Testing
Decision Table Based TestingDecision Table Based Testing
Decision Table Based TestingHimani Solanki
 

What's hot (20)

Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
 
Test Levels & Techniques
Test Levels & TechniquesTest Levels & Techniques
Test Levels & Techniques
 
Regression testing
Regression testingRegression testing
Regression testing
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debugging
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
scenario testing in software testing
 scenario testing in software testing scenario testing in software testing
scenario testing in software testing
 
Testing strategies
Testing strategiesTesting strategies
Testing strategies
 
Cause effect graphing.ppt
Cause effect graphing.pptCause effect graphing.ppt
Cause effect graphing.ppt
 
Cause effect graphing technique
Cause effect graphing techniqueCause effect graphing technique
Cause effect graphing technique
 
Chapter 15 software product metrics
Chapter 15 software product metricsChapter 15 software product metrics
Chapter 15 software product metrics
 
Goal stack planning.ppt
Goal stack planning.pptGoal stack planning.ppt
Goal stack planning.ppt
 
Spiral model explanation
Spiral model  explanationSpiral model  explanation
Spiral model explanation
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Test Execution
Test ExecutionTest Execution
Test Execution
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Decision Table Based Testing
Decision Table Based TestingDecision Table Based Testing
Decision Table Based Testing
 

Similar to Software testing - EXAMPLE

Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolvingMd. 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.0PMILebanonChapter
 
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 .docxvanesaburnand
 
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/ ykSMayankSharma
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01abdalodainat
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challengesDhanu Srikar
 
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
 
9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdfNaeem Mughal
 
2.1.1 PROBLEM SOLVING & DESIGN
2.1.1 PROBLEM SOLVING & DESIGN2.1.1 PROBLEM SOLVING & DESIGN
2.1.1 PROBLEM SOLVING & DESIGNBuxoo Abdullah
 
'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 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 develop....
Software develop.... Software develop....
Software develop.... GCWUS
 

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
 
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
 
Software develop....
Software develop.... Software develop....
Software develop....
 

Recently uploaded

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

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.