I did this sort of practice before. And I paid a closer attention this time.
I implemented an interpreter for ATS3 that could handle programs containing
type-errors. I tried it to test some of the ATS3 library code (consisting of about 15K
lines for now). After I got the non-dependent type-checker for ATS3 working, I tried
type-checking the library code (that had already passed unit tests). Did I find bugs?
A large number of them. And I have been writing this kind of code for more than 20
years!
Once I get the dependent and linear type-checker ready, I am certain that many more
bugs will be flushed out. In particular, I am certain that a lot of memory leak bugs will
be detected. If I extrapolate a bit, I am pretty certain that the bug ratio in C and C++
code is quite significant.
Regarding the COVID-19 cases out there, I suppose we can find many more of them if
our detection method becomes more effective. The same can be said about the bugs in
our code.
--Hongwei