Databases Reference
In-Depth Information
A rich source of examples of API usage is available on the Web [ 6 ], enabling
developers to gain the efficacy of code reuse through code texture. The search result
for API code examples is likely to consist of several candidates. Typically, a devel-
oper copies and pastes one of them in the current program, test-runs the program,
and checks whether it successfully produces the desired effect. If it fails the devel-
oper's expectation, the developer replaces the pasted part with another result from
the search, and then checks whether that one works. The developer may not fully
understand the pasted statement, for instance, which parameter does what, but if it
works, he or she may just leave it as is in the program.
2.3 Areas of Technical Support for Code Search Activities
From the perspective of a developer's cognitive activity on code search, code search
mechanisms are necessary but not sufficient. Other areas of technical support should
be taken into account to smoothly and effectively help a developer engaging in code
reuse and remix (see the larger left oval in Fig. 2.1 ).
This section lists some aspects of a code search activity that would demand such
technical support. We discuss existing tools and then outline future research agendas
together with relevant existing research in addition to software engineering.
2.3.1 Knowing the Nonexistence of Potentially
Usable Existing Code
Developers often want to make sure that there is no reusable code before they start
writing their own code. Developers usually have a rather good understanding of
what they want to achieve in their own programming tasks. In this sense, the code
search is fact-finding rather than exploratory [ 25 ].
It remains as a challenging task to know the nonexistence of potentially usable
code for the current task. When one does not find usable code among a list of queried
results, it is often difficult to distinguish whether such code does not exist or whether
it exists but has not been located due to inadequate queries. A developer is likely to
specify a query for a desired functionality in his or her own context, but what could
be suitable for the task may not be associated with such a vocabulary set [ 24 ].
2.3.2 Helping to Formulating Queries
Tools have been studied to address the challenge of adequately formulating queries.
CodeBroker used a latent-semantic indexing mechanism to associate terms used in
program comments and method signatures with methods stored in code repositories
Search WWH ::




Custom Search