Key Difference between Manual Testing and Model Checking

Slides:



Advertisements
Similar presentations
Queues Printer queues Several jobs submitted to printer Jobs form a queue Jobs processed in same order as they were received.
Advertisements

Lecture for Lab 3, Exp1 of EE505 (Developing Device Driver) T.A. Chulmin Kim CoreLab. Mar, 11, 2011 [XenSchedulerPaper_Hotcloud-commits] r21 - /
Data Structure Lecture-5
Data Structures Lecture 13: QUEUES Azhar Maqsood NUST Institute of Information Technology (NIIT)
Divisor máximo de dois inteiros. unsigned int gcd(unsigned int A, unsigned int B) { if (B > A) return gcd(B,A); else if (B==0) return A; else return gcd(B,A%B);}
Queues1 Part-B2 Queues. Queues2 The Queue ADT (§4.3) The Queue ADT stores arbitrary objects Insertions and deletions follow the first-in first-out scheme.
Lab 8 User Defined Function.
Queues. What is a queue? First-in first-out data structure (FIFO) New objects are placed at rear Removal restricted to front Examples?
Queue using an array. .head.tail Pointers head and tail always point to the first empty slot before or after elements in the list. Thus, initially they.
Cache Table. ARP Modules Output Module Sleep until IP packet is received from IP Software Check cache table for entry corresponding to the destination.
Queues.
EXPANDING STACKS AND QUEUES CS16: Introduction to Data Structures & Algorithms 1 Tuesday, February 10, 2015.
Data Structures - Queues
CSCI 130 Chapter 5 Functions. Functions are named uniquely Performs a specific task Is independent –should not interfere with other parts of program May.
Linked Structures See Section 3.2 of the text.. First, notice that Java allows classes to be recursive, in the sense that a class can have an element.
Mohammad Amin Kuhail M.Sc. (York, UK) University of Palestine Faculty of Engineering and Urban planning Software Engineering Department Computer Science.
HW6: Due Dec 8th 23:59 1.Describe test cases to reach full path coverage of the triangle program by completing the path condition table below. Also, draw.
The Queue Data Structure Mugurel Ionu Andreica Spring 2012.
Chapter 7 Queues Introduction Queue applications Implementations.
Ex2. Tower of Hanio 1/11 Write down a C program to solve the Tower of Hanoi ga me (3 poles and 4 disks) by using CBMC – Hint: you may non-deterministically.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
24 September 2002© Willem Visser Program Model Checking Enabling Technology Abstraction void add(Object o) { buffer[head] = o; head = (head+1)%size;
8/2/00SEM107- © Kamin and ReddyClass 5 - Lists - 1 Class 5 - Lists r The list data type r Recursive methods on lists.
1 Lecture 15: Big O Notation (Wednesday) Lecturer: Santokh Singh CompSci 105 SS 2005 Principles of Computer Science Test See Web for Details Don’t be deleted!
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Abstract Data Types Queues Dale Roberts, Lecturer
Queues1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich,
CSC 172 DATA STRUCTURES. A TALE OF TWO STRUCTURES.
Recursion.
Linked Data Structures
Principles of programming languages 10: Object oriented languages
Using Queues: Coded Messages
Linked List.
Number guessing game Pick a random number between 1 and 10
Doubly Linked List Review - We are writing this code
Queue data structure.
Specifications What? Not how!.
Stack and Queue APURBO DATTA.
CSC 172 DATA STRUCTURES.
Data Structures 1 1.
HW-6 Deadline Extended to April 27th
Basic Data Types Queues
Pointers.
Initializing Objects.
Queues 12/3/2018 Queues © 2014 Goodrich, Tamassia, Goldwasser Queues.
Queues: Implemented using Arrays
Queues 3/9/15 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser,
ADT list.
Key Difference between Manual Testing and Model Checking
Washington University
Part 1: Concepts and Hardware- Based Approaches
HW#5 1. Verify the max_heapify(int x[],int i,int h_size) by using CBMC
Automatic Test Generation SymCrete
Queues FIFO Enqueue Dequeue Peek.
Mutable Data (define mylist (list 1 2 3)) (bind ((new (list 4)))
CS210- Lecture 5 Jun 9, 2005 Agenda Queues
ADT Queue (Array Implementation)
Circular Queues: Implemented using Arrays
1. (50 pts) Concolic testing the sort function
Key Difference between Manual Testing and Concolic/Symbolic Testing
Queues Definition of a Queue Examples of Queues
Computer Science I: Get out your notes.
HW#3: Due Nov 8 23:59 NOTE. Submit both hardcopy and softcopy.
Random Numbers while loop
Types of loops definite loop: A loop that executes a known number of times. Examples: Repeat these statements 10 times. Repeat these statements k times.
Radix Sort Sorted
An Introduction to STL.
break & continue Statements
컴퓨터 프로그래밍 기초 - 13th : 마지막 수업 -
Stacks and Linked Lists
Presentation transcript:

Key Difference between Manual Testing and Model Checking Manual testing (unit testing) A user should test one concrete execution scenario by checking a pair of concrete input values and the expected concrete output values Model checking (concolic testing) A user should imagine all possible execution scenarios and model a general environment that can enable all possible executions A user should describe general invariants on input values and output values

Ex1. Circular Queue of Positive Integers #include<stdio.h> #define SIZE 12 #define EMPTY 0 // We assume that q[] is // empty if head==tail unsigned int q[SIZE],head,tail; void enqueue(unsigned int x) { q[tail]=x; tail=(++tail)%SIZE; } unsigned int dequeue() { unsigned int ret; ret = q[head]; q[head]=0; head= (++head)%SIZE; return ret;} Step 1) 1 2 3 4 5 6 7 8 9 10 11 15 6 9 8 4 head=6 tail=11 Step 2) 3 5 15 6 9 8 4 17 tail=2 head=6 Step 3) 3 5 6 9 8 4 17 tail=2 head=7

void enqueue_verify() { unsigned int x, old_head, old_tail; unsigned int old_q[SIZE], i; __CPROVER_assume(x>0); for(i=0; i < SIZE; i++) old_q[i]=q[i]; old_head=head; old_tail=tail; enqueue(x); assert(q[old_tail]==x); assert(tail== ((old_tail +1) % SIZE)); assert(head==old_head); for(i=0; i < old_tail; i++) assert(old_q[i]==q[i]); for(i=old_tail+1; i < SIZE; i++) assert(old_q[i]==q[i]); } void dequeue_verify() { unsigned int ret, old_head, old_tail; unsigned int old_q[SIZE], i; for(i=0; i < SIZE; i++) old_q[i]=q[i]; old_head=head; old_tail=tail; __CPROVER_assume(head!=tail); ret=dequeue(); assert(ret==old_q[old_head]); assert(q[old_head]== EMPTY); assert(head==(old_head+1)%SIZE); assert(tail==old_tail); for(i=0; i < old_head; i++) assert(old_q[i]==q[i]); for(i=old_head+1; i < SIZE; i++) assert(old_q[i]==q[i]);} int main() {// cbmc q.c –unwind SIZE+2 environment_setup(); enqueue_verify();} int main() {// cbmc q.c –unwind SIZE+2 environment_setup(); dequeue_verify();}

#include<stdio.h> #define SIZE 12 #define EMPTY 0 // Initial random queue setting following the script void environment_setup() { int i; for(i=0;i<SIZE;i++) { q[i]=EMPTY;} head=non_det(); __CPROVER_assume(0<= head && head < SIZE); tail=non_det(); __CPROVER_assume(0<= tail && tail < SIZE); if( head < tail) for(i=head; i < tail; i++) { q[i]=non_det(); __CPROVER_assume(0< q[i]); } else if(head > tail) { for(i=0; i < tail; i++) { for(i=head; i < SIZE; i++) { } // We assume that q[] is empty if head==tail #include<stdio.h> #define SIZE 12 #define EMPTY 0 unsigned int q[SIZE],head,tail; void enqueue(unsigned int x) { q[tail]=x; tail=(++tail)%SIZE; } unsigned int dequeue() { unsigned int ret; ret = q[head]; q[head]=0; head= (++head)%SIZE; return ret;