Mining Source Code Descriptions from Developer Communications Sebastiano Jairo Massimiliano Andrian Gerardo Panichella Aponte Di Penta Marcus Canfora
Context: Software Project Sequence Program diagram Comprehension Documentation Source Code Class diagram Maintenance Tasks Developer
Context: Software Project Sequence Program diagram Comprehension Documentation Source Code Class diagram Maintenance Tasks Difficult understanding Developer
Context: Software Project describes Sequence Program diagram Comprehension Documentation Source Code Class diagram Maintenance Tasks Difficult understanding understanding Developer
Context: Software Project Coming back to the reality... Program Comprehension Source Code Maintenance Tasks Difficult understanding Developer
Idea We argue that messages exchanged among contributors/developers are a useful source of information to help understanding source code. In such situations developers need to infer knowledge from , source code descriptions in external the source code itself artifacts. Developer
.................................................. When call the method IndexSplitter.split(File Idea destDir, String[] segs) from the Lucene cotrib directory(contrib/misc/src/java/org/apache/luc ene/index) it creates an index with segments We argue that messages exchanged among contributors/developers descriptor file with wrong data. Namely wrong are a useful source of information to help understanding source code. is the number representing the name of segment that would be created next in this index. .................................................. In such situations developers need to infer knowledge from , CLASS: IndexSplitter METHOD: split source code descriptions in external the source code itself artifacts. Developer
A Five Step-Approach for Mining Method Descriptions Developer
Step 1: Downloading emails/bugs reports and tracing them onto classes The discussion contains a fully-qualified class name (e.g., org.apache.lucene.analysis.MappingCharFilter); or the email contains a Two heuristics file name (e.g., MappingCharFilter.java) For bug reports, we complement the above heuristic by matching the bug ID of each closed bug to the commit notes, therefore tracing the bug report to the files changed in that commit Developer Discussion When call the method .split(File destDir, String[] segs) from the IndexSplitter Lucene cotrib directory (contrib/misc/src/java/org/apache/lucene/index) it creates an index with segments descriptor file with wrong data. Namely wrong is the number representing the name of segment that would be created next in this index. public void split(File destDir, String[] segs) throws IOException { destDir.mkdirs(); FSDirectory destFSDir = FSDirectory.open(destDir); SegmentInfos destInfos = new SegmentInfos } If some of the segments of the index already has this name this results either to impossibility to create new segment or in crating of an corrupted segment.
Step 1: Downloading emails/bugs reports and tracing them onto classes The discussion contains a fully-qualified class name (e.g., org.apache.lucene.analysis.MappingCharFilter); or the email contains a Two heuristics file name (e.g., MappingCharFilter.java) For bug reports, we complement the above heuristic by matching the bug ID of each closed bug to the commit notes, therefore tracing the bug report to the files changed in that commit Developer Discussion When call the method .split(File destDir, String[] segs) from the IndexSplitter Lucene cotrib directory (contrib/misc/src/java/org/apache/lucene/index) it creates an index with segments descriptor file with wrong data. Namely wrong is the number representing the name of segment that would be created next in this index. CLASS: IndexSplitter public void split(File destDir, String[] segs) throws IOException { destDir.mkdirs(); FSDirectory destFSDir = FSDirectory.open(destDir); SegmentInfos destInfos = new SegmentInfos } If some of the segments of the index already has this name this results either to impossibility to create new segment or in crating of an corrupted segment.
Step 2: Extracting paragraphs We consider as paragraphs, text section separated by one or more white lines Two heuristics We prune out paragraph description from source code fragments and/or stack Traces "by using an approach inspired by the work of Bacchelli et al. Developer Discussion PAR When call the method IndexSplitter.split(File destDir, String[] segs) from the Lucene cotrib directory (contrib/misc/src/java/org/apache/lucene/index) it creates 1 an index with segments descriptor file with wrong data. Namely wrong is the number representing the name of segment that would be created next in this index. public void split(File destDir, String[] segs) throws IOException { PAR destDir.mkdirs(); 2 FSDirectory destFSDir = FSDirectory.open(destDir); SegmentInfos destInfos = new SegmentInfos } PAR If some of the segments of the index already has this name this results either to 3 impossibility to create new segment or in crating of an corrupted segment.
Step 2: Extracting paragraphs We consider as paragraphs, text section separated by one or more white lines Two heuristics We prune out paragraph description from source code fragments and/or stack Traces "by using an approach inspired by the work of Bacchelli et al. Developer Discussion PAR When call the method IndexSplitter.split(File destDir, String[] segs) from the Lucene cotrib directory (contrib/misc/src/java/org/apache/lucene/index) it creates 1 an index with segments descriptor file with wrong data. Namely wrong is the number representing the name of segment that would be created next in this index. public void split(File destDir, String[] segs) throws IOException { PAR destDir.mkdirs(); 2 FSDirectory destFSDir = FSDirectory.open(destDir); SegmentInfos destInfos = new SegmentInfos } PAR If some of the segments of the index already has this name this results either to 3 impossibility to create new segment or in crating of an corrupted segment.
Step 3: Tracing paragraphs onto methods A) A valid paragraph must contain the keyword “method” These paragraphs must respect the following B) and the method name must be followed by a open parenthesis — two conditions: i.e., we match “foo(” Developer A) B) Discussion When call the method IndexSplitter.split(File destDir, String[] segs) PAR from the Lucene cotrib directory it creates an index with segments 1 descriptor file with wrong data. Namely wrong is the number representing the name of segment that would be created next in this index. CLASS: IndexSplitter METHOD: split( ...................................................................................... ...................................................................................... ...................................................................................... ......................................................................................
Step 4: Heuristic based Filtering We defined a set of heuristics to further filter the paragraphs associated with methods that assign each paragraph a score: .......................... Problem seems to come from MainMethodeSearchEngine in org.eclipse.jdt.internal.ui.launcher The Method searchMainMethods (IProgressMonitor, ,there's IJavaSearchScope, boolean) a call to addSubTypes(List, IProgressMonitor, IJavaSearchScope) Method if includesSubtypes flag is ON. This method add all types sub- types as soon as the given scope encloses them without testing if sub-types have a main! After return IType[] before the excecution .......................... CLASS: MainMethodSearchEngine METHOD: serachMainMethods SCORE
Step 4: Heuristic based Filtering We defined a set of heuristics to further filter the paragraphs associated with methods that assign each paragraph a score: a) Method parameters: .......................... 1 if the Problem seems to come from % of parameters method MainMethodeSearchEngine in s1= mentioned in the does not org.eclipse.jdt.internal.ui.launcher paragraphs. Value The Method have searchMainMethods (IProgressMonitor, between 0 and 1 parameters ,there's IJavaSearchScope, boolean) a call to addSubTypes(List, IProgressMonitor, IJavaSearchScope) Method if includesSubtypes flag is ON. This method add all types sub- types as soon as the given scope encloses them without testing if sub-types have a main! After return IType[] before the excecution .......................... CLASS: MainMethodSearchEngine METHOD: serachMainMethods % parameter = 100% -> s1= 1 SCORE
Recommend
More recommend