A new system has been developed by the researchers of Computer Science and Artificial Intelligence that enables programmers for transplanting code from one program into another. Through this system, the programmer has the opportunity to select the code from one program along with an insertion point in a second program.
After that, the necessary modifications will automatically be made by the system for example: in order to integrate the code into its context, changing variable names. On the other hand, the system also has the ability to translate between data representations crucially, which has been used by the donor and recipient programs.
For example: It is needed for an image processing program to be able to handle files in arrange of formats such as: jpeg, tiff or png etc. but it will represent all such kinds of images by using a single standardized scheme internally as different programs may use different internal schemes.
In order to import code seamlessly, the system of researchers of Computer Science automatically maps the donor program’s scheme onto that of the recipient.A new system has been presented by the researchers and dubbed Code Carbon Copy that enables one of the holy grails of software engineering and automatic code reuse also.
According to the researchers, it is the further step towards automating the human away from the development cycle.In order to transplant code between six popular open source images processing programs, eight experiments have been conducted by the researchers by using Code Carbon Copy in which seven of the eight transplants by them were successful along with the recipient program properly executing the new functionality.
The main focus of the first step of the Code Carbon Copy is to feed both of them the same input file in transplanting code from one program to another, then there is a comparison of processing the file of two programs by this system.
It will be concluded by the system if a series of operation on a particular piece of data has been performed by the donor program as well as loads the result with a variable name and after that, the same operations on the same piece of data have been performed by the recipient and loads the result with another variable name.
The system will also tell that the variables are playing the same roles in their respective programs. Once the correspondences between variables have been identified, it will be presented to the user by Code Carbon Copy as well as it also presents all the variables in the donor for which it could not find matches in the recipient together with those variables.