Download Slides - Introduction to Testing - Foundations of Software Engineering | CSCI 5828 and more Study notes Software Engineering in PDF only on Docsity! Lecture 13: Introduction to Testing Kenneth M. Anderson Foundations of Software Engineering CSCI 5828 - Spring Semester, 2000 February 29, 2000! ' Kenn eth M. Anderson, 2000 2 Today’s Lecture • Introduction to – Testing concepts – Testing terminology – Testing Strategies February 29, 2000! ' Kenn eth M. Anderson, 2000 3 Testing • Experiments with Behavior • Requires Execution Model • Executing a System to Observe its Behavior Can be Expensive • Testing is “Easy” if the System is Deterministic and Takes No Inputs • Exhaustive Testing is Usually Impractical February 29, 2000! ' Kenn eth M. Anderson, 2000 4 Modeling for Software Testing • Formal Models of Programs Are Employed – To make the process of testing programs systematic – To increase the probability that testing will reveal faults February 29, 2000! ' Kenn eth M. Anderson, 2000 5 Testing Formalized: Basics • Let P be a program, D be the input domain of P, and R be the output range of P; P acts as a function P : D → R • Let RO denote the requirements on output values of P, as stated in P’s specification; P is correct iff for all d ∈ D, P(d) satisfies RO February 29, 2000! ' Kenn eth M. Anderson, 2000 6 Testing Formalized: Basics • An error (or defect) is demonstrated by showing that P(d) is incorrect for some d • A failure is a symptom of an error • A fault is an incorrect intermediate state • A failure occurs only if a fault occurs, and a fault occurs only if an error exists February 29, 2000! ' Kenn eth M. Anderson, 2000 7 Testing Formalized: Test Cases • A test case is an element d of D • A test set T is a finite subset of D • P is correct for T if it is correct for all elements of T; T is called successful for P • T is ideal if, whenever P is incorrect, there exists d ∈ T such that P is incorrect for d • If T is ideal and T is successful for P, then P is correct February 29, 2000! ' Kenn eth M. Anderson, 2000 8 Testing Formalized: Test Selection • A test selection criterion C is a subset of 2D (the set of all finite subsets of D); C gives a condition that must be satisfied by a test set • T satisfies C if it belongs to C • C is consistent if, for any pair T1 and T2, both satisfying C, T1 is successful iff T2 is successful