(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt

Similar documents
Verification Overview Testing Theory and Principles Testing in Practice. Verification. Miaoqing Huang University of Arkansas 1 / 80

SFWR ENG 3S03: Software Testing

Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn. 4. Testing

Topics in Software Testing

Introduction to Dynamic Analysis

MONIKA HEINER.

INTRODUCTION TO SOFTWARE ENGINEERING

10. Software Testing Fundamental Concepts

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

An Introduction to Systematic Software Testing. Robert France CSU

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

Software Testing. Software Testing

Software Testing. Massimo Felici IF

Program Analysis. Program Analysis

Quality Assurance in Software Development

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems)

White-Box Testing Techniques

Lecture 15 Software Testing

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Verification Black-box Testing & Testing in the Large

Chapter 10. Testing and Quality Assurance

Ingegneria del Software Corso di Laurea in Informatica per il Management

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Theme 2 Program Design and Testing

CS 520 Theory and Practice of Software Engineering Fall 2018

Aerospace Software Engineering

People tell me that testing is

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Terminology. There are many different types of errors and different ways how we can deal with them.

Using the code to measure test adequacy (and derive test cases) Structural Testing

Program Verification! Goals of this Lecture! Words from the Wise! Testing!

Part 5. Verification and Validation

Getting those Bugs Out --Software Testing

Testing & Debugging TB-1

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Second assignment came out Monday evening. Find defects in Hnefetafl rules written by your classmates. Topic: Code Inspection and Testing

Software Quality Assurance. David Janzen

Software Testing part II (white box) Lecturer: Giuseppe Santucci

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak

Reading assignment: Reviews and Inspections

Design and Synthesis for Test

Software Engineering and Scientific Computing

Page 1. Reading assignment: Reviews and Inspections. Foundations for SE Analysis. Ideally want general models. Formal models

The Importance of Test

Testing: Coverage and Structural Coverage

Darshan Institute of Engineering & Technology Unit : 9

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Verification and Validation

Verification and Validation

White Box Testing III

Chapter 8 Software Testing. Chapter 8 Software testing

Testing: Coverage and Structural Coverage

Software testing A.A. 2018/2019

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 9, Testing

Warm-Up Problem. Let be a set of well-formed Predicate logic formulas. Let be well-formed Predicate logic formulas. Prove or disprove the following.

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia

Specification and Analysis of Contracts Tutorial

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Programming Embedded Systems

Write perfect C code to solve the three problems below.

Software Testing: Introduction

Software Quality Assurance & Testing

Software Testing CS 408

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

Testing: Test design and testing process

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Software Engineering (CSC 4350/6350) Rao Casturi

Testing is executing a system in order to identify any gaps, errors, or missing requirements in contrary to the actual requirements.

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing?

Test design techniques

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015

Testing. UW CSE 160 Winter 2016

Monitoring Interfaces for Faults

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing

Testing & Continuous Integration. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/19/2010

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

Testing Process and Methods. CS 490MT/5555, Spring 2017, Yongjie Zheng

Comparison Study of Software Testing Methods and Levels- A Review

CMSC 132: OBJECT-ORIENTED PROGRAMMING II

Sample Exam Syllabus

Test Cases Generation from UML Activity Diagrams

Software Engineering Fall 2014

Regression testing. Whenever you find a bug. Why is this a good idea?

7. Testing and Debugging Concurrent Programs

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification and Validation: Goals

Bridge Course On Software Testing

The testing process. Component testing. System testing

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus

Darshan Institute of Engineering & Technology for Diploma Studies

Software Testing. Testing: Our Experiences

Software Engineering

Software Testing for Developer Development Testing. Duvan Luong, Ph.D. Operational Excellence Networks

Transcription:

Verification (See related materials in textbook.) Outline What are the goals of verification? What are the main approaches to verification? What kind of assurance do we get through testing? How can testing be done systematically? How can we remove defects (debugging)? What are the main approaches to software analysis? informal vs. formal 1

Need for verification Designers are fallible even if they are skilled and follow sound principles Everything must be verified, every required quality, process and products even verification itself Correctness: must have point of reference Design is correct wrt requirements Code is correct wrt design, requirements Code correctness: does a program work as expected for a given set of inputs Properties of verification May not be binary (e.g., right, wrong) severity of defect is important some defects may be tolerated May be subjective or objective e.g., usability Even implicit qualities should be verified because requirements are often incomplete e.g., robustness 2

