(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 1 Functional testing.

Slides:



Advertisements
Similar presentations
Properties of Least Squares Regression Coefficients
Advertisements

Lecture 8: Testing, Verification and Validation
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.
Design Concepts and Principles
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
Testing: Who 3, What 4, Why 1, When 2, How 5 Lian Yu, Peking U. Michal Young, U. Oregon.
1 CODE TESTING Principles and Alternatives. 2 Testing - Basics goal - find errors –focus is the source code (executable system) –test team wants to achieve.
(c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Fault-Based Testing.
(c) 2007 Mauro Pezzè & Michal Young Ch 24, slide 1 Documenting Analysis and Test.
(c) 2007 Mauro Pezzè & Michal Young Ch 1, slide 1 Software Test and Analysis in a Nutshell.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
(c) 2007 Mauro Pezzè & Michal Young Ch 3, slide 1 Basic Principles.
Software Testing & Strategies
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Black-Box Testing Techniques I Software Testing Lecture 4.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
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.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
1 Principles of Computer Science I Prof. Nadeem Abdul Hamid CSC 120 – Fall 2005 Lecture Unit 10 - Testing.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
Black-Box Testing Techniques I
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
INF 111 / CSE 121: Software Tools and Methods Lecture Notes for Fall Quarter, 2007 Michele Rousseau Set 12 (Some slides adapted from Sommerville 2000 &
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Software Construction Lecture 18 Software Testing.
Testing Techniques Software Testing Module ( ) Dr. Samer Hanna.
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.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing III No reading Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Sampling Concepts Nursing Research. Population  Population the group you are ultimately interested in knowing more about “entire aggregation of cases.
SOFTWARE TESTING. SOFTWARE Software is not the collection of programs but also all associated documentation and configuration data which is need to make.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
 System Requirement Specification and System Planning.
SE 433/333 Software Testing & Quality Assurance Dennis Mumaugh, Instructor Office: CDM, Room 428 Office Hours: Tuesday, 4:00 –
Functional testing, Equivalence class testing
Software Testing.
Black Box Testing PPT Sources: Code Complete, 2nd Ed., Steve McConnell
Software Testing Techniques
Input Space Partition Testing CS 4501 / 6501 Software Testing
Software Development Cycle
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Lecture 09:Software Testing
CS240: Advanced Programming Concepts
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
Software Testing.
Software Development Cycle
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 1 Functional testing

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 2 Learning objectives Understand the rationale for systematic (non- random) selection of test cases –Understand the basic concept of partition testing and its underlying assumptions Understand why functional test selection is a primary, base-line technique –Why we expect a specification-based partition to help select valuable test cases Distinguish functional testing from other systematic testing techniques

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 3 Functional testing Functional testing: Deriving test cases from program specifications Functional refers to the source of information used in test case design, not to what is tested Also known as: –specification-based testing (from specifications) –black-box testing (no view of the code) Functional specification = description of intended program behavior –either formal or informal

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 4 Systematic vs Random Testing Random (uniform): –Pick possible inputs uniformly –Avoids designer bias A real problem: The test designer can make the same logical mistakes and bad assumptions as the program designer (especially if they are the same person) –But treats all inputs as equally valuable Systematic (non-uniform): –Try to select inputs that are especially valuable –Usually by choosing representatives of classes that are apt to fail often or not at all Functional testing is systematic testing

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 5 Why Not Random? Non-uniform distribution of faults Example: Java class “roots” applies quadratic equation Incomplete implementation logic: Program does not properly handle the case in which b 2 - 4ac =0 and a=0 Failing values are sparse in the input space — needles in a very big haystack. Random sampling is unlikely to choose a=0.0 and b=0.0

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 6 Consider the purpose of testing... To estimate the proportion of needles to hay, sample randomly –Reliability estimation requires unbiased samples for valid statistics. But that’s not our goal! To find needles and remove them from hay, look systematically (non-uniformly) for needles –Unless there are a lot of needles in the haystack, a random sample will not be effective at finding them –We need to use everything we know about needles, e.g., are they heavier than hay? Do they sift to the bottom?

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 7 Systematic Partition Testing Failure (valuable test case) No failure Failures are sparse in the space of possible inputs but dense in some parts of the space If we systematically test some cases from each part, we will include the dense parts Functional testing is one way of drawing pink lines to isolate regions with likely failures The space of possible input values (the haystack)

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 8 The partition principle Exploit some knowledge to choose samples that are more likely to include “special” or trouble-prone regions of the input space –Failures are sparse in the whole input space... –... but we may find regions in which they are dense (Quasi*-)Partition testing: separates the input space into classes whose union is the entire space »*Quasi because: The classes may overlap Desirable case: Each fault leads to failures that are dense (easy to find) in some class of inputs –sampling each class in the quasi-partition selects at least one input that leads to a failure, revealing the fault –seldom guaranteed; we depend on experience-based heuristics

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 9 Functional testing: exploiting the specification Functional testing uses the specification (formal or informal) to partition the input space –E.g., specification of “roots” program suggests division between cases with zero, one, and two real roots Test each category, and boundaries between categories –No guarantees, but experience suggests failures often lie at the boundaries (as in the “roots” program)

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 10 Why functional testing? The base-line technique for designing test cases –Timely Often useful in refining specifications and assessing testability before code is written –Effective finds some classes of fault (e.g., missing logic) that can elude other approaches –Widely applicable to any description of program behavior serving as spec at any level of granularity from module to system testing. –Economical typically less expensive to design and execute than structural (code-based) test cases

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 11 Early functional test design Program code is not necessary –Only a description of intended behavior is needed –Even incomplete and informal specifications can be used Although precise, complete specifications lead to better test suites Early functional test design has side benefits –Often reveals ambiguities and inconsistency in spec –Useful for assessing testability And improving test schedule and budget by improving spec –Useful explanation of specification or in the extreme case (as in XP), test cases are the spec

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 12 Functional versus Structural: Classes of faults Different testing strategies (functional, structural, fault-based, model-based) are most effective for different classes of faults Functional testing is best for missing logic faults –A common problem: Some program logic was simply forgotten –Structural (code-based) testing will never focus on code that isn’t there!

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 13 Functional vs structural test: granularity levels Functional test applies at all granularity levels: –Unit (from module interface spec) –Integration (from API or subsystem spec) –System (from system requirements spec) –Regression (from system requirements + bug history) Structural (code-based) test design applies to relatively small parts of a system: –Unit –Integration

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 14 Steps: From specification to test cases 1. Decompose the specification –If the specification is large, break it into independently testable features to be considered in testing 2. Select representatives –Representative values of each input, or –Representative behaviors of a model –Often simple input/output transformations don’t describe a system. We use models in program specification, in program design, and in test design 3. Form test specifications –Typically: combinations of input values, or model behaviors 4. Produce and execute actual tests

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 15 From specification to test cases

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 16 Simple example: Postal code lookup Input: ZIP code (5-digit US Postal code) Output: List of cities What are some representative values (or classes of value) to test?

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 17 Example: Representative values Correct zip code –With 0, 1, or many cities Malformed zip code –Empty; 1-4 characters; 6 characters; very long –Non-digit characters –Non-character data Simple example with one input, one output Note prevalence of boundary values (0 cities, 6 characters) and error cases

(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 18 Summary Functional testing, i.e., generation of test cases from specifications is a valuable and flexible approach to software testing –Applicable from very early system specs right through module specifications (quasi-)Partition testing suggests dividing the input space into (quasi-)equivalent classes –Systematic testing is intentionally non-uniform to address special cases, error conditions, and other small places –Dividing a big haystack into small, hopefully uniform piles where the needles might be concentrated