Object-Oriented and Classical Software Engineering

Similar documents
Object-Oriented and Classical Software Engineering

TESTING. Overview Slide 6.2. Testing (contd) Slide 6.4. Testing Slide 6.3. Quality issues Non-execution-based testing

CHAPTER 6. Slide 6.1 TESTING

Correctness of specifications. Correctness. Correctness of specifications (2) Example of a Correctness Proof. Testing versus Correctness Proofs

Software Testing. Software Testing

Object-Oriented and Classical Software Engineering DESIGN 11/12/2017. CET/CSC490 Software Engineering Design CHAPTER 14. Stephen R. Schach.

Testing, Module To Object, Reusability

Object-Oriented and Classical Software Engineering

Object-Oriented and Classical Software Engineering

Object-Oriented and Classical Software Engineering THE TOOLS OF THE TRADE 9/22/2017. CHAPTER 5 Slide 5.2. Stephen R. Schach. Overview Slide 5.

Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code (contd)

Topics in Software Testing

Object-Oriented and Classical Software Engineering

Objectives. Chapter 19. Verification vs. validation. Topics covered. Static and dynamic verification. The V&V process

Verification and Validation. Verification and validation

Object-Oriented and Classical Software Engineering

Verification and Validation

Chapter 8. Achmad Benny Mutiara

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

SOFTWARE LIFE-CYCLE MODELS 2.1

Ingegneria del Software II academic year: Course Web-site: [

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

Part 5. Verification and Validation

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

Static and dynamic Testing

Static Analysis! Prof. Leon J. Osterweil! CS 520/620! Fall 2012! Characteristics of! System to be! built must! match required! characteristics!

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

Software Quality Assurance (SQA) Software Quality Assurance

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

1. Introduction and overview

Object-Oriented and Classical Software Engineering

Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 22 Slide 1

MONIKA HEINER.

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

Software Engineering (CSC 4350/6350) Rao Casturi

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

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo

Testing & Debugging TB-1

Software Engineering Fall 2014

Software Engineering and Scientific Computing

Assertions. Assertions - Example

Software Engineering Testing and Debugging Testing

S/W Programming & Languages

Chapter 8 Software Testing. Chapter 8 Software testing

Program Correctness and Efficiency. Chapter 2

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.

A Mini Challenge: Build a Verifiable Filesystem

Lectures 20, 21: Axiomatic Semantics

Implementation and Integration

CSc 225 Algorithms and Data Structures I Case Studies

Object-Oriented and Classical Software Engineering

Chapter 15 Debugging

Verification and Validation

Verification and Validation

SOFTWARE PRODUCT QUALITY SOFTWARE ENGINEERING SOFTWARE QUALITY SOFTWARE QUALITIES - PRODUCT AND PROCESS SOFTWARE QUALITY - QUALITY COMPONENTS

Digitized Engineering Notebook

Software Engineering

Hardware versus software

CS 160: Evaluation. Professor John Canny Spring /15/2006 1

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

Inspection Overview Massood Towhidnejad Computer & Software Engineering Dept. Embry-Riddle University

Certification Requirements for High Assurance Systems

Data & Procedure Reasoning about correctness

Software Testing. Testing: Our Experiences

Verification and Validation

Computational Systems COMP1209

Examining the Code. [Reading assignment: Chapter 6, pp ]

Key Features. Defect Rates. Traditional Unit testing: 25 faults / KLOC System testing: 25 / KLOC Inspections: / KLOC

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

CS 424 Software Quality Assurance & Testing LECTURE 3 BASIC CONCEPTS OF SOFTWARE TESTING - I

Quality Assurance = Testing? SOFTWARE QUALITY ASSURANCE. Meaning of Quality. How would you define software quality? Common Measures.

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

ASIC world. Start Specification Design Verification Layout Validation Finish

Formal Verification! Prof. Leon Osterweil! Computer Science 520/620! Spring 2012!

Test Driven Development (TDD)

18-642: Software Development Processes

Introduction to Software Testing

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

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

Leveraging Formal Methods for Verifying Models and Embedded Code Prashant Mathapati Application Engineering Group

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

WHITE PAPER. 10 Reasons to Use Static Analysis for Embedded Software Development

Darshan Institute of Engineering & Technology for Diploma Studies

COMPUTER FLOOD STANDARDS

Gradational conception in Cleanroom Software Development

Program Verification. Aarti Gupta

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

CS 160: Evaluation. Outline. Outline. Iterative Design. Preparing for a User Test. User Test

Introduction to Axiomatic Semantics (1/2)

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

The Integration Phase Canard. Integration and Testing. Incremental Integration. Incremental Integration Models. Unit Testing. Integration Sequencing

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

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

Static program checking and verification

Chapter 9 Quality and Change Management

Pearson Education 2007 Chapter 9 (RASD 3/e)

Finding Firmware Defects Class T-18 Sean M. Beatty

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

CITS5501 Software Testing and Quality Assurance Formal methods

Introduction to Axiomatic Semantics (1/2)

Transcription:

Slide 6.1 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach srs@vuse.vanderbilt.edu CHAPTER 6 Slide 6.2 TESTING 1

Overview Slide 6.3 Quality issues Non-execution-based testing Execution-based testing What should be tested? Testing versus correctness proofs Who should perform execution-based testing? When testing stops Testing Slide 6.4 There are two basic types of testing Execution-based testing Non-execution-based testing 2

Testing (contd) Slide 6.5 V & V Verification Determine if the workflow was completed correctly Validation Determine if the product as a whole satisfies its requirements Testing (contd) Slide 6.6 Warning The term verify is also used for all non-executionbased testing 3

6.1 Software Quality Slide 6.7 Not excellence The extent to which software satisfies its specifications Every software professional is responsible for ensuring that his or her work is correct Quality must be built in from the beginning 6.1.1 Software Quality Assurance Slide 6.8 The members of the SQA group must ensure that the developers are doing high-quality work At the end of each workflow When the product is complete In addition, quality assurance must be applied to The process itself Example: Standards 4

6.1.2 Managerial Independence Slide 6.9 There must be managerial independence between The development group The SQA group Neither group should have power over the other Managerial Independence (contd) Slide 6.10 More senior management must decide whether to Deliver the product on time but with faults, or Test further and deliver the product late The decision must take into account the interests of the client and the development organization 5

6.2 Non-Execution-Based Testing Slide 6.11 Underlying principles We should not review our own work Group synergy 6.2.1 Walkthroughs Slide 6.12 A walkthrough team consists of from four to six members It includes representatives of The team responsible for the current workflow The team responsible for the next workflow The SQA group The walkthrough is preceded by preparation Lists of items Items not understood Items that appear to be incorrect 6

6.2.2 Managing Walkthroughs Slide 6.13 The walkthrough team is chaired by the SQA representative In a walkthrough we detect faults, not correct them A correction produced by a committee is likely to be of low quality The cost of a committee correction is too high Not all items flagged are actually incorrect A walkthrough should not last longer than 2 hours There is no time to correct faults as well Managing Walkthroughs (contd) Slide 6.14 A walkthrough must be document-driven, rather than participant-driven Verbalization leads to fault finding A walkthrough should never be used for performance appraisal 7

6.2.3 Inspections Slide 6.15 An inspection has five formal steps Overview Preparation, aided by statistics of fault types Inspection Rework Follow-up Inspections (contd) Slide 6.16 An inspection team has four members Moderator A member of the team performing the current workflow A member of the team performing the next workflow A member of the SQA group Special roles are played by the Moderator Reader Recorder 8

Fault Statistics Slide 6.17 Faults are recorded by severity Example: Major or minor Faults are recorded by fault type Examples of design faults: Not all specification items have been addressed Actual and formal arguments do not correspond Fault Statistics (contd) Slide 6.18 For a given workflow, we compare current fault rates with those of previous products We take action if there are a disproportionate number of faults in an artifact Redesigning from scratch is a good alternative We carry forward fault statistics to the next workflow We may not detect all faults of a particular type in the current inspection 9

Statistics on Inspections Slide 6.19 IBM inspections showed up 82% of all detected faults (1976) 70% of all detected faults (1978) 93% of all detected faults (1986) Switching system 90% decrease in the cost of detecting faults (1986) JPL Four major faults, 14 minor faults per 2 hours (1990) Savings of $25,000 per inspection The number of faults decreased exponentially by phase (1992) Statistics on Inspections (contd) Slide 6.20 Warning Fault statistics should never be used for performance appraisal Killing the goose that lays the golden eggs 10

6.2.4 Comparison of Inspections and Walkthroughs Slide 6.21 Inspection Two-step, informal process Preparation Analysis Walkthrough Five-step, formal process Overview Preparation Inspection Rework Follow-up 6.2.5 Strengths and Weaknesses of Reviews Slide 6.22 Reviews can be effective Faults are detected early in the process Reviews are less effective if the process is inadequate Large-scale software should consist of smaller, largely independent pieces The documentation of the previous workflows has to be complete and available online 11

6.2.6 Metrics for Inspections Slide 6.23 Inspection rate (e.g., design pages inspected per hour) Fault density (e.g., faults per KLOC inspected) Fault detection rate (e.g., faults detected per hour) Fault detection efficiency (e.g., number of major, minor faults detected per hour) Metrics for Inspections (contd) Slide 6.24 Does a 50% increase in the fault detection rate mean that Quality has decreased? Or The inspection process is more efficient? 12

6.3 Execution-Based Testing Slide 6.25 Organizations spend up to 50% of their software budget on testing But delivered software is frequently unreliable Dijkstra (1972) Program testing can be a very effective way to show the presence of bugs, but it is hopelessly inadequate for showing their absence 6.4 What Should Be Tested? Slide 6.26 Definition of execution-based testing The process of inferring certain behavioral properties of the product based, in part, on the results of executing the product in a known environment with selected inputs This definition has troubling implications 13

6.4 What Should Be Tested? (contd) Slide 6.27 Inference We have a fault report, the source code, and often nothing else Known environment We never can really know our environment Selected inputs Sometimes we cannot provide the inputs we want Simulation is needed 6.4 What Should Be Tested? (contd) Slide 6.28 We need to test correctness (of course), and also Utility Reliability Robustness, and Performance 14

6.4.1 Utility Slide 6.29 The extent to which the product meets the user s needs Examples: Ease of use Useful functions Cost effectiveness 6.4.2 Reliability Slide 6.30 A measure of the frequency and criticality of failure Mean time between failures Mean time to repair Time (and cost) to repair the results of a failure 15

6.4.3 Robustness Slide 6.31 A function of The range of operating conditions The possibility of unacceptable results with valid input The effect of invalid input 6.4.4 Performance Slide 6.32 The extent to which space and time constraints are met Real-time software is characterized by hard realtime constraints If data are lost because the system is too slow There is no way to recover those data 16

6.4.5 Correctness Slide 6.33 A product is correct if it satisfies its specifications Correctness of specifications Slide 6.34 Incorrect specification for a sort: Figure 6.1 Function tricksort which satisfies this specification: Figure 6.2 17

Correctness of specifications (contd) Slide 6.35 Incorrect specification for a sort: Figure 6.1 (again) Corrected specification for the sort: Figure 6.3 Correctness (contd) Slide 6.36 Technically, correctness is Not necessary Example: C++ compiler Not sufficient Example: tricksort 18

6.5 Testing versus Correctness Proofs Slide 6.37 A correctness proof is an alternative to executionbased testing 6.5.1 Example of a Correctness Proof Slide 6.38 The code segment to be proven correct Figure 6.4 19

Example of a Correctness Proof (contd) Slide 6.39 A flowchart equivalent of the code segment Figure 6.5 Example of a Correctness Proof (contd) Slide 6.40 Add Input specification Output specification Loop invariant Assertions (See next slide) 20

Example of a Correctness Proof (contd) Slide 6.41 Figure 6.6 Example of a Correctness Proof (contd) Slide 6.42 An informal proof (using induction) appears in Section 6.5.1 21

6.5.2 Correctness Proof Mini Case Study Slide 6.43 Dijkstra (1972): The programmer should let the program proof and program grow hand in hand Naur text-processing problem (1969) Naur Text-Processing Problem Slide 6.44 Given a text consisting of words separated by a blank or by newline characters, convert it to line-byline form in accordance with the following rules: Line breaks must be made only where the given text contains a blank or newline Each line is filled as far as possible, as long as No line will contain more than maxpos characters 22

Episode 1 Slide 6.45 Naur constructed a 25-line procedure He informally proved its correctness Episode 2 Slide 6.46 1970 Reviewer in Computing Reviews The first word of the first line is preceded by a blank unless the first word is exactly maxpos characters long 23

Episode 3 Slide 6.47 1971 London finds 3 more faults Including: The procedure does not terminate unless a word longer than maxpos characters is encountered Episode 4 Slide 6.48 1975 Goodenough and Gerhart find three further faults Including: The last word will not be output unless it is followed by a blank or newline 24

Correctness Proof Mini Case Study (contd) Slide 6.49 Lesson: Even if a product has been proven correct, it must still be tested 6.5.3 Correctness Proofs and Software Engineering Slide 6.50 Three myths of correctness proving (see over) 25

Three Myths of Correctness Proving Slide 6.51 Software engineers do not have enough mathematics for proofs Most computer science majors either know or can learn the mathematics needed for proofs Proving is too expensive to be practical Economic viability is determined from cost benefit analysis Proving is too hard Many nontrivial products have been successfully proven Tools like theorem provers can assist us Difficulties with Correctness Proving Slide 6.52 Can we trust a theorem prover? Figure 6.7 26

Difficulties with Correctness Proving (contd) Slide 6.53 How do we find input output specifications, loop invariants? What if the specifications are wrong? We can never be sure that specifications or a verification system are correct Correctness Proofs and Software Engineering (contd) Slide 6.54 Correctness proofs are a vital software engineering tool, where appropriate: When human lives are at stake When indicated by cost benefit analysis When the risk of not proving is too great Also, informal proofs can improve the quality of the product Use the assert statement 27

6.6 Who Should Perform Execution-Based Testing? Slide 6.55 Programming is constructive Testing is destructive A successful test finds a fault So, programmers should not test their own code artifacts Who Should Perform Execution-Based Testing? (contd) Slide 6.56 Solution: The programmer does informal testing The SQA group then does systematic testing The programmer debugs the module All test cases must be Planned beforehand, including the expected output, and Retained afterwards 28

6.7 When Testing Stops Slide 6.57 Only when the product has been irrevocably discarded 29