Factors that affect the accuracy of the biosensor systems range from errors in device fabrication to stochastic interaction between biomolecules. In this paper we present a framework for designing and evaluating biosensor encoding and decoding algorithms based on forward error-correcting (FEC) principles, which can improve the accuracy of pathogen detection. The model biosensor used in this paper is an immunosensor that uses computational primitives inherent in antigen-antibody interaction to achieve a transistor like operation. Fundamental logic gates have been embedded into an equivalent low-density parity check (LDPC) biosensor encoder and a corresponding sumproduct decoding algorithm is presented for error correction. The performance of the encoding-decoding algorithm has been verified using behavioral simulations demonstrating its utility for designing reliable biosensors. The simulation study also reveals a novel co-detection principle that can be a promising method for significantly enhancing the pathogen detection limit.