Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.

Slides:



Advertisements
Similar presentations
Lecture 2: testing Book: Chapter 9 What is testing? Testing is not showing that there are no errors in the program. Testing cannot show that the program.
Advertisements

Software Testing Testing.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
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.
Introduction to Software Engineering Lecture 11 André van der Hoek.
Software Failure: Reasons Incorrect, missing, impossible requirements * Requirement validation. Incorrect specification * Specification verification. Faulty.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
Informatics 43 – April 30, What is a test case? An input to a system, and the correct output. An “input” may be complex. Example: – What is an input.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Chapter 18 Testing Conventional Applications
Outline Types of errors Component Testing Testing Strategy
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
SOFTWARE TESTING WHITE BOX TESTING 1. GLASS BOX/WHITE BOX TESTING 2.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
System/Software Testing
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
Neil Ghani Software testing. 2 Introduction In a perfect world all programs fully verified testing thus redundant Back in the real.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Black Box Testing Focuses in the functional requirements of the program It is not an alternative to white-box techniques It is a complementary approach.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Unit Testing LEVEL GAME.  Create pieces array  Call move or interact  Use getters or return type to verify correct behavior  Test ends (don’t go GameEngine.BOARD_SIZE-1)
(1) A beginners guide to testing Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
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.
Software Verification and Validation. Objectives n Testing allegiance to customer not development team n Test ALL documents n Intent: Find Defects  Good.
SOFTWARE TESTING. INTRODUCTION Testing forms the first step in determining the errors in a program. It is the major quality control measure used during.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Theory and Practice of Software Testing
Testing Data Structures Tao Xie Visiting Professor, Peking University Associate Professor, North Carolina State University
Dynamic Testing.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Data Structures
Software TestIng White box testing.
Software Testing.
Software Testing.
Software Testing.
Software Testing Techniques
Lecture on Black Box Testing
Structural testing, Path Testing
White-Box Testing Techniques
CHAPTER 4 Test Design Techniques
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing Instructor: Baishakhi Ray
Software Testing (Lecture 11-a)
Static Testing Static testing refers to testing that takes place without Execution - examining and reviewing it. Dynamic Testing Dynamic testing is what.
Informatics 43 – April 28, 2016.
Chapter 10 – Software 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
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Testing Testing Techniques to Design Tests

Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer elements. void getModeFreq (ArrayType a, int size, int & mode, int & freq); n Test case categories  Empty array ?  Normal cases?  More than one mode  All elements unique

Test to specification n Tests can have more than one answer and still be consistent with specification.  Find THE mode is a constraint on the values in the array.  Find A mode  several modes can exist. n Specification and test design developed concurrently

Black Box Testing n Happy Path n Interface Testing n Equivalence Partitioning n Boundary value analysis n Functional testing n Cause-effect graphing testing n Comparison testing n Error testing n Random inputs

Black Box Testing n Happy Path  Test cases and input values chosen from those known or expected to work. n Interface Testing  Unit interfaces and I/O interfaces (Automated test tools) n Equivalence Partitioning  Input class: generate 1 test point for each input class  Output class – generate 1 test point that gives result in each output class  Subdivide into subclasses (middle of range and 2 extremes)  Error Handling Routines/Exception output conditions (input beyond accepted range)

Boundary Value Analysis Derive test cases from boundaries of equivalence partitions. 1. Add equivalence partitions for output to input classes. 2. For each input and output class: a.Write valid test cases for representative value and high and low values. b.Write invalid test cases for values just beyond boundary.

Black Box Testing n Functional testing  Functions within certain math classes can be distinguished by their values on a small number of points F(x) = y, if x > 0; y-1, if x <= 0  Functions of more than one variable? z=x+y+1  Limitation: most programming problems not simple math problems n Random inputs n Cause-effect graphing testing n Comparison testing n Error testing

Error Guessing Test designer uses skill and experience to devise test cases to uncover errors. n null input. n long input. n random input. n almost correct input.  spaces in strings.  quoted strings.  all CAPS. n negative numbers.

White Box Testing n Based on program structure n Coverage metrics for thoroughness  Statement coverage : all statements are executed at least once. This is harder than it sounds: defensive programming makes some code hard to get to. if (f = fopen(path)) { perror("fopen"); }  Insufficient for “if P then S” (only need true condition to test statement)

White Box Testing  Branch coverage all branches are taken all conditions on branches are evaluated. Includes statement coverage Only this will catch bug above. Consider If (x < 0) x--; else x++; if (y < 0) z = sqrt (-x); else z = x+y; Can branch cover with then- then and else-else without detecting the problem of calling sqrt with a negative value

White Box Testing  Path coverage (every combination of T/Fs) Impractical – too many paths Eliminate infeasible paths (no systematic way) If (y < 0) x = y –1; else x = y+1; if (x > 0) … then-then infeasible Missing paths (“special cases”) – can involve 1 single input data point (if y = 0)

More…Path coverage  Coincidental correctness read x; y = x + 2; vs. y = x * 2; write y;  Can’t distinguish if input is 2  Implies one point per path is insufficient

Paths Loop <= possible paths At 1 task/msec = 3170 years

More White Box Testing n Data Flow Coverage  All definitions and all uses of variables n Mutation Analysis  Create mutant programs  See if mutant programs give identical output for each test; If yes, mutant is live If no, mutant is killed  Display set of live mutants, if all killed, confidence in Test  Examples: Replace 1 constant or variable with another Replace one arithmetic operator with another Similarly, relational and logical operators Delete a statement Increment change