Lecture: bugs and testing

preparation

bug-finding tools

#include <stdio.h>
#include <stdlib.h>

int foo(int n)
{
	int *arr = malloc(n * sizeof(int));
	//arr[0] = 42;
	//free(arr);
	return arr[0];
}

int main(int argc, const char * argv[]) {
    printf("%d\n", foo(argc));
    return 0;
}

testing systems code

SAT/SMT solver