DeepCode boosts its intelligence and can now explain the reasons behind coding errors

DeepCode AI
DeepCodeAI
Published in
2 min readOct 8, 2019

At DeepCode, we’re always focused on discovering important software bugs and being a tool that can improve and even replace testing. To get there, we need to discover semantic software defects and provide the conditions under which the defects are exposed. It is not enough to run a deep neural network that says something is wrong with the software: you also have to provide an explanation.

As part of those efforts, we have introduced a new AI technique called Ontology. With Ontology, we’ve integrated the capability to present logical conclusions directly in the DeepCode engine. Here’s how it works on some interesting examples (you’ll need a GitHub account to access them). In the first example, get is called on a possibly empty collection and this may return null and lead to a NullPointerException. To do this, DeepCode reasons about collections, reasons about their values, and can detect errors and explain them, all in an easy-to-use interface.

Example 1: (Link -GitHub account required)

Calling get on possibly null value coming from calling get on collection java.util.ArrayList which may be empty

Similarly, DeepCode can reason about other cases that could lead to such errors. In the second example, user-editable provided Properties are read and failure to find a property from the list will lead to a similar NullPointerException.

Example 2:(Link -GitHub account required)

Calling charAt on possibly null value coming from calling getProperty on Properties which may not contain this key

This is not all: DeepCode can find thousands of other patterns learned from fixes in open source software, as well as security vulnerabilities and many other problems. Give it a try and let us know how it works for you.

Veselin Raychev

CTO and co-founder

--

--

DeepCode AI
DeepCodeAI

AI for Better Software: Identify bugs before they happen to fulfill developers’ true coding potential and deliver quality products, faster.