Do you have a source of radiation? Under normal operating conditions you probably won't get an error in your lifetime... I built an alarm system with a microcontroller about 20 years ago. It runs 24/7 whither it's armed or not and it's never "glitched".
In real life, errors in memory would more-likely to be caused by power/voltage irregularities. Or, by a software glitch that writes the wrong data to the wrong address. When your computer crashes, it's usually a bug in the software or driver. And, I've had a few hard drives go bad. But, I've never seen a "random data error" where some data gets changed in solid state memory. I've had flash chips & EPROMS go bad, but when they're bad, they're bad... I've never seen a random bit flip. I'm sure it happens, but it might be one of the least-common kinds of failures.
If it's real data (so you can't write test-patterns), a checksum is probably best. Errors are very rare so you can probably assume if there's a checksum mis-match, only one bit/byte has been corrupted. so, it shouldn't be too hard to count errors.
Otherwise for general testing, I don't think I'd use a checksum because you might want to know exactly which bits got flipped/corrupted. So, maybe just fill it full of ones or zeros and then read one address at a time in a loop. Or, you can do other things like writing the address of the byte/word into the bite/word, or write AA (hex*) into the even addresses and 55 into the odd addresses.**
It would also be helpful to know if 1-to-0 errors or 0-to-1 errors are more likely. If you can determine that, you can choose the best test-data and fill the memory with ones or zeros. For example, EPROMS are full of ones when erased and only the low-bits are written/changed when the EPROM is programmed. So, it would make more sense to test the EPROM by writing zeros and then check for any bits that get randomly to their "natural" state.... It would be very unlikely for a 1 in an EPROM to be accidentally "flipped" to a zero.
and to precisely count these bit flips???
If you know how to count, I don't know how you could count imprecisely... Unless a bit in your count variable gets flipped... Then you're screwed...
- 55 (hex) = 01010101
AA (hex) = 10101010
** For a general-purpose memory test, you can't write simple patterns like 00, 55, AA or FF because you can be reading/writing the wrong address, or you can have shorted data lines, etc., and you can still read-back the right data. But, when looking for random failures in a known-good system, or for basic troubleshooting these simple patterns usually work... When I'm troubleshooting data lines the 1st thing I usually do is read/write 55 & AA, and then usually 00 and FF.