27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Analysis method plug-in Unique identifier of the plug -in in Eclipse<br />

identifier<br />

platform<br />

Type of extension point The type of extension point associated with the<br />

action<br />

Plug-in action class The class for invocation of an action<br />

Command structure The abstracted structure for generating<br />

concrete command<br />

The integrator provides the integration definition in the user<br />

interface, as s hown in Fig. 3. The analysis method name is<br />

“JDepend”. Its required input is of the type<br />

“IPackageFragmentRoot(binary files)” for Java application.<br />

To integrate JDepend implemented as Eclipse plug-in, our<br />

framework provides facility to ease the definition specification.<br />

If the integrator provides t he analyzer implementation, our<br />

framework interprets the plug-in configuration file and lists all<br />

the actions as analysis method candidates. The JDepend plug-in<br />

includes only one analysis method candidate, as shown in Fig.<br />

3. The integrator can add the definition by selecting the<br />

JDepend analysis method or inputting the definition directly.<br />

Its extension type is “popupmenu”. The action class name is<br />

“de.loskutov.eclipse.jdepend.actions.ShowDependecy”.<br />

To integrate JDepend analyzer with command line interface,<br />

we refer to its documents and find that its command follows the<br />

syntax “java j depend.xmlui.JDepend [-components<br />

] [-file ] [directory2<br />

[directory 3] ...] ”. By abstracting its input and output, one of<br />

the running mode of JDepend command structure is defined as<br />

“java jdepend.xmlui.JDepend -file #OUTPUT# #INPUT#”.<br />

UI for analysis method selection<br />

Figure 3. User interface for integration sepecification and selection of<br />

analysis method in Eclipse plug-in analyzer<br />

(2) Using an integrated analysis method<br />

The user plan to analyze the software project Log4j [10].<br />

Log4j is an open source project of the Apache Software<br />

Foundation. Log4j enables logging at runtime without<br />

modifying the application binary so as to avoid a heavy<br />

performance cost for logging. The artifacts of Log4j contain<br />

about 20000 lines of source code and 188 classes.<br />

Because the artifacts of Log4j do not contain a so ftware<br />

model, our framework first generates a UML model based on<br />

the source code of Log4j using a reverse tool EclipseUML [21].<br />

We build a tree view of the UML model in our framework. The<br />

user selects the whole project as analysis object in the tree view<br />

of the Log4j U ML model. The integration definition of an<br />

analysis method is saved in an XML file. The integration<br />

definitions form a repository of reusable analysis methods.<br />

Based on the integration definitions, our framework provides a<br />

list of integrated analysis methods for the analysis method<br />

users. The user interface for selecting analysis object and<br />

analysis method is shown in Fig. 4.<br />

Figure 4. User interface for analysis object and analysis method selection<br />

Our framework accepts UML model elements and maps the<br />

input to the artifact set IJavaProject of Log4j project. Because<br />

the required input of JDepend is an IPackageFragmentRoot<br />

folder holding binary files, our framework breadth-first<br />

searches IPackageFragmentRoot in the project and find two<br />

folders: “src” folder holding source code and “bi n” folder<br />

holding binary files. The “bin” f older is the proper analysis<br />

input. Our framework invokes the analyzers with the adapted<br />

inputs. For analysis method with one analyzer implementation,<br />

our framework runs the analyzer by default. For analysis<br />

method with two analyzer implementations, user can select to<br />

run one or two analyzer implementations.<br />

The user selects to run two JDe pend analyzer<br />

implementations. Our framework first pre pares proper inputs<br />

for analyzers. The inpu t of plug-in analyzer is an object with<br />

“IFolder” interface representing the IPackageFragmentRoot<br />

folder “bin” in Eclipse workspace. The input of analyzer with<br />

command line interface is the folder location. After invocation<br />

of the plug-in analyzer, the command for analyzing the Log4j<br />

is triggered and the analysis results are shown in the graphical<br />

user interface. For the a nalyzer with co mmand line interface,<br />

our framework generates a concrete command “java<br />

jdepend.xmlui.JDepend<br />

-file<br />

C:\log4j\AnalyticalResult\JDepend_bin_20111223161327.xml<br />

C:\log4j\bin” automatically when the log4j project locates at<br />

C:\log4j. Our framework uses runtime class to create a c hild<br />

process for command execution.<br />

Analysis Input:<br />

log4j/bin/<br />

ResultMap.xml<br />

Figure 5. The traceability recording process<br />

Analysis Result:<br />

JDepend_bin_20111223161327.xml<br />

In the input adaptation and analyzer execution stage, our<br />

framework saves tr aceability information to dedu ce the<br />

relationship between UML elements and analysis results. The<br />

relationship between the element “project” in the UML m odel<br />

and the analysis result file generated by JDepend is saved in an<br />

XML file “ResultMap.xml”. The process is shown in Fig. 5.<br />

Our framework extends the UML model with th e JDepend<br />

analysis result. The user can interpret the analysis results in the<br />

215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!