1 Advanced Material The following slides contain advanced material and are optional.

Slides:



Advertisements
Similar presentations
Writing specifications for object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 21 Jan 2005 Invited talk, AIOOL 2005 Paris,
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke September 1976.
Logic & program control part 3: Compound selection structures.
MAHDI OMAR JUNIT TUTORIAL. CONTENTS Installation of Junit Eclipse support for Junit Using Junit exercise JUnit options Questions Links and Literature.
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.
David Brumley, Pongsin Poosankam, Dawn Song and Jiang Zheng Presented by Nimrod Partush.
Test Specification Sabesan. Informationsteknologi Institutionen för informationsteknologi | Why test? Improve quality  Find bugs (no crashes,
Software Testing and Quality Assurance
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer (Nadia Polikarpova) Verification tools.
1 Advanced Material The following slides contain advanced material and are optional.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
1 Advanced Material The following slides contain advanced material and are optional.
Chair of Software Engineering Automatic Verification of Computer Programs.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Testing Test Plans and Regression Testing. Programs need testing! Writing a program involves more than knowing the syntax and semantics of a language.
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
Inclusion-Exclusion Principle. 3 sets A,B,C A B C |A ˘ B ˘ C| = |A| + |B| + |C| -|A*B|-|A*C|-|B*C| +|A*B*C| *: intersection A*B A*C B*C |A ˘ B ˘ C| =
1 Joe Meehean. 2 Testing is the process of executing a program with the intent of finding errors. -Glenford Myers.
Computer Science 340 Software Design & Testing Design By Contract.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
1 Software John Sum Institute of Technology Management National Chung Hsing University.
Introduction to C++ - How C++ Evolved Most popular languages currently: COBOL, Fortran, C, C++, Java (script) C was developed in 1970s at AT&T (Richie)
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
(or what I learned from Neil about software testing) John Hughes Chalmers University/Quviq AB.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
Tammy Dahlgren with Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October.
B. Fernández, D. Darvas, E. Blanco Formal methods appliedto PLC code verification Automation seminar CERN – IFAC (CEA) 02/06/2014.
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
CS 261 – Data Structures Preconditions, Postconditions & Assert.
Simulation is the process of studying the behavior of a real system by using a model that replicates the behavior of the system under different scenarios.
(1) Unit Testing and Test Planning CS2110: SW Development Methods These slides design for use in lab. They supplement more complete slides used in lecture.
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Reasoning about programs March CSE 403, Winter 2011, Brun.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
13 Aug 2013 Program Verification. Proofs about Programs Why make you study logic? Why make you do proofs? Because we want to prove properties of programs.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
1 Contractual Consistency Between BON Static and Dynamic Diagrams Ali Taleghani July 30, 2004.
Automated Test Generation CS Outline Previously: Random testing (Fuzzing) – Security, mobile apps, concurrency Systematic testing: Korat – Linked.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Combining Static and Dynamic Reasoning for Bug Detection Yannis Smaragdakis and Christoph Csallner Elnatan Reisner – April 17, 2008.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
CS 5150 Software Engineering Lecture 22 Reliability 3.
Random Test Generation of Unit Tests: Randoop Experience
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
CS 5150 Software Engineering Lecture 21 Reliability 2.
© Bertrand Meyer and Yishai Feldman Notice Some of the material is taken from Object-Oriented Software Construction, 2nd edition, by Bertrand Meyer (Prentice.
26/06/ Iteration Loops For … To … Next. 226/06/2016 Learning Objectives Define a program loop. State when a loop will end. State when the For.
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
Testing Tutorial 7.
Different Types of Testing
ECS10 10/10
Learning to Program in Python
Software John Sum Institute of Technology Management
Lecture 5 Floyd-Hoare Style Verification
The following slides contain advanced material and are optional.
Software Engineering Lecture #12.
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Mathematical Reasoning
Test Process “V” Diagram
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
CSE 1020:Software Development
COP4020 Programming Languages
Tutorial Number 8 - Daniel Razavi
Unit Testing.
Presentation transcript:

1 Advanced Material The following slides contain advanced material and are optional.

2 Outline  Testing  What is testing  Unit testing  Automatic testing

3 Program verification  Verification checks validity of a program by  Testing (here, functional testing on class level)  Proving  Testing  Execute a program to check if it works  Verifies one particular execution of a program  Applicable to no/partial specification  Proving  Program is statically checked (not executed)  Verifies every possible execution  Needs complete specification

4 Testing  Execute program  Manual testing  Unit testing  Automatic testing  If a test is successful:  The program works with exactly this input  The program could still fail with different input  If a test fails:  Bug found in program  A good test is a test that fails!

5 Unit testing  Write test for a „unit“ of source code:  In object-oriented code, mostly per routine or class  Each test case has three steps  Prepare environment  Run test case  Evaluate output  Library support exists for all major languages

6 Demo

7 Automatic testing  Generate test cases automatically  Need a way to generate valid input data  Need a way to check validity of output data  Any ideas?  Input to a routine is valid if precondition is satisfied  Output of a routine is valid if postcondition is satisfied

8 Automatic input generation  Create objects at random by  Calling a creation routine  Calling commands on the object  These objects can then be used to test a routine  Call routine with random input data (in case of basic types like integer)  Call routine with random objects, created as mentioned above

9 Validate input  Check if randomly chosen objects satisfy precondition  If yes, this is a valid test case  If no, ignore this test case

10 Evaluate output  For a valid test case, check if postcondition is satisfied  If yes, the test was successful  If no, there is a bug in the routine  Test also fails if  any exception happens during routine evaluation, e.g. Void-call or Precondition violation

11 Demo

12