Existing code repositories contain numerous instances of code patterns that are idiomatic ways of accomplishing a particular programming task. Sometimes, the programming language in use supports specific operators or APIs that can express the same idiomatic imperative code much more succinctly. However, those code patterns linger in repositories because the developers may be unaware of the new APIs or have not gotten around to them. Detection of idiomatic code can also point to the need for new APIs.
We share our experiences in mining imperative idiomatic patterns from the Hack repo at Facebook. We found that existing techniques either cannot identify meaningful patterns from syntax trees or require test-suite-based dynamic analysis to incorporate semantic properties to mine useful patterns. The key insight of the approach proposed in this paper - Jezero - is that semantic idioms from a large codebase can be learned from canonicalized dataflow trees. We propose a scalable, lightweight static analysis-based approach to construct such a tree that is well suited to mine semantic idioms using nonparametric Bayesian methods.
Our experiments with Jezero on Hack code show a clear advantage of adding canonicalized dataflow information to ASTs: Jezero was significantly more effective in finding new refactoring opportunities from unannotated legacy code than a baseline that did not have the dataflow augmentation.
Tue 10 MayDisplayed time zone: Eastern Time (US & Canada) change
Fri 13 MayDisplayed time zone: Eastern Time (US & Canada) change
13:00 - 14:00
Abbas Javan Jafari Concordia University, Canada, Diego Costa Concordia University, Canada, Rabe Abdalkareem Carleton University, Emad Shihab Concordia University, Nikolaos Tsantalis Concordia UniversityDOI Pre-print File Attached
|Mining Idioms in the Wild|
SEIP - Software Engineering in Practice
Aishwarya Sivaraman University of California, Los Angeles, Rui Abreu Faculty of Engineering, University of Porto, Portugal, Andrew Scott Facebook, Tobi Akomolede Facebook, Satish Chandra FacebookPre-print Media Attached
|The Impact of Flaky Tests on Historical Test Prioritization on Chrome|
SEIP - Software Engineering in PracticePre-print Media Attached