SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Course Instructor:
Sonia Kaleem
Software Engineering
Test Case Design Techniques
Specification-based techniques
(Black box testing)
 Equivalence Partitioning
 Boundary Value Analysis
 Decision Table
 State Transition
Test Case
 A test case is a set of conditions for evaluating a
particular feature of a software product to determine its
compliance with the business requirements.
 A test case has pre-requisites, input values, and expected
results in a documented form that cover the different test
scenarios.
Equivalence Partitioning
 Equivalence Partitioning or Equivalence Class Partitioning is
type of black box testing technique which can be applied to all
levels of software testing(unit, integration, system), etc.
 In this technique, input data units are divided into equivalent
partitions that can be used to derive test cases which reduces time
required for testing because of small number of test cases.
 It divides the input data of software into different equivalence data
classes.
Equivalence Partitioning (EP)
 divide (partition) the inputs, outputs, etc. into areas which are
the same (equivalent)
 assumption: if one value works, all will work
 one from each partition better than all from one
1 100 101
0
valid invalid
invalid
Example:
 Test cases for input boxes accepting numbers between 1 and 1000
1) One input data class with all valid inputs. Pick a single value from the
range of 1 to 1000 as a valid test case. If you select other values between
1 and 1000, then the result is going to be the same. So one test case for
valid input data should be sufficient.
2) Input data class with all values below the lower limit. i.e., any value
below 1, as an invalid input data test case.
3) Input data with any value greater than 1000 to represent the third invalid
input class.
 So, using Equivalence Partitioning, you have categorized all possible test
cases into three classes. Test cases with other values from any class should
give you the same result.
Example:
 Consider the Order Pizza Text Box's behavior
 Pizza values ranging from 1 to 10 are valid. The message "success" is
shown. While values 11 to 99 are invalid for ordering, an error notice
stating "Only 10 Pizza may be ordered" will show.
 The test situation is as follows:
 Any number submitted in the Order Pizza form that is larger than 10
(let's say 11) is deemed invalid.
 Any number that is less than 1 and is 0 or below is deemed invalid.
 The numbers 1 to 10 are accepted as acceptable.
 Any three-digit number, such as -100, is not practical.
Boundary Value Analysis
 ‘Boundary Value Analysis’ Testing technique is used to identify errors at
boundaries rather than finding those that exist in the center of the input
domain.
 Boundary value analysis is a black-box testing technique. It is closely
associated with equivalence class partitioning.
 Boundary Value Analysis is the next part of Equivalence Partitioning for
designing test cases where test cases are selected at the edges of the
equivalence classes.
 In this technique, we analyze the behavior of the application with test data
residing at the boundary values of the equivalence classes.
Example:
 The Number 1 to 10 should be accepted in the input box.
 The Boundary Value Test Cases may be found here.
 Boundary Value = 0 - System should not allow
 1 is the boundary value - Acceptance by the system is required.
 2 is the boundary value - Acceptance by the system is required.
 9 is the boundary value - Acceptance by the system is required.
 10 is the boundary value - Acceptance by the system is required.
 11 is the boundary value - It is not acceptable for the system to
accept
Boundary value test cases
Boundary Value = 0 System should not allow
1 is the boundary value Acceptance by the system is required.
2 is the boundary value Acceptance by the system is required.
9 is the boundary value Acceptance by the system is required.
10 is the boundary value Acceptance by the system is required.
11 is the boundary value It is not acceptable for the system to accept
Decision Table Testing
 Decision Table is as known as Cause-Effect Table.
 This test technique is appropriate for functionalities which has
logical relationships between inputs (if-else logic).
 In Decision table technique, we deal with combinations of
inputs.
 To identify the test cases with decision table, we consider
conditions and actions.
 We take conditions as inputs and actions as outputs.
Decision Table Testing
 Example-Decision table for login screen:
 T – Correct username/password
 F – Wrong username/password
 E – Error message is displayed
 H – Home screen is displayed
Conditions Rule 1 Rule 2 Rule 3 Rule 4
Username F T F T
Password F F T T
Actions/Outp
ut
E E E H
Decision Table Testing
 Case 1 – Username and password both were wrong. The
user is shown an error message.
 Case 2 – Username was correct, but the password was
wrong. The user is shown an error message.
 Case 3 – Username was wrong, but the password was
correct. The user is shown an error message.
 Case 4 – Username and password both were correct, and
the user is navigated to the homepage.
Decision Table Testing
 Decision tables are a good way to:
 capture system requirements that contain logical conditions
 to document internal system design.
 The input conditions and actions are most often stated in such a way that they
can be either true or false (Boolean).
 The strength of decision table testing is that it creates combinations of
conditions that might not otherwise have been exercised during testing.
 It may be applied to all situations when the action of the software depends on
several logical decisions.
State Transition Testing
 A system can be in a finite number of different states.
This aspects of the system can be described as a ‘finite
state machine’; a state diagram.
 Any system where you get a different output for the same
input, depending on what has happened before, is a finite
state system.
 The transition from one state to another are determined
by the rules of the ‘machine’/software.
State Transition Testing
 State transition testing
 System can be in a finite number of different states
 Elements of state transition models:
 States (The software may occupy)
 Open/closed, active/inactive
 Transitions (From one state to another)
 Not all transitions are allowed
 Events (Causing state transition)
 Closing a files/withdrawing money
 Actions (Action resulting from transitions)
 Error message
Example: ATM PIN
 A ‘finite state machine’ is often shown as a state diagram
 The states of the system under test are separate, identifiable
and finite in number.
State Transition Testing
 How many tests do we need to exercise every state?
States: States can be numbered as S1, S2 or as alphabets A, B, C etc.
S1:Start, S2:Wait for Pin, S3: 1st try, S4: 2nd Try, S5: 3rd Try, S6: access to account, S7: eat card
Events: Event1:Card inserted, Event 2: enter Pin, Event 3: Pin OK, Event 4: Pin not OK
Actions : (not shown in the above example) could be : Messages on the screen – error or otherwise.
State Transition Testing
 Invalid or Null Transitions are represented as ‘-‘ in red in the table above.
State Transition Testing
 Why state transition testing?
 Because a system may exhibit a different response depending on
current conditions or previous history.
 State transition testing allows the tester to view:
 the software in terms of its states
 transitions between states
 the inputs or events that trigger state changes (transitions)
 the actions which may result from those transitions
State Transition Testing
 Tests can be designed
 to cover a typical sequence of states
 to exercise specific sequences of transitions
 to cover every state
 to exercise every transition
 to test invalid transitions
 State transition testing is much used within the software
industry and technical automation in general.
Choosing test techniques
 The choice of which test techniques to use depends on a number of factors, including:

Weitere ähnliche Inhalte

Ähnlich wie SE 09 (test design techs).pptx (20)

test3
test3test3
test3
 
test2
test2test2
test2
 
domenica3
domenica3domenica3
domenica3
 
provoora
provooraprovoora
provoora
 
remoto2
remoto2remoto2
remoto2
 
provacompleta2
provacompleta2provacompleta2
provacompleta2
 
finalelocale2
finalelocale2finalelocale2
finalelocale2
 
domenica2
domenica2domenica2
domenica2
 
provarealw4
provarealw4provarealw4
provarealw4
 
test2
test2test2
test2
 
prova3
prova3prova3
prova3
 
prova1
prova1prova1
prova1
 
provaoggi2
provaoggi2provaoggi2
provaoggi2
 
stasera1
stasera1stasera1
stasera1
 
provarealw2
provarealw2provarealw2
provarealw2
 
prova5
prova5prova5
prova5
 
provarealw3
provarealw3provarealw3
provarealw3
 
finalelocale
finalelocalefinalelocale
finalelocale
 
testsfw3
testsfw3testsfw3
testsfw3
 
 

Mehr von ZohairMughal1 (6)

HCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxHCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptx
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
 
OS Thr schd.ppt
OS Thr schd.pptOS Thr schd.ppt
OS Thr schd.ppt
 
Lecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxLecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptx
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
 
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdfKhilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
 

Kürzlich hochgeladen

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Kürzlich hochgeladen (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

SE 09 (test design techs).pptx

  • 2. Test Case Design Techniques
  • 3. Specification-based techniques (Black box testing)  Equivalence Partitioning  Boundary Value Analysis  Decision Table  State Transition
  • 4. Test Case  A test case is a set of conditions for evaluating a particular feature of a software product to determine its compliance with the business requirements.  A test case has pre-requisites, input values, and expected results in a documented form that cover the different test scenarios.
  • 5. Equivalence Partitioning  Equivalence Partitioning or Equivalence Class Partitioning is type of black box testing technique which can be applied to all levels of software testing(unit, integration, system), etc.  In this technique, input data units are divided into equivalent partitions that can be used to derive test cases which reduces time required for testing because of small number of test cases.  It divides the input data of software into different equivalence data classes.
  • 6. Equivalence Partitioning (EP)  divide (partition) the inputs, outputs, etc. into areas which are the same (equivalent)  assumption: if one value works, all will work  one from each partition better than all from one 1 100 101 0 valid invalid invalid
  • 7. Example:  Test cases for input boxes accepting numbers between 1 and 1000 1) One input data class with all valid inputs. Pick a single value from the range of 1 to 1000 as a valid test case. If you select other values between 1 and 1000, then the result is going to be the same. So one test case for valid input data should be sufficient. 2) Input data class with all values below the lower limit. i.e., any value below 1, as an invalid input data test case. 3) Input data with any value greater than 1000 to represent the third invalid input class.  So, using Equivalence Partitioning, you have categorized all possible test cases into three classes. Test cases with other values from any class should give you the same result.
  • 8. Example:  Consider the Order Pizza Text Box's behavior  Pizza values ranging from 1 to 10 are valid. The message "success" is shown. While values 11 to 99 are invalid for ordering, an error notice stating "Only 10 Pizza may be ordered" will show.  The test situation is as follows:  Any number submitted in the Order Pizza form that is larger than 10 (let's say 11) is deemed invalid.  Any number that is less than 1 and is 0 or below is deemed invalid.  The numbers 1 to 10 are accepted as acceptable.  Any three-digit number, such as -100, is not practical.
  • 9. Boundary Value Analysis  ‘Boundary Value Analysis’ Testing technique is used to identify errors at boundaries rather than finding those that exist in the center of the input domain.  Boundary value analysis is a black-box testing technique. It is closely associated with equivalence class partitioning.  Boundary Value Analysis is the next part of Equivalence Partitioning for designing test cases where test cases are selected at the edges of the equivalence classes.  In this technique, we analyze the behavior of the application with test data residing at the boundary values of the equivalence classes.
  • 10. Example:  The Number 1 to 10 should be accepted in the input box.  The Boundary Value Test Cases may be found here.  Boundary Value = 0 - System should not allow  1 is the boundary value - Acceptance by the system is required.  2 is the boundary value - Acceptance by the system is required.  9 is the boundary value - Acceptance by the system is required.  10 is the boundary value - Acceptance by the system is required.  11 is the boundary value - It is not acceptable for the system to accept
  • 11. Boundary value test cases Boundary Value = 0 System should not allow 1 is the boundary value Acceptance by the system is required. 2 is the boundary value Acceptance by the system is required. 9 is the boundary value Acceptance by the system is required. 10 is the boundary value Acceptance by the system is required. 11 is the boundary value It is not acceptable for the system to accept
  • 12. Decision Table Testing  Decision Table is as known as Cause-Effect Table.  This test technique is appropriate for functionalities which has logical relationships between inputs (if-else logic).  In Decision table technique, we deal with combinations of inputs.  To identify the test cases with decision table, we consider conditions and actions.  We take conditions as inputs and actions as outputs.
  • 13. Decision Table Testing  Example-Decision table for login screen:  T – Correct username/password  F – Wrong username/password  E – Error message is displayed  H – Home screen is displayed Conditions Rule 1 Rule 2 Rule 3 Rule 4 Username F T F T Password F F T T Actions/Outp ut E E E H
  • 14. Decision Table Testing  Case 1 – Username and password both were wrong. The user is shown an error message.  Case 2 – Username was correct, but the password was wrong. The user is shown an error message.  Case 3 – Username was wrong, but the password was correct. The user is shown an error message.  Case 4 – Username and password both were correct, and the user is navigated to the homepage.
  • 15. Decision Table Testing  Decision tables are a good way to:  capture system requirements that contain logical conditions  to document internal system design.  The input conditions and actions are most often stated in such a way that they can be either true or false (Boolean).  The strength of decision table testing is that it creates combinations of conditions that might not otherwise have been exercised during testing.  It may be applied to all situations when the action of the software depends on several logical decisions.
  • 16. State Transition Testing  A system can be in a finite number of different states. This aspects of the system can be described as a ‘finite state machine’; a state diagram.  Any system where you get a different output for the same input, depending on what has happened before, is a finite state system.  The transition from one state to another are determined by the rules of the ‘machine’/software.
  • 17. State Transition Testing  State transition testing  System can be in a finite number of different states  Elements of state transition models:  States (The software may occupy)  Open/closed, active/inactive  Transitions (From one state to another)  Not all transitions are allowed  Events (Causing state transition)  Closing a files/withdrawing money  Actions (Action resulting from transitions)  Error message
  • 18. Example: ATM PIN  A ‘finite state machine’ is often shown as a state diagram  The states of the system under test are separate, identifiable and finite in number.
  • 19. State Transition Testing  How many tests do we need to exercise every state? States: States can be numbered as S1, S2 or as alphabets A, B, C etc. S1:Start, S2:Wait for Pin, S3: 1st try, S4: 2nd Try, S5: 3rd Try, S6: access to account, S7: eat card Events: Event1:Card inserted, Event 2: enter Pin, Event 3: Pin OK, Event 4: Pin not OK Actions : (not shown in the above example) could be : Messages on the screen – error or otherwise.
  • 20. State Transition Testing  Invalid or Null Transitions are represented as ‘-‘ in red in the table above.
  • 21. State Transition Testing  Why state transition testing?  Because a system may exhibit a different response depending on current conditions or previous history.  State transition testing allows the tester to view:  the software in terms of its states  transitions between states  the inputs or events that trigger state changes (transitions)  the actions which may result from those transitions
  • 22. State Transition Testing  Tests can be designed  to cover a typical sequence of states  to exercise specific sequences of transitions  to cover every state  to exercise every transition  to test invalid transitions  State transition testing is much used within the software industry and technical automation in general.
  • 23. Choosing test techniques  The choice of which test techniques to use depends on a number of factors, including: