# US 2019/0317879 A1 · Deep learning for software defect identification

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0317879 A1
- Document ID: US20190317879A1
- Status: Published application
- Kind: A1
- Application number: 15/953,650
- Filed: 2018-04-16
- Published: 2019-10-17
- Earliest claimed: 2018-04-16
- Assignees: Huawei Technologies Co., Ltd.
- Inventors: William Carson MCCORMICK
- Web page: https://patentgrep.com/patent/US20190317879A1

## CPC

- G06F 11/3608: {using formal methods, e.g. model checking, abstract interpretation (theorem proving G06N5/013)}
- G06F 8/75: Structural analysis for program understanding
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 18/213: Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/2413: based on distances to training or reference patterns
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/08: Learning methods
- G06N 3/09: Supervised learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A neural network for identifying defects in source code of computer software. The neural network comprises: at least one convolutional layer configured to generate a one or more feature abstractions associated with an input segment associated with the source code; at least one recurrent layer configured to identify within the one or more feature abstractions a pattern indicative of a defect in the source code; and at least one mapping layer configured to generate a mapping between the identified pattern and a location of the indicated defect in the source code.

## Claims

### Claim 1

A deep learning neural network for identifying defects in source code of computer software, the neural network comprising:
a convolutional layer configured to receive an input segment associated with the source code and to generate a set of one or more feature abstractions associated with the input segment;
a recurrent layer configured to identify within the one or more feature abstractions a pattern indicative of a defect in the source code; and
a mapping layer configured to generate a mapping between the identified pattern and a location in the source code associated with the indicated defect.

### Claim 2 (depends on 1)

The deep learning neural network of claim 1 wherein the input segment comprises an intermediate representation of at least a portion of the source code.

### Claim 3 (depends on 2)

The deep learning neural network of claim 2 wherein the input segment is received by the convolutional layer from a compiler associated with the neural network.

### Claim 4 (depends on 1)

The deep learning neural network of claim 1 wherein at least one of the feature abstractions in the generated set corresponds with a programming feature of the source code selected from a list comprising
a selection;
a repetition;
a flow control;
an expression;
a compound statement; and
an event;

### Claim 5 (depends on 1)

The deep learning neural network of claim 1 wherein the convolutional layer is further configured to create a pool of feature abstractions within the generated set of one or more feature abstractions, each feature abstraction within the pool of feature abstractions associated with a common input segment.

### Claim 6 (depends on 1)

The deep learning neural network of claim 1 wherein the convolutional layer is a one of a plurality of convolutional layers in the neural network.

### Claim 7 (depends on 6)

The deep learning neural network of claim 6 wherein each of the plurality of convolutional layers is connected to at least one other convolutional layer.

### Claim 8 (depends on 1)

The deep learning neural network of claim 1 wherein the identifying of a pattern is performed in accordance with contents of a memory associated with the recurrent layer.

### Claim 9 (depends on 1)

The deep learning neural network of claim 1 wherein the recurrent layer is a one of a plurality of recurrent layers in the neural network.

### Claim 10 (depends on 9)

The deep learning neural network of claim 9 wherein each of the plurality of recurrent layers is connected to at least one other recurrent layer.

### Claim 11 (depends on 9)

The deep learning neural network of claim 9 wherein the identifying of a pattern is performed in accordance with contents of a plurality of memories, each memory in the plurality of memories associated with at least one layer in the plurality of recurrent layers.

### Claim 12 (depends on 11)

The deep learning neural network of claim 11 wherein at least one memory in the plurality of memories is a shared memory and is associated with more than one layer in the plurality of recurrent layers, the shared memory facilitating identification of errors across input segments.

### Claim 13 (depends on 1)

The deep learning neural network of claim 1 the mapping layer is one of a plurality of mapping layers, and wherein each of the plurality of mapping layers is connected to at least one other mapping layer.

### Claim 14 (depends on 13)

The deep learning neural network of claim 13 wherein the at least two of the plurality of mapping layers are functionally fully connected.

### Claim 15 (depends on 14)

The deep learning neural network of claim 14 wherein the at least two functionally fully connected mapping layers are fully connected.

### Claim 16 (depends on 1)

The deep learning neural network of claim 1 wherein the mapping layer is configured to generate the mapping in accordance with the identified patterns indicative of a defect identified by the recurrent layer and segment information received from the recurrent layer.
