CSE403 Software Engineering Autumn 2000 More Testing

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.
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.
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.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
System/Software Testing
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.
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
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.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Dynamic Testing.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
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.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing I No reading Group meetings MidtermNo Section Testing II Progress report due Readings out Testing.
Testing Data Structures
Chapter 17 Software Testing Techniques
Software Testing CS II: Data Structures & Abstraction
A Review of Software Testing - P. David Coward
Prepared by: Fatih Kızkun
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Equivalence partitioning
Testing Tutorial 7.
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Software Testing.
The Joy of Breaking Code Testing Logic and Case Selection
Chapter 9, Testing.
Software Testing Techniques
CompSci 230 Software Construction
Input Space Partition Testing CS 4501 / 6501 Software Testing
Verification and Testing
CS5123 Software Validation and Quality Assurance
Chapter 13 & 14 Software Testing Strategies and Techniques
Types of Testing Visit to more Learning Resources.
Testing Approaches.
White-Box Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
White-Box Testing.
Verification and Validation
Software testing.
CS 1111 Introduction to Programming Fall 2018
CSE 403 Lecture 13 Black/White-Box Testing Reading:
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Software Verification and Validation
Software Verification and Validation
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 2000 More Testing CSE 403 Autumn 2000 CSE403 Software Engineering Autumn 2000 More Testing Gary Kimura Lecture #14 October 25, 2000 October 25, 2000

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 < p->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 Bugs