White-Box Testing
By Oliver Cole, March 01, 2000
Traditionally, there are two main approaches to testing software: "black-box" (or functional) testing, and "white-box" (or structural) testing. White-box testing strategies include designing tests such that every source line of code is executed at least once, or requiring every function to be individually tested.
Mar00: White-Box Testing
#include "aprobe.h"
probe thread
{
probe "IPC::ReadfromMsgQueue(Msg)"
{
int i, *my_ptr;
on_entry
my_ptr = (int*) $Msg; /* save the pointer */
on_exit
for (i=0;i<5;i++)
{ *my_ptr = 42;
my_ptr++; }
}
}
Example 5: Corrupting the first five words of the buffer to be 42.