CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.

Slides:



Advertisements
Similar presentations
Testing Coverage Test case
Advertisements

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.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION TESTING II Autumn 2011.
Chapter 17 Software Testing Techniques
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
CS4723 Software Validation and Quality Assurance Lecture 02 Overview of Software Testing.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Outline Types of errors Component Testing Testing Strategy
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Software Engineering Lecture 12 Software Testing Techniques 1.
Chapter 13 & 14 Software Testing Strategies and Techniques
1 Joe Meehean. 2 Testing is the process of executing a program with the intent of finding errors. -Glenford Myers.
CSE 403 Lecture 13 Black/White-Box Testing Reading: Software Testing: Principles and Practices, Ch. 3-4 (Desikan, Ramesh) slides created by Marty Stepp.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
TEST CASE DESIGN Prepared by: Fatih Kızkun. OUTLINE Introduction –Importance of Test –Essential Test Case Development A Variety of Test Methods –Risk.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
System/Software Testing
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Testing Content Essence Terminology Classification –Unit, System … –BlackBox, WhiteBox Debugging IEEE Standards.
White-box Testing Black-box Testing Extensions
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Prof. Mohamed Batouche Software Testing.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Introduction to Software Testing
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
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.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
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.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
Software Construction Lecture 19 Software Testing-2.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Testing Data Structures Tao Xie Visiting Professor, Peking University Associate Professor, North Carolina State University
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
Dynamic Testing.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing I No reading Group meetings MidtermNo Section Testing II Progress report due Readings out Testing.
Chapter 17 Software Testing Techniques
Software Testing.
CS5123 Software Validation and Quality Assurance
Chapter 13 & 14 Software Testing Strategies and Techniques
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Verification and Validation
Software Verification and Validation
Software Verification and Validation
CSE403 Software Engineering Autumn 2000 More Testing
Software Testing “If you can’t test it, you can’t design it”
Software Verification and Validation
CSE 1020:Software Development
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001

Today Continue on with testing Understand the distinction between white-box and black- box testing Understand high-level basics of black-box Understand coverage issues in white-box

Discreteness It’s also important to remember that testing software is different from testing physical widgets –In general, physical widgets can be analyzed in terms of continuous mathematics –Software is based on discrete mathematics Why does this matter? In continuous math, a small change in an input corresponds to a small change in the output –This allows safety factors to be built in In discrete math, a small change in an input can correspond to a huge change in the output

Ken Butler “The only unit of change in a program is the whole program.” That is, if you change anything in a program, you should treat it as if you changed everything –Of course, this isn’t practical in all cases –But it’s a darned good model that captures the discrete nature of software

General observation I A goal of picking a test case is that it be characteristic of a class of other tests That is, one case builds confidence in how other cases will perform

General observation II The overall objective is to cover as much of the behavior space as possible –It’s generally infinite In general, it’s useful to distinguish the notions of common vs. unusual cases for testing

Black box testing Treat the unit (program, procedure, etc.) as a black box –You can hypothesize about the way it is built, but you can’t see it Depend on a specification, formal or informal, for determining whether it behaves properly How to pick cases that cover the space of behaviors for the unit? –Use heuristics

Equivalence partitioning Based on input conditions –If input conditions are specified as a range, you have one valid class (in the range) and two invalid classes (outside the range on each side) –If specified as a set, then you can be valid (in the set) or invalid (outside the set) –Etc.

Boundary values Problems tend to arise on the boundaries of input domains than in the middle So, extending equivalence partitioning, make sure to pick added test cases that exercise inputs near the boundaries of valid and invalid ranges

Others include Cause-effect graphing Data validation testing Syntax-direct testing …

White box testing In this approach, the tester has access to the actual software They needn’t guess at the structure of the code, since they can see it In this approach, the focus often shifts from how the code behaves to what parts of the code are exercised

White box coverage In black box, the tests are usually intended to cover the space of behavior In white box, the tests are usually intended to cover the space of parts of the program

Statement coverage One approach is to cover all statements –Develop a test suite that exercises all of a program’s statements What’s a statement? max = (x > y) ? x : b; if x > y then max := x else max :=y endif

Weakness Coverage may miss some obvious issues In this example (due to Ghezzi et al.) a single test (any negative number for x) covers all statements –But it’s not satisfying with respect to input condition coverage, for example if x < 0 then x := -x; endif; z := x;

Edge coverage Another approach is to use a control flow graph (CFG) representation of a program –Essentially, a flowchart Then ensure that the suite covers all edges in the CFG

Condition coverage Complex conditions can confound edge coverage if (p != NULL) and (p->left right) … Is this a single conditional statement in the CFG? How are short-circuit conditionals handled? –andthen, orelse

Path coverage Edge coverage is in some sense very static Edges can be covered without covering paths (sequences of edges) –These better model the actual execution

Example

Path coverage and loops In general, we can’t bound the number of times a loop executes So there are an unbounded number of paths in general –We resort to heuristics like those from black box testing to exercise these loops

Usefulness? Even with a CFG and statement coverage as testing techniques there is still a lot to be desired –How does one pick the proper input that will actually exercise a certain statement or path? –What about complex interactions with other system events and components? –Etc.

Some more practical aspects Who tests the tests, especially a large complicated test? –For example, if your triangle test program generates random data, who confirms the results? –Another example is testing trig functions. Testing the error cases can be a wider set of inputs. You have two problems –Making sure you have proper test coverage and –Making sure the results are correct. Fault injection is another way of testing systems. –For example, injecting I/O failures in a disk controller can test the error cases for the disk driver and file system. –Another example is injecting memory allocation errors, to see how programs behave when they run out of memory.

Final note on testing It’s unsound It’s heuristic –Heuristic doesn’t mean undisciplined It’s extremely useful and important Good testing requires a special mindset –“I’m going to make that sucker fail!” Good coding requires a special mindset –“Nobody’s going to break my code!”

Next time Wednesday –Group Project Work Day Friday –Bugs