Approaches to verification Experiment with behavior of product sample behaviors via testing goal is to find "counterexamples" dynamic technique Analyze product to deduce its adequacy analytic study of properties static technique Testing and lack of "continuity" Testing samples behaviors by examining "test cases" Impossible to extrapolate behavior of software from a finite set of test cases No continuity of behavior it can exhibit correct behavior in infinitely many cases, but may still be incorrect in some cases 3

Verification in engineering Example of bridge design One test assures infinite correct situations procedure binary-search (key: in element; table: in elementtable; found: out Boolean) is begin bottom := table'first; top := table'last; while bottom < top loop if (bottom + top) rem 2 0 then middle := (bottom + top - 1) / 2; else middle := (bottom + top) / 2; end if; if key table (middle) then top := middle; else bottom := middle + 1; end if; end loop; found := key = table (top); end binary-search if we omit this line, then the routine works if the else is never hit! (i.e. if size of table is a power of 2) 4

Goals of testing Show the presence of bugs (Dijkstra, 1987) If a test does not detect a failure, then CANNOT conclude that software is defectfree Still, we need to do testing driven by sound and systematic principles Goals of testing (cont.) Should help isolate errors to facilitate debugging Should be repeatable repeating the same experiment, we should get the same results this may not be true because of the effect of execution environment on testing because of nondeterminism Should be accurate 5

Theoretical foundations of testing Definitions (1) We view a program to test as a function when invoked with some input d D produces some output r R P: D R (may be partial) P (program), D (input domain), R (output domain, i.e., range) Correctness defined by an output relation, O R O R D R P(d) correct if <d, P(d)> O R P is correct if all P(d) are correct Note: Ghezzi uses OR representation for Output Relation (We use to O R avoid confusion with logical operator.) 6

Definitions (2) FAILURE P(d) is not correct may be undefined (error state) or may be the wrong result ERROR (DEFECT) anything that may cause a failure typing mistake programmer forgot to test x = 0 FAULT incorrect intermediate state entered by program Test case t an element of D Test set T Definitions (3) a finite subset of D Test is successful (passed) if P(t) is correct Test set successful (passed) if P is correct for all t in T passed term used by 7

Definitions (4) Ideal test set T if P is incorrect, then there is an element of T such that P(d) is incorrect if an ideal test set exists for any program, we could prove program correctness by testing Test criterion A test selection criterion C specifies conditions that must be specified by a test set. C defines finite subsets of domain D (test sets) C 2 D F, where 2D F denotes all finite subsets of D A test set T satisfies C if it is an element of C Example C = {<x 1, x 2,..., x n > n 3 i, j, k, ( x i <0 x j =0 x k >0)} <-5, 0, 22> is a test set that satisfies C <-10, 2, 8, 33, 0, -19> also does <1, 3, 99> does not 8

Properties of criteria (1) C is consistent for any pairs T1, T2 satisfying C, T1 is successful iff T2 is successful so either of them provides the same information C is complete if P is incorrect, then there is a test set T of C that is not successful C is complete and consistent identifies an ideal test set enables correctness to be proved! Properties of criteria (2) C1 is finer-grained than C2 for any program P for any T1 satisfying C1 there is a subset T2 of T1 which satisfies C2 9

Properties of definitions None is effective, i.e., no algorithms exist to state if a program, test set, or criterion has that property In particular, there is no algorithm to derive a test set that would prove program correctness there is no constructive criterion that is consistent and complete Empirical testing principles Attempted compromise between the impossible and the inadequate Find strategy to select significant test cases significant=has high potential of uncovering presence of error 10

Complete-Coverage Principle Try to group elements of D into subdomains D 1, D 2,, D n where any element of each D i is likely to have similar behavior D = D 1 D 2 D n Select one test as a representative of the subdomain If D j D k = for all j, k (partition), any element can be chosen from each subdomain Otherwise choose representatives to minimize number of tests, yet fulfilling the principle Complete-Coverage Principle example of a partition 11

Testing in the small We test individual modules BLACK BOX (functional) testing partitioning criteria based on the module s specification tests what the program is supposed to do WHITE BOX (structural) testing partitioning criteria based on module s internal code tests what the program does 12