Arduino Serial Error Correction
Easy software solution

An easy software solution would be to send the data twice, first receive it and then verify it. It's highly unlikely that exactly the same bits fail twice.
Maybe, for educational purposes, you can try to make an algorithm that sends a checksum.

So when sent twice, and received twice (exactly the same), it'll be verified. If this fails, your communication line would be too noisy.

Though, for a stable solution, you should always check hardware errors, as some microcontrollers simply stop receiving/sending at a hardware errors. Also if you don't like the overhead of the verification software, hardware errors actually give a good view on what happened and are likely to detect errors even withouth additional software (other than the handling).

Hardware solution

The UART itself actually has error checking built in. And when you use a correct baud-rate (something that scales nice on your clock-speed), it's unlikely to mis-receive uart characters. But for the sake of stability you should handle these errors. And if you really need to catch every character, you should even implement that it discards and asks for re-transmission on an error (as the character which generates the error should be considered lost). Also, if you happen to have a lot of errors on your UART, please note that it's likely a hardware error, i.e noise on the line or wrong baudrate


  You must handle UART errors if you want to create a stable system.


over-run errors, when a new character is received before the character in the receive buffer is handled. (Your code should read characters faster than your baudrate is (short interrupt-driven uart receive code will help).

parity error, a parity bit determines wethether the complete message is odd or even (simplified) so if one bit fails, the parity bit will not correspondent with the message, thus the receiver hardware knows one bit was miscreceived. While unlikely, this won't work well if an even amount of bits fail, so that the parity is justified again.

Framing error, as UART has start and stop bits, it's possible to tell whenever you've received a complete message. When this message is too long/ too short or simply doesn't fit the settings (apart from baudrate?) it'll create a framing error.

More info in the datasheet 20.7.4 Receiver Error Flags

So at least, you should check the hardware errors, this gives quite a stable connection. Make sure you implement something that'll clear the error-registers (they might cause additional receive/sending to fail) and re-sent the message, so that the other device is 'synched' again.