Saturday, February 16, 2019

ai for bug detection

is just a hype

artificial intelligence is big hype now, it deserves it, it deserves even more hype than it gets; but particularly for software bug detection it is a wrong idea; for that it is just an instance of the (i have a cool hammer so everything is a nail) fallacy

the tool for bug detection is the type system; type systems and type theory in math and programming were invented exactly to catch human mistakes; in this article i will compare ai and type system

currently type systems are much underused; the haskell programming language is the one that has the best type system [among production-strong languages], by far, but even its type system is much outdated [just think about the fact that it does not even have dependent types]; the potential update of our type systems used in practice is very easy, much overdue and would decrease the number of bugs by several orders

ai is black box; even after substantial experience with one particular ai algorithm : the programmer remains unsure which bugs it catches; with type system the programmer knows exactly, surely, what properties of the program are ensured, he can use this info to strengthen the properties of the program which are not covered by the type system by unit testing or more attention, more documentation

type theory is a foundational field of mathematics and is more than a century old; artificial intelligence [especially the widely successful part] is about 1-2 decades old; and the theory of ai for bug detection is almost non-existent; i see, one can point out many scientific articles in the topic, but that does not make it a scientific field, let alone a successful one

type checking is an order of magnitude faster than an ai algorithm

the type system pinpoints the error at the right location

the type system helps in a lot of other tasks too : editing the code, documenting the code, automatic implementation

from a more general point of view the best direction for the software development world to decrease the bugs is correctness by construction