Equivalence Class Testing, Decision Table Testing

Slides:



Advertisements
Similar presentations
2017/3/25 Test Case Upgrade from “Test Case-Training Material v1.4.ppt” of Testing basics Authors: NganVK Version: 1.4 Last Update: Dec-2005.
Advertisements

Testing “Multiple Conditions” with Decision Table Technique
Overview Functional Testing Boundary Value Testing (BVT)
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Decision Table Based Testing
Black Box Testing Csci 565 Spring 2009.
Inpainting Assigment – Tips and Hints Outline how to design a good test plan selection of dimensions to test along selection of values for each dimension.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Equivalence Class Testing
Learning from Postmortems (slides adapted from Michael Mateas) UC Santa Cruz CMPS 171 – Game Design Studio II
Game playtesting, Gameplay metrics (Based on slides by Michael Mateas, and Chapter 9 (Playtesting) of Game Design Workshop, Tracy Fullerton) UC Santa Cruz.
Software Testing and Quality Assurance
Introduction to UML (slides adapted from Michael Mateas)
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Introduction to Testing UC Santa Cruz CMPS 171 – Game Design Studio II 8 February 2011.
Path testing Path testing is a “design structural testing” in that it is based on detailed design & the source code of the program to be tested. The methodology.
Equivalence Class Testing
Black Box Software Testing
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Test Design Techniques
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test3: Equivalence classes and boundary conditions Marian.
Software Testing (Part 2)
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Black-Box Testing Techniques I Software Testing Lecture 4.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
By Asst.Prof.Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand 1 Chapter 3: Equivalence.
Black-Box Testing Techniques I
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Black-box Testing.
1 Equivalence Class Testing Chapter 6. 2 Introduction Boundary Value Testing derives test cases with Massive redundancy Serious gaps Equivalence Class.
Summarizing “Structural” Testing Now that we have learned to create test cases through both: – a) Functional (blackbox)and – b) Structural (whitebox) testing.
Software Testing. Software testing is the execution of software with test data from the problem domain. Software testing is the execution of software.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Equivalence Class Testing In chapter 5, we saw that all four variations of boundary value testing are vulnerable to –gaps of untested functionality, and.
Decision Table Based Testing Outline Decision table vocabulary –Limited Entry Decision Tables (LEDT) –Extended Entry Decision Tables (EEDT) –Mixed Entry.
Dynamic Testing.
1 Software Testing. 2 Equivalence Class Testing 3 The use of equivalence class testing has two motivations: –Sense of complete testing –Avoid redundancy.
Equivalence Class Testing Use the mathematical concept of partitioning into equivalence classes to generate test cases for Functional (Black-box) testing.
Equivalence Class Testing, Decision Table Testing UC Santa Cruz CMPS 171 – Game Design Studio II courses.soe.ucsc.edu/courses/cmps171/Winter12/01
Introduction to Testing UC Santa Cruz CMPS 171 – Game Design Studio II courses.soe.ucsc.edu/courses/cmps171/Winter12/01 14 February 2011.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Taxonomy of Video Game Bugs Based on slides and research originally by Chris Lewis, published at the Foundations of Digital Games 2010 conference UC Santa.
Decision Tables. UC Santa Cruz CMPS 171 – Game Design Studio II courses.soe.ucsc.edu/courses/cmps171/Winter13/01 1 February 2013.
Chapter 3: Equivalence Class Testing :EC Software Testing
Software Testing Structural testing 1.
Overview Theory of Program Testing Goodenough and Gerhart’s Theory
Equivalence partitioning
Decision Table Testing
Black Box Testing PPT Sources: Code Complete, 2nd Ed., Steve McConnell
Input Space Partition Testing CS 4501 / 6501 Software Testing
CS5123 Software Validation and Quality Assurance
Overview Functional Testing Boundary Value Testing (BVT)
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Equivalence Class Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CSE403 Software Engineering Autumn 2000 More Testing
Overview Functional Testing Boundary Value Testing (BVT)
Java Programming Loops
Basic circuit analysis and design
Overview Functional Testing Boundary Value Testing (BVT)
CSE 1020:Software Development
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Equivalence Class Testing, Decision Table Testing UC Santa Cruz CMPS 171 – Game Design Studio II www.soe.ucsc.edu/classes/cmps171/Winter11 ejw@cs.ucsc.edu 10 February 2011

Lab Update Ongoing issues Red-ringed Xbox Whiteboard eraser, pens Has been sent off for repair Whiteboard eraser, pens Have added a few more to the lab Speakers for lab addition computers Speakers ordered C++ books, games (LBP 2), Xbox controller receiver Request ordered Apple developer license Still investigating Others?

Upcoming deadlines Thursday (Feb. 10) Web site skeleton URL, design template, minimal content By 9am, Friday morning Thursday (Feb. 10) Game playtesting plan More details to come Who will conduct tests and write playtest report? How will you recruit testers? Where will you conduct playtests? What specific gameplay issues do you want to focus on in first few weeks of playtesting? Friday (Feb. 11): team status reporting Due by midnight Report on team activities this week Be sure to use CS 171 team status reporting template See http://www.soe.ucsc.edu/classes/cmps171/Winter11/team-status-report-template.html Scrum Masters use different template from rest of team Friday (Feb. 11): updated Sprint burndown charts Ideally these are updated daily, so they’re useful for your team Thursday (Feb. 17): end of Sprint 2 7 days left in this sprint

Functional vs Structural Testing Flickr: cjkershner www.flickr.com/photos/cjkershner/23716188 There are two fundamental approaches to testing software Functional (Black Box) No detailed knowledge of internal implementation Treats system as function mapping inputs to outputs Structural (White Box or Clear Box) Can use detailed knowledge of internal implementation detail Can “see” inside the implementation Flickr: rileyporter www.flickr.com/photos/rileyporter/5379448376/

Types of Functional Tests Boundary Value Testing Test values just before, on, and after some input boundary E.g., -1, 0, 1 Equivalence Class Testing Provide representative samples within a large space of similar (“equivalent”) inputs Decision-Table Testing Create a table that lists all possible outcomes for a set of inputs Use this table to drive test case selection

Equivalence Class Testing Motivating idea: Many inputs to a program will exercise the same path through its source code It is usually the case that, for a given path through the code, one set of inputs is just as good as any other set of inputs for a test case Not always true – recall that for the triangle problem, for some implementation approaches, input values near Maxint would lead to integer overflow So, if it is possible to partition the input space (or output space), then the only tests necessary are one per equivalence class. “The idea of equivalence class testing is to identify test cases by using one element from each equivalence class” Software Testing: A Craftman’s Approach 3rd ed., Paul C. Jorgensen

Example Consider collision detection for the hypothetical game, “Lego Gradius” Vic Viper needs to support parts of the ship being knocked off A hit to the side wings by a point bullet only knocks off a wing A hit to the main body destroys the entire ship The tail area and front wings are immune to hits www.flickr.com/groups/921332@N22/ Lots more Lego Gradius goodness… Two input variables: bul_x and bul_y (bullet location) a ≤ bul_x ≤ d intervals: [a, b), [b, c), [c, d] e ≤ bul_y ≤ h intervals: [e, f), [f, g], (g, h] h g f e a b c d

Weak Normal Equivalence Testing Pick one value from each equivalent class for each input variable Test case 1: {[a,b) , [e,f)} Test case 2: {[b,c), [f,g]} Test case 3: {[c,d], (g,h]} Problem: misses some equivalence classes Two input variables: bul_x and bul_y (bullet location) a ≤ bul_x ≤ d intervals: [a, b), [b, c), [c, d] e ≤ bul_y ≤ h intervals: [e, f), [f, g], (g, h] h g f e a b c d

Strong Normal Equivalence Testing Pick one value from the combination of each equivalence interval for one variable with every equivalence interval for the second variable Test case 1: {[a,b) , [e,f)} Test case 2: {[a,b), [f,g]} Test case 3: {[a,b), (g,h]} Test case 4: {[b,c), [e,f)]} … Problem: doesn’t test values outside of intervals… Two input variables: bul_x and bul_y (bullet location) a ≤ bul_x ≤ d intervals: [a, b), [b, c), [c, d] e ≤ bul_y ≤ h intervals: [e, f), [f, g], (g, h] h g f e a b c d

Weak Robust Equivalence Testing Pick one value from each equivalent class for each input variable, and include invalid values as equivalence classes Test case 1: {< a, [e,f)} Test case 2: {[a,b) , [e,f)} Test case 3: {[b,c), [f,g]} Problem: misses some equivalence classes Test case 4: {[c,d], (g,h]} Test case 5: { > d, > h} Test case 6: {[b,c), < e} Two input variables: bul_x and bul_y (bullet location) a ≤ bul_x ≤ d intervals: [a, b), [b, c), [c, d] e ≤ bul_y ≤ h intervals: [e, f), [f, g], (g, h] h g f e a b c d

Strong Robust Equivalence Testing Pick one value from the combination of each equivalence interval for one variable with every equivalence interval for the second variable, including invalid values as equivalence classes Test case 1: {[a,b) , [e,f)} Test case 2: {[a,b), [f,g]} Test case 3: {[a,b), (g,h]} Test case 4: {[b,c), [e,f)]} … Problem: none, but results in lots of test cases (expensive) Two input variables: bul_x and bul_y (bullet location) a ≤ bul_x ≤ d intervals: [a, b), [b, c), [c, d] also: < a and > d e ≤ bul_y ≤ h intervals: [e, f), [f, g], (g, h] also: <e and >h h g f e a b c d

Triangle problem (revisited) A program reads three integer values from the console. The three values are interpreted as representing the lengths of the sides of a triangle. The program prints a message that states whether the triangle is scalene, isosceles, or equilateral. Recall: Equilateral triangle: Three equal sides, three equal angles (all 60 degrees) Isosceles triangle: Two equal sides, two equal angles Scalene triangle: No equal sides, no equal angles Use Output classes In this case, is best to develop test cases based on output equivalence classes What are they? What are examples of weak normal, strong normal, weak robust, and strong robust test cases (assume max side length of 200)

Decision Table Testing Core idea: Use a table format to capture the relationship between input conditions and output actions Then, use combination of conditions and actions to develop test cases Benefit: tables provide a rigorous way of specifying conditions and actions, since omissions are very clear (an empty part of the table) Decision table format: Stub portion Entry portion

Decision Table Format Conditions describe logical states the software can be in Often describe ranges of inputs Actions describe possible things the software can do Often are the outputs Rules describe what actions (if any) occur for a given set of conditions Conditions (condition stub) Rule 1 Rule 2 Rule n … Actions (action stub)

Triangle Problem as Decision Table C1: a,b,c form a triangle? F T C2: a=b? -- C3: a=c? C4: b=c? A1: Not a triangle X A2: Scalene A3: Isosceles A4: Equilateral A5: Impossible Fill-in last 5 columns From: Software Testing: A Craftman’s Approach 3rd Ed.

Triangle Problem as Decision Table C1: a,b,c form a triangle? F T C2: a=b? -- C3: a=c? C4: b=c? A1: Not a triangle X A2: Scalene A3: Isosceles A4: Equilateral A5: Impossible From: Software Testing: A Craftman’s Approach 3rd Ed.

Generating Test Cases from Decision Table For each row in the table, pick actual values that satisfy the conditions, and then verify the output state(s) match the actions. In-class: Find example test cases from the complete decision table for the triangle problem What are the pros and cons of these test cases?

Random Testing One final black box testing technique is to use a random number generator to create inputs. Requires a stopping criteria Could generate random numbers forever – how many do you want? Pro: Can make a lot of tests, cheaply Explore larger, variable part of input space Con: Test cases aren’t repeatable (inputs vary with each run) Tests are more computationally expensive to run Tests may require more work to create for the first time Example: random testing the triangle problem Randomly pick triangle side values Stopping criteria: continue until every possible output has been seen at least once Example (from book): 1289 test cases, of which 663 are nontriangles, 593 are scalene, 32 are isosceles, and 1 is equilateral

Oracles No, not the database company Think Oracle of Delphi Tells the truth about your future A test oracle is a function that determines whether the program’s output for a given set of inputs is correct or incorrect. A human being often acts as the test oracle. Either manually testing code, or determining what the outputs should be for an automatically run regression test with static inputs For random testing, the test oracle must be a computational function. It can often be as difficult to make the test oracle as it is to create the test