Browse Prior Art Database

Existing Code Reuse System Based on Comments in Code

IP.com Disclosure Number: IPCOM000238483D
Publication Date: 2014-Aug-28
Document File: 2 page(s) / 43K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a framework that uses natural language to easily search a code base for existing functionality (i.e. re-usable code).

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 51% of the total text.

Page 01 of 2

Existing Code Reuse System Based on Comments in Code

Code reuse is a valuable part of software development; however, in practice is difficult to achieve. It is common for an organization to have many software developers working on a multitude of projects and applications. The source code is usually stored in a source code repository so that it is easily shared and versioned. Normally, each application has a designated location in the repository so that projects contain only the needed code. A set of "common" projects can exist for functionality that all applications need to use.

An example of this is code to connect to databases. This allows easy reuse of code between projects. With code being stored by project and in multiple locations in the repository, it becomes very difficult to locate existing functionality to reuse. A lot of time is spent (and wasted) looking for existing code to use. A developer knows someone wrote something that could be used, but has no idea where to find it. When the code is not found, even more time is wasted duplicating efforts when the needed functionality already exists. This becomes an even larger problem for an individual who may be only using a subset of the repository locations ,

which means that the user cannot easily search the entire code base locally (which could be millions of lines of code or more).

Current approaches to finding reusable code, such as text- or regular expression-based searches, talking to other developers, using statistical algorithms, etc. can be limited in search capabilities (e.g., looking for only exact matches), narrow in scope, complex, and do not always produce the desired results.

The novel contribution is a framework that uses natural language to easily search a code base for existing functionality . By applying statistical algorithms to the comments in the code, developers can run analytics-type actions on code to determine which classes/methods are candidates for re-use. The search scope can further be reduced by adding additional information , such as the list of parameters passed into a method, parameter types passed into a class constructor, etc.

This framework provides a fast and easy method to search for reusable code . It enables the developer to search the entire company code base and open source repositories with a simple text query (not just code checked out locally).

Statistical models can be applied to code to analyze it and to try to determine approximate matches from a given natural text search string. In this case, a user starts typing a word in hopes that it will be used within a comment in the code base. As an example, the user ente...