Checking a Code's Promised Response to One Flipped Bit
A small code fixture can verify its documented single-error behavior by changing one position at a time in a known encoded word.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a repetition example
Starting from 000, change each of the three positions independently and verify the original zero is recovered by majority. See three-bit repetition.
Check multi-error guarantees independently
A useful test also records which inputs fall outside the correction promise. Use minimum distance to find a concrete separating case.[1][2]
Enumerate all one-position changes on a known codeword
For the three-bit repetition word 111, the single-flip neighbors are 011, 101 and 110. All should decode to one under majority correction. A test that flips only the middle bit cannot find a defect specific to the first or last position. See repetition codes.
One flip at positions 0,1,2 gives 011,101,110
Expected recovered data: 1 for every variant
Test the unmodified word too
Match tests to detection and correction promises
A detection-only design should report an invalid codeword. For errors beyond the guaranteed radius, document which outputs may be ambiguous. Test both source words.