HW: Test Design

Learning Objectives: practice at designing unit tests to meet coverage criteria; better understanding of MCDC coverage.

Notes:


16-1. Two important concepts in black box testing are equivalence classes and boundary values. For this question consider an absolute value function:
int16_t abs16(int16_t i) { return (i < 0 ? -i : i); }


16-2. Consider testing the following code:

int16_t baz(int16_t a, int16_t b)
{ int16_t res = 0;
if( ((b < 6) && (a < 27)) || (b > 87) || (a == 52) ) { res = b; } else { res = a; } return(res); }

16-3.Consider testing the following code:

int16_t bar(int16_t a, int16_t b)
{ int16_t res = 0;
if((a > 3) && (b < 112)) { if (a == 42) { res = b; } else { res = a; } } else { res = a-b; if (a == 2 && b == 2) { res = a+b; } } return(res); }

Rubric:

Supplemental Material: