Thinking in C and *nix (CSC 282 2015S) : Outlines

Outline 12: Testing


Held: Thursday, 23 April 2015

Back to Outline 11 - Miscellaneous C Programming Issues. On to Outline 13 - Cancelled.

Summary

We quickly explore principles of unit testing.

Related Pages

Overview

Administrivia

Some Testing Basics

Some Basics of Unit Testing

Unit Testing in C

An Exercise

/**
* Search ordered array A (of length len) for v, returning the index of v.  
* Returns -1 for "not found".
 *
* Pre: A[i] <= A[i+1] for 0 <= i < len-1
* Post: If for all i, A[i] != v, returns -1
*       Otherwise, returns i s.t., A[i] == v
 */
int ibs (int A[], int len, int v);

An Exercise