Peter Min-Sheng Hsieh
Current Java IDE such as Eclipse, JEdit and JCreator do not provide functions, which will allow users to directly reuse previous written code. If a user wishes to reuse previous code fragment as a template solution for current requirement, the user will need to dig into his/her file system and hope the file containing the sample code still exists. This is time consuming and frustrating for the user to find the file that contains the right code.
It is often very difficult to reuse previous written code due to lack of documentation. A developer may be able to program new software programs quickly and efficiently but he/she may not be able to reuse code fragments from previous projects simply because the code is not well documented. The developer has to spend time understanding his/her previous code. This becomes an infeasible trade-off to perform software reuse and often developers will rather spend time reinvent the wheel.
The time trade-off is a major setback in any form of software reuse. XPC-JAVA is an Eclipse plug-in aimed at solving this issue by storing code fragments in a database. By doing so, a user no longer needs to search through his/her files just to find a particular code fragment, instead he is able to search and retrieve code within the database. This will significantly reduce the time needed for code retrieval, as well as less user frustration.
However one would question the usability of the tool as the retrieved code fragment may not be the one that is suitable for the situation. To solve this issue, XPC-JAVA requires the user to provide a one-line description of the main purpose for a code fragment when it is stored into the database. Other information regarding the code properties will be analyzed by the XPC-JAVA (such as name, type, and date) and the user does not need to input them manually. During code retrieval the user could specify the search criteria by either main purpose or code properties. This will ensure code retrieval process to be both accurate and simple to use.
Case-based Reasoning (CBR) will be employed as the main algorithm for storing and retrieving code fragments from the database. CBR has a well defined process cycle, which will ensure the retrieved code fragments will be very similar to the user requirement.