-
Code coverage is necessary, but not sufficient. Even code with 100% code coverage can contain bugs. Make sure that tests include multiple sets of data for the same paths through the code. And always test inputs that should produce errors.
-
If your program processes data you don’t control (and most programs do), include fuzzing tests in your test suites.
-
Don’t guess that your changes made the code faster---measure. Capture benchmarks and use Benchstat to track improvements and regressions over time.
-
When testing concurrent code, use the data race detector to ensure you aren’t accessing shared data without locks and use synctest to make the tests fast and accurate.
Progress is saved on this device.