Browse Prior Art Database

A method to help developers to avoid duplicated coding errors

IP.com Disclosure Number: IPCOM000234000D
Publication Date: 2014-Jan-07
Document File: 5 page(s) / 46K

Publishing Venue

The IP.com Prior Art Database

Abstract

Developers may make similar or duplicated coding errors due to incorrect usage of unfamiliar codes written by other developers. Avoid these duplicated errors is very important to the efficiency and quality of the software. Today's development Integrated Development Environment tools and code version control tools stores useful information for previous errors. Our invention is to analyze these stored information, to find out the code patterns for previously resolved errors, and with a few user interactions to confirm the patterns and can automatically warning the developer for potential errors

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

Page 01 of 5

A method to help developers to avoid duplicated coding errors

Developers may make similar or duplicated coding errors due to incorrect usage of unfamiliar codes written by other developers . Avoid these duplicated errors is very important to the efficiency and quality of the software.

Today's development Integrated Development Environment tools and code version control tools stores useful information for previous errors .

Our invention is to analyze these stored information, to find out the code patterns for previously resolved errors, to warning developers for potential errors when he is writing the codes similar with the concluded patterns.

Our invention can automatically retrieve the information and automatically summaries the patterns and with a few user interactions to confirm the patterns and can automatically warning the developer for potential errors.

Our invention retrieves the code changes for each resolved defects and summaries the potential candidate error patterns . Our invention let the developer to determine which candidate pattern is the real error pattern and once determined, this invention can automatically analyze the current codes for any potential errors.

The advantages of our solution are:


1. this invention can automatically summarize the potential error pattern for each defects. No manual effort needed.


2. this invention can provide the developer the candidate error pattern for determining the real error pattern, only little effort needed to find the final error pattern


3. this invention can automatically analyze the current codes to report all potential errors.

Here are the major steps of our invention.

Step 1: retrieve the code changes for each defects and summaries potential candidate patterns.

a) retrieve the code changes for defects: for each defect, retrieve the code changes which resolved the defect. (This can be done

based on integrated development environment which records the defect change history and associated code changes to each defect .)

After this step, we can have mapping between each defect and its code changes

Here are examples: (changed codes are in red)

Defect A: failed to close java data base connectivity resource
public method () {

try{


[1] PreparedStatement ps = ...; // ...


[2] ps.setAttribute(a.getAttribute());


[3] ps.executeUpdate();

}finally{ try{

1



Page 02 of 5

} }


[4] ps.close(); }catch(Exception e){

     // nothing }

Defect B: failed to check null before use public method (){

[1] A a = getInstanceOfA();

[2] if(a != null){

[3] errorWillHappenIfAIsNull(a);

} }


b) summarize potential candidate patterns

I>> retrieve: for each code changes, retrieve the affected variables in these changed codes.

      II>> slicing: for each affected variables, slicing the statements according to variable in each method and get the statement type (Define/Use)

III>> analyze: for each sliced sequence, collection info and analyze and set it as candidate pattern.

Here are the example: for Defect A:

I> retrieve: get...