Abstract

For a software engineer, well-organized source code conveys the intention of the authors, as if it were an informal specification. An experienced engineer often grasps the “pseudo” meaning of source code first by identifying semantic chunks of various granularities in it, then by weaving them into a hypothetically consistent semantics. We call the specific part in source code that realizes a semantic chunk a code pattern. Tool support for locating already defined code pattern would help engineer's understanding, but it has been practically difficult. One reason is that a code pattern may appear as a lot of slightly different variations. This becomes an obstacle to define a code pattern. In this paper, a framework for an implicit representation of a code pattern is presented. In the framework, a code pattern is defined by an enumeration of instances which is tagged either “positive” of “negative” by a human. From these sets, the system incrementally infers a hypothetical explicit (syntactic) definition of the code pattern. Each instance is represented as an anchored AST (abstract syntax tree. An anchored AST is an AST with a tuple of AST nodes of interest.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call