Comment Extractor - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Comment Extractor

Description:

Comment Extractor. Ethan Chan. Tianqiu Tem Wang. Juliana Wong. 2. Introduction (1) ... Comment Extractor. A plug-in for JEdit (an open source java editor) ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 22
Provided by: TEM72
Learn more at: https://cseweb.ucsd.edu
Category:

less

Transcript and Presenter's Notes

Title: Comment Extractor


1
Comment Extractor
  • Ethan Chan
  • Tianqiu Tem Wang
  • Juliana Wong

2
Introduction (1)
  • What do high level software tools provide?
  • abstract level understanding
  • specific knowledge
  • focus
  • After using these tools, programmers eventually
    have to touch source code

Abstract Level
Text Level
3
Introduction (2)
  • Comment
  • explanatory text embedded in program source
  • helps human readers understand program source
    code
  • the most useful thing at code level

4
Motivation (1)
  • Comments are localized

Expression of interest
Expression declaration
Comments associated with expression
The same expression used elsewhere
  • Comments relating to the expression are found
    only in one place

5
Motivation (2)
  • Searching for comments
  • is a tedious job
  • interrupts original work flow

6
Motivation (3)
  • Sometimes Expression of interest is far away

Possibly a gap of a lot of files!
Expression of interest
Expression Declaration
Comments associated with Expression
7
Motivation (4)
  • Examples
  • Grep
  • too many incorrect results
  • Javadoc
  • format must be specific
  • needs to know belonging class
  • More in DEMO later on

8
Claim
  • Programmers shouldnt
  • stop the workflow
  • do any extra work to find comments.
  • Need a tool
  • deals with these problems
  • extracts comments automatically.

9
Solution
  • Comment Extractor
  • A plug-in for JEdit (an open source java editor)
  • Extracts comments from 4 types of CO
  • Returns comments by Intelli-Selection
  • users selection
  • cursors location

10
What the icons mean
Variable comment
Type comment
Java predefined type comment
Function comment
No comment
11
DEMO Introduction to the GUI
12
DEMO
13
DEMO Complex process finding comments from
Inherited Classes
  • Need to knowwhich classhas isInt()scomment

Type
isInt()
isReal()
BasicType
PointerType
.
isInt()
isReal()
isInt()
isReal()
IntType
BooleanType
isInt()
isReal()
isInt()
isReal()
.
14
DEMO Finding out
the usual way
  • Where is m?
  • 170 lines up, we find its declaration
  • Where is Machine class?
  • 1 out of 61 files, we find its declaration
  • Where is method emitLoad?
  • 200 lines down, we find two overloaded
    declarations
  • Which emitLoad method is correct?
  • Need to know what parameter (sto, tmp) types are!
  • Give up?

15
DEMO Finding out
the JavaDoc way
  • Where is m?
  • 170 lines up, we find its declaration
  • Open JavaDoc on Machine class
  • Find emitLoad documentation
  • Need to know what parameter (sto, tmp) types are!
  • Not all comments are JavaDoc style, so are not
    seen!

16
DEMO Finding out
the grep way
  • Assuming there are few uses of the text
    emitLoad, where is emitLoad?
  • Need to weed out emitLoad declarations
  • Much faster, only because not repeated
    declaration
  • Still need to know which overloaded method
  • (still need to find out sto and tmp!)
  • Still need to open files and read comments
  • Hard to go back to original position if not
    created in separate process

17
DEMO Finding out
the Comment Extractor way
18
Limitations
  • This tool wont be helpful if
  • No comments
  • Bad comments
  • Comments not associated with a CO
  • a plugin currently only for JEdit
  • works only for Java

While loop
19
Lessons Learned (1)
  • Didnt have CE to develop CE
  • difficult to understand JEdits massive source
    code
  • Unintentional benefits
  • i.e. warping files

20
Lessons Learned (2)
  • Modular design allowed easy integration of
    unanticipated changes
  • User Interaction (GUI)
  • Functionality

Comment Extractor
JEdit
Comment Hunter
Location Searcher
GUI
JEdit plugin interface
21
Any comments? (no pun intended)Well help you
extract it!
Comment Extractor
Write a Comment
User Comments (0)
About PowerShow.com