# Logical Segmentation of Source Code

**Authors:** Jacob Dormuth, Ben Gelman, Jessica Moore, and David Slater

arXiv: 1907.08615 · 2019-07-23

## TL;DR

This paper introduces a deep learning method for logically segmenting source code into meaningful blocks, independent of language or syntax, to enhance various software analysis tasks.

## Contribution

It presents a novel deep learning approach and a unique data set construction technique for logical code segmentation, addressing the lack of existing ground truth data.

## Key findings

- Effective logical segmentation across multiple programming languages
- Improved accuracy in code commenting and vulnerability detection
- Potential to enhance automated code analysis tools

## Abstract

Many software analysis methods have come to rely on machine learning approaches. Code segmentation - the process of decomposing source code into meaningful blocks - can augment these methods by featurizing code, reducing noise, and limiting the problem space. Traditionally, code segmentation has been done using syntactic cues; current approaches do not intentionally capture logical content. We develop a novel deep learning approach to generate logical code segments regardless of the language or syntactic correctness of the code. Due to the lack of logically segmented source code, we introduce a unique data set construction technique to approximate ground truth for logically segmented code. Logical code segmentation can improve tasks such as automatically commenting code, detecting software vulnerabilities, repairing bugs, labeling code functionality, and synthesizing new code.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1907.08615/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/1907.08615/full.md

## References

12 references — full list in the complete paper: https://tomesphere.com/paper/1907.08615/full.md

---
Source: https://tomesphere.com/paper/1907.08615