Ir directamente a la navegación principal Ir directamente a la búsqueda Ir directamente al contenido principal

Mining semantic loop idioms

  • Miltiadis Allamanis
  • , Earl T. Barr
  • , Christian Bird
  • , Premkumar Devanbu
  • , Mark Marron
  • , Charles Sutton

Producción científica: Articlerevisión exhaustiva

23 Citas (Scopus)

Resumen

To write code, developers stitch together patterns, like API protocols or data structure traversals. Discovering these patterns can identify inconsistencies in code or opportunities to replace these patterns with an API or a language construct. We present coiling, a technique for automatically mining code for semantic idioms: surprisingly probable, semantic patterns. We specialize coiling for loop idioms, semantic idioms of loops. First, we show that automatically identifiable patterns exist, in great numbers, with a large-scale empirical study of loops over 25MLOC. We find that most loops in this corpus are simple and predictable: 90 percent have fewer than 15LOC and 90 percent have no nesting and very simple control. Encouraged by this result, we then mine loop idioms over a second, buildable corpus. Over this corpus, we show that only 50 loop idioms cover 50 percent of the concrete loops. Our framework opens the door to data-driven tool and language design, discovering opportunities to introduce new API calls and language constructs. Loop idioms show that LINQ would benefit from an Enumerate operator. This can be confirmed by the exitence of a StackOverflow question with 542k views that requests precisely this feature.

Idioma originalEnglish
Páginas (desde-hasta)651-668
Número de páginas18
PublicaciónIEEE Transactions on Software Engineering
Volumen44
N.º7
DOI
EstadoPublished - jul 1 2018

Nota bibliográfica

Publisher Copyright:
© 1976-2012 IEEE.

Financiación

FinanciadoresNúmero del financiador
National Science Foundation Arctic Social Science Program1414172
UK Medical Research Council, Engineering and Physical Sciences Research CouncilEP/K024043/1

    ASJC Scopus subject areas

    • Software

    Huella

    Profundice en los temas de investigación de 'Mining semantic loop idioms'. En conjunto forman una huella única.

    Citar esto