A specification describes the behavior a function or system must satisfy. Good specifications state universal rules rather than isolated if-then cases, so they also clarify what must not happen and avoid boundary-condition gaps. section 6.4
From a grade rule to a testable property
Instead of writing “if the average is 90 or above, award an A,” write “only an average of 90 or above awards an A.” A QUnit test can capture the resulting runtime specification for computeAverageGrade, while JSCheck can generate many valid grade arrays and verify the property repeatedly. section 6.4
QUnit.test('Compute Average Grade', function (assert) {
assert.equal(computeAverageGrade([80, 90, 100]),'A');
assert.equal(computeAverageGrade([80, 85, 89]), 'B');
assert.equal(computeAverageGrade([70, 75, 79]), 'C');
assert.equal(computeAverageGrade([60, 65, 69]), 'D');
assert.equal(computeAverageGrade([50, 55, 59]), 'F');
assert.equal(computeAverageGrade([-10]), 'F');
});
The test lists grade boundaries from A through F and includes a negative input, making the expected behavior concrete. section 6.4



