Cs205: engineering software university of virginia fall 2006 Validation David Evans www.cs.virginia.edu/cs205.

Slides:



Advertisements
Similar presentations
Cs205: engineering software university of virginia fall 2006 Specifying Procedures David Evans
Advertisements

David Evans CS201j: Engineering Software? University of Virginia Computer Science Lecture 3: Abstraction by Specification.
HIV/AIDS Infection and Cell Organelles. Activity 16: HIV/AIDS Infection and Cell Organelles LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be.
World Health and Sustainability
David Evans CS201j: Engineering Software? University of Virginia Computer Science Lecture 2: Java Semantics, Validation.
IMPORTANT READ CAREFULLY BEFORE USING THIS PRODUCT LICENSE AGREEMENT AND LIMITED WARRANTY BY INSTALLING OR USING THE SOFTWARE, FILES OR OTHER ELECTRONIC.
David Evans CS655: Programming Languages University of Virginia Computer Science Lecture 19: Minding Ps & Qs: Axiomatic.
Using Fossil Evidence to Investigate Whale Evolution
Cs2220: Engineering Software Class 5: Validation Fall 2010 University of Virginia David Evans.
Changes Due to Population Growth. Activity 15: Changes Due to Population Growth LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only.
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
Describing Syntax and Semantics
1 Module 10 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
A Genetically Modified Solution?
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
What Do Specialized Cells Do?
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Activity 11 Genomics.
Contract Review.  1. The final step in the vendor contracting process should be getting the vendor’s standard written contract and signing the contract.
CMSC 345 Fall 2000 Unit Testing. The testing process.
DIRC Workshop on Software Quality and the Legal System 13 February 2004, Gray's Inn, London LEGAL ASPECTS OF SOFTWARE PROCUREMENT Jos Dumortier University.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
Energy Flow Through an Ecosystem
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
CSE 219 Computer Science III Testing. Testing vs. Debugging Testing: Create and use scenarios which reveal incorrect behaviors –Design of test cases:
EECE 310: Software Engineering Testing / Validation.
Investigating Population Growth Rates
NRCCL (University of Oslo, Faculty of Law) Copyleft and Open Source Jon Bing Notrwegian Research Center for Computers and Law Master Lecture 13 October.
Something to amuse you… CS UWO minutes.
Mitosis and Asexual Reproduction
Permission to reprint or distribute any content from this presentation requires the prior written approval of Standard & Poor’s. Copyright © 2014 by Standard.
World Health Proposal. Activity 18: World Health Proposal LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
White-box Testing.
Our Global Community. Activity 1: Our Global Community LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently.
Cs2220: Engineering Software Class 6: Defensive Programming Fall 2010 University of Virginia David Evans.
David Evans These slides: Introduction to Static Analysis.
DNA Replication. Activity 12: DNA Replication LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently teaching.
David Evans CS551/651: Dependable Computing University of Virginia Computer Science Static Analysis.
International Telecommunication Union New Delhi, India, December 2011 ITU Workshop on Standards and Intellectual Property Rights (IPR) Issues Philip.
Changing Databases This presentation gives a quick overview on how to change databases in Osprey.
(1) A beginners guide to testing Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Life in Other Countries. Activity 2: Life in Other Countries LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently.
Cs205: engineering software university of virginia fall 2006 Introducing Java David Evans Don’t forget to your registration.
Ecosystem Change and Resiliency. Activity 17: Ecosystem Change and Resiliency LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only.
A Model Membrane. Activity 7: A Model Membrane LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently teaching.
LIMITED LICENSE TO MODIFY
Software Construction Lecture 19 Software Testing-2.
Stem Cell Research. Activity 15: Stem Cell Research LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently teaching.
Respiring Beans. Activity 10: Respiring Beans LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently teaching.
The Tragedy of the Commons. Activity 5: The Tragedy of the Commons LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers.
Biopharming Edible Vaccines. Activity 19: Biopharming Edible Vaccines LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers.
What Is a Cell?. Activity 3: What Is a Cell? LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently teaching the.
Producers and Consumers. Activity 6: Producers and Consumers LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently.
Sustainability Case Studies. Activity 3: Sustainability Case Studies LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers.
Stem Cell Differentiation. Activity 14: Stem Cell Differentiation LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers.
Functions of Proteins in Cells. Activity 10: Functions of Proteins in Cells LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by.
Cs205: engineering software university of virginia fall 2006 Programming Exceptionally David Evans
Ideas about Evolution. Activity 14: Ideas about Evolution LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently.
Permission to reprint or distribute any content from this presentation requires the prior written approval of Standard & Poor’s. Copyright © 2011 Standard.
35 A License to Learn. LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only by teachers currently teaching the SEPUP course to customize.
Evidence from the Fossil Record. Activity 6: Evidence from the Fossil Record LIMITED LICENSE TO MODIFY. These PowerPoint® slides may be modified only.
Structural testing, Path Testing
Testing Recap Testing can find problems, but cannot prove your program works Since exhaustive testing is impossible, select test cases with maximum likelihood.
Lecture 4: Data Abstraction CS201j: Engineering Software
The Zoo of Software Security Techniques
Basic Concepts of Algorithm
Lecture 2: Java Semantics, Validation CS201j: Engineering Software?
Presentation transcript:

cs205: engineering software university of virginia fall 2006 Validation David Evans

2 cs205: engineering software Dictionary Definition val·i·date 1.To declare or make legally valid. 2.To mark with an indication of official sanction. 3.To establish the soundness of; corroborate. Can we do any of these with software?

3 cs205: engineering software Java’s License READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT.

4 cs205: engineering software Java’s License 5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. …

5 cs205: engineering software Java’s License 2. RESTRICTIONS. … Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. You acknowledge that Software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Sun disclaims any express or implied warranty of fitness for such uses.

6 cs205: engineering software Software Validation Process designed to increase our confidence that a program works as intended For complex programs, cannot often make guarantees This is why typical software licenses don’t make any claims about their program working

7 cs205: engineering software Increasing Confidence Testing –Run the program on set of inputs and check the results Verification –Argue formally or informally that the program always works as intended Analysis –Poor programmer’s verification: examine the source code to increase confidence that it works as intended

8 cs205: engineering software Testing and Fishing Using some successful tests to conclude that a program has no bugs, is like concluding there are no fish in the lake because you didn’t catch one!

9 cs205: engineering software Exhaustive Testing Test all possible inputs PS1: 50x50 grid, all cells can be either dead or alive before starting = But that’s not all: all possible start stop step clicks, different platforms, how long to you need to run it, etc.

10 cs205: engineering software Selective Testing We can’t test everything, pick test cases with high probability of finding flaws Black-Box Testing: design tests looking only at specification Glass-Box Testing: design tests looking at code –Path-complete: at least one test to exercise each path through code

11 cs205: engineering software Black-Box Testing Test all paths through the specification public CellState getNextState () // MODIFIES: this // EFFECTS: Returns the next state for this cell. If a cell is currently // dead cell and has three live neighbors, then it becomes a live cell. // If a cell is currently alive and has two or three live neighbors it // remains alive. Otherwise, the cell dies.

12 cs205: engineering software Test all paths through the specification: 1.currently dead, three live neighbors 2.currently alive, two live neighbors 3.currently alive, three live neighbors 4.currently dead, < 3 live neighbors 5.currently dead, > 3 live neighbors 6.currently alive, < 2 live neighbors 7.currently alive, > 3 live neighbors public CellState getNextState () // MODIFIES: this // EFFECTS: Returns the next state for this cell. If a cell is currently // dead cell and has three live neighbors, then it becomes a live cell. // If a cell is currently alive and has two or three live neighbors it // remains alive. Otherwise, the cell dies.

13 cs205: engineering software Black-Box Testing Test all (7) paths through the specification Test boundary conditions 1.all neighbors are dead 2.all neighbors are alive 3.cell is at a corner of the grid 4.cell is at an edge of the grid public CellState getNextState () // MODIFIES: this // EFFECTS: Returns the next state for this cell. If a cell is currently // dead cell and has three live neighbors, then it becomes a live cell. // If a cell is currently alive and has two or three live neighbors it // remains alive. Otherwise, the cell dies.

14 cs205: engineering software Glass-Box Testing public CellState getNextState() { int countalive = 0; Enumeration neighbors = getNeighbors(); while (neighbors.hasMoreElements()) { SimObject neighbor = neighbors.nextElement(); if (neighbor instanceof Cell) { Cell cell = (Cell) neighbor; if (cell.isAlive()) { countalive++; } } if (countalive == 3) { return CellState.createAlive (); } else if (getState ().isAlive () && countalive == 2) { return CellState.createAlive (); } else { return CellState.createDead (); } } How many paths are there through this code?

15 cs205: engineering software Path-Complete Testing Insufficient –Often, bugs are missing paths Impossible –Most programs have an infinite number of paths –Loops and recursion Test with zero, one and several iterations –Branching Can test all paths

16 cs205: engineering software How many paths? if (countalive == 3) { return CellState.createAlive (); } else if (getState ().isAlive () && countalive == 2) { return CellState.createAlive (); } else { return CellState.createDead (); }

17 cs205: engineering software Testing Recap Testing can find problems, not to prove your program works –Since exhaustive testing is impossible, select test cases with maximum probability of finding bugs –A successful test case is one that reveals a bug in your program! Typically at least 40% of cost of software project is testing, often ~80% of cost for safety-critical software

18 cs205: engineering software Quizzing

19 cs205: engineering software Testing Recap Testing can find problems, but can’t prove your program works –Since exhaustive testing is impossible, select test cases with maximum probability of finding bugs –A successful test case is one that reveals a bug in your program! If we can’t test all possible paths through a program, how can we increase our confidence that it works?

20 cs205: engineering software Analysis Make claims about all possible paths by examining the program code directly, not executing it Use formal semantics of programming language to know what things mean Use formal specifications of procedures to know that they do

21 cs205: engineering software Hopelessness of Analysis It is impossible to correctly determine if any interesting property is true for an arbitrary program! The Halting Problem: it is impossible to write a program that determines if an arbitrary program halts.

22 cs205: engineering software Compromises Use imperfect automated tools: –Accept unsoundness and incompleteness –False positives: sometimes an analysis tool will report warnings for a program, when the program is actually okay (unsoundness) –False negatives: sometimes an analysis tool will report no warnings for a program, even when the program violates properties it checks (incompleteness) Use informal reasoning Design programs to modularize reasoning

23 cs205: engineering software Charge Next class: –ps2 hints –Exceptions, programming defensively