Managing ambiguity in programming by finding unambiguous examples
Abstract
We propose a new way to raise the level of discourse in the programming process: permit ambiguity, but manage it by linking it to unambiguous examples. This allows programming environments to work with high-level descriptions that lack precise semantics, such as natural language descriptions or conceptual diagrams, without requiring programmers to formulate their ideas in a formal language first. As an example of this idea, we present Zones, a code search and reuse interface that connects code with ambiguous natural language annotations about its purpose. The backend, called ProcedureSpace, induces relationships between these purpose annotations, static code analysis features, and a variety of natural language background knowledge. ProcedureSpace can search for code given purpose descriptions or vice versa, and can even find code that was never annotated or commented. Since completed Zones searches become annotations, the system learns from user interaction. Users in a preliminary study found that reasoning jointly over natural language and programming language helped them reuse code.