Home // ICSEA 2011, The Sixth International Conference on Software Engineering Advances // View article


Querying Source Code Using a Controlled Natural Language

Authors:
Oleksandr Panchenko
Stephan Müller
Hasso Plattner
Alexander Zeier

Keywords: Source code repository; source code query language; development tools; controlled natural language.

Abstract:
Source code documents are of dual nature: they are in fact texts containing information for developers and they have an explicit structure for compilers and other tools. Several representations for the structured information of source code exist: abstract syntax tree, call graph, data flow graph, and others. Although the questions developers ask about source code seem easy to formulate, the complex code structure requires writing intricate queries. Developers use both, lexical and structured information for queries, though they dislike writing complex queries. Querying source code is an important activity in software development and maintenance. But often it cannot rely on predefined queries alone and requires writing more intricate queries. There is a need for a simple, user-friendly querying interface. This paper discusses an implementation of such a user interface based on a controlled natural language which is an unambiguous subset of the English language. When the developer enters the query, the source code grammar and the actual search results are used to automatically propose possibilities for query refinement and further navigation on the result set. The controlled natural language queries are then transformed to structured queries to retrieve data from a source code repository. The proposed approach provides a better expressiveness compared to simple keyword-based queries and enables consideration of complex structured relations between source code elements.

Pages: 369 to 373

Copyright: Copyright (c) IARIA, 2011

Publication date: October 23, 2011

Published in: conference

ISSN: 2308-4235

ISBN: 978-1-61208-165-6

Location: Barcelona, Spain

Dates: from October 23, 2011 to October 29, 2011