Malformed Sensor Packet Negative Test

Malformed Sensor Packet Negative Test

Try Choose Step to run the first well-formed suite and read the coverage badge beside the decoder.

Predict the negative test result

◆ Decoder test

Sensor packet

Well-formed sensor packets queued

Decoder

Same decoder for all cases

Suite record

Line coverage pending

    Plan inputs

    A decoder reads data carried in a sensor packet. This suite starts with packets in the expected format.

    Observe The passing suite rises from 92% to 100% line coverage, then a separate malformed packet makes the decoder card show a crash while the previous suite result stays at 100%.
    Explain The decoder can crash on the malformed packet because the suite that reached 100% line coverage exercised only well-formed inputs and left that packet untested.

    Technical boundaries. The malformed packet is symbolic, and the crash result applies to the particular input tried in this example. Other classes of invalid packets require their own representative cases. The coverage figure belongs to the earlier suite of well-formed inputs.

    Back to the chapter