CoChat

On the naturalness of software

Hindle, Abram, Barr, Earl T., Gabel, Mark, Su, Zhendong, Devanbu, Premkumar · 2016 · Communications of the ACM

The DOI matches its Crossref record; 55 of the 56 references it cites were found in a registry or an index.

Abstract

Natural languages like English are rich, complex, and powerful. The highly creative and graceful use of languages like English and Tamil, by masters like Shakespeare and Avvaiyar, can certainly delight and inspire. But in practice, given cognitive constraints and the exigencies of daily life, most human utterances are far simpler and much more repetitive and predictable. In fact, these utterances can be very usefully modeled using modern statistical methods. This fact has led to the phenomenal success of statistical approaches to speech recognition, natural language translation, question-answering, and text mining and comprehension. We begin with the conjecture that most software is also natural , in the sense that it is created by humans at work, with all the attendant constraints and limitations---and thus, like natural language, it is also likely to be repetitive and predictable. We then proceed to ask whether (a) code can be usefully modeled by statistical language models and (b) such models can be leveraged to support software engineers. Using the widely adopted n -gram model, we provide empirical evidence supportive of a positive answer to both these questions. We show that code is also very regular, and, in fact, even more so than natural languages. As an example use of the model, we have developed a simple code completion engine for Java that, despite its simplicity, already improves Eclipse's completion capability. We conclude the paper by laying out a vision for future research in this area.

Overview

Integrity signals

Registry

Crossref · 10.1145/2902362

Cites

55 of 55 references verified0 citation errors · 0 not checkable

Statistics

Recomputing p-values needs the paper’s full text.

Verification

Claims the paper makes

This paper’s full text isn’t openly available, so its claims and self-check weren’t run. The registry and citation checks still apply.

Citations

Cites

Show all 55 references

Research works printed but not linked: 6

  1. 10.5555/2819009.2819143 · doi:10.5555/2819009.2819143
  2. 10.5555/1734086 · doi:10.5555/1734086
  3. 10.1145/1062455.1062526 · doi:10.1145/1062455.1062526 · Paper page
  4. 10.5555/311445 · doi:10.5555/311445
  5. 10.5555/2820518.2820559 · doi:10.5555/2820518.2820559
  6. 10.5555/998675.999460 · doi:10.5555/998675.999460

Cited by

Items 101–200 of 330

Metadata

Authors
Hindle, A., Barr, E. T., Gabel, M., Su, Z., & Devanbu, P.
Affiliations
  • University of Alberta (CA)
  • University College London (GB)
  • University of California, Davis (US)
  • UC Davis, CA
Venue
Communications of the ACM
Published
2016-04-26
Volume
59
Issue
5
Pages
122-131
ISSN
  • 0001-0782 (ISSN-L)
  • 1557-7317
OpenAlex
W2344444819
Cited by
307
References
56
Citations by year
2026: 34 · 2025: 58 · 2024: 48 · 2023: 45 · 2022: 66 · 2021: 26 · 2020: 16 · 2019: 5 · 2018: 6 · 2017: 2 · 2016: 1
FWCI
10.42
Type
journal article
Language
en
Open access
closed
Locations
Communications of the ACM (publishedVersion)
Funders
Engineering and Physical Sciences Research Council (EP/J017515/1)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Techniques and Practices
Keywords
statistical language models, n-gram language models, code completion, Java, eclipses, software engineering support

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.