Databases Reference
In-Depth Information
effective in broad searches for functionality, when good search terms are available.
These search engines are not able to exploit the context and relationships between
source code snippets, as they treat source code like a bag of words.
Code-specific search engines index public source code, cache it in a repository
and enable users to search based on a variety of attributes such as class/function
names, code licenses, programming languages and platforms. While the search is
limited to the repository, the amount of code available is huge, many millions of
lines of code or classes.
Three of the major code-specific search engines are Krugle, Koders, and Google
Code Search. Like Google Code Search, Koders has options for searching by lan-
guage and license. It also allows users to explicitly search for class, function, and
interface definitions using regular expressions. Krugle returns links not only to
source code, but also to tech pages, topics and projects. It has a visualization for
browsing code repositories and also supports tab-based searching. The searches
can be applied to different segments: source code, comments, and definitions (class
or method). Google Code Search includes support for regular expressions, search
within file names and packages, and case-sensitive search.
To leverage the advantages afforded by open source code, we need search capa-
bilities that are closely integrated with the way that software is developed in open
source. The code search engines do not support the social interaction processes that
are the lifeline of any project. For example, they do not search for keywords within
mailing lists or forums related to a particular topic, users have to use a general-
purpose search engine for that purpose. Neither do they support the formation and
sustenance of communities of practice that are so essential for learning and sharing
in any domain [ 6 ].
3.2.3 Source Code Searching
A study of software engineering work practices by Singer et al. [ 14 ] found that
searching was the most common activity for software engineers. Program compre-
hension, reuse and bug fixing were cited as the chief motivations for source code
searching in that study. A related study on source code searching by Sim et al. [ 12 ]
found that the search goals cited frequently by developers were code reuse, defect
repair, program understanding, feature addition and impact analysis.
Source code searching for program comprehension involves matching of words
or code snippets within an IDE or source code module to a search term, typically
using the Unix-based grep facility, the find command in Unix and also the File Find
command under Microsoft Windows [ 12 ]. It was also found that programmers used
only strings or regular expressions to form their search terms, even though they
were searching for semantically significant pieces of code. Grep is by far the most
popular search facility due to ease of specification of search terms, a command-
line interface, and a direct match with the search model of the programmer [ 13 ].
Programmers trust grep because it is successful most of the times, and the cost of
failure is insignificant.
Search WWH ::




Custom Search