Design and Implementation of Bytecode-Based Java Slicing System Fumiaki Umemori, Kenji Konda, Reishi Yokomori, Katsuro Inoue Osaka University, Japan Software Engineering Laboratory, Department of Computer.

Download Report

Transcript Design and Implementation of Bytecode-Based Java Slicing System Fumiaki Umemori, Kenji Konda, Reishi Yokomori, Katsuro Inoue Osaka University, Japan Software Engineering Laboratory, Department of Computer.

Design and Implementation of Bytecode-Based Java Slicing System

Fumiaki Umemori, Kenji Konda, Reishi Yokomori, Katsuro Inoue Osaka University, Japan

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1

Background

Software systems are becoming large and complex.

Developers spend a large amount of time to test and debug their systems.

Various techniques for improving debugging efficiency have been proposed

Program Slicing

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 2

Dependence-Cache (DC) Slicing

¶ Dependence-Cache Slicing : Intermediate slicing between static slicing and dynamic slicing Static slice

DC slice

Dynamic slice DD † analysis CD ‡ analysis Static Static

Dynamic Static

Dynamic Dynamic Target Source code

Source code

Execution trace † DD(Data Dependence), ‡ CD(Control Dependence) Advantage

Better analysis precision

than static slice

Smaller analysis cost

than dynamic slice ¶ Ashida, Y., Ohata, F. and Inoue, K. : “Slicing Methods Using Static and Dynamic Information”, Proceedings of the 6th Asia Pacific Software Engineering Conference , 344-350, 1999.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 3

Dynamic Data Dependence Analysis for DC Slicing

Key idea: Cache On program execution, we have only to trace

the most recently defined statement

for each variable using

cache

.

Cache(v)

: statement that defined the value of

v

most-recently.

Operations for caches Before program execution, For each variable

v

, Cache(

v

)   .

On program execution, For each statement

s

, when

v

is defined, Cache(

v

) 

s

.

when

v

is referred to, we extract dynamic data dependence from Cache(

v

) to

s

about

v

.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 4

Slicing for Java

Java programs have many elements determined at runtime Dynamic DD analysis is necessary

DC slicing

is effective for Java Slicing System Proposed Method Analyze dynamic data dependence using Java Virtual Machine Analysis is based on bytecode Mapping bytecode onto source code

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 5

Data Dependence Analysis Based on Java Virtual Machine

Java Virtual Machine local variable 0 8 1 stack 5 data dependence 0 corresponding cache s4 1 s2

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 6

System Implementation

Bytecode-Based Java DC-Slicing System

(U1) Compile unit Extended Java compiler to create cross reference table (U2) Control Dependence Analysis unit Extract CD relation statically (U3) Execution unit Extended Java Virtual Machine ( JVM ) relation dynamically to extract DD (U4) Slicing unit Construct Program Dependence Graph ( PDG ) Compute Slice and

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 7

Overview of Slice Calculation

Java Compile Cross Reference Table Slice Criterion

User Input Tool Tool Output

Slicer

static control dependence dynamic data dependence

PDG(Bytecode) CD analysis tool Java Virtual Machine

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 8

Conclusions and Future Works

Bytecode based Java Slicing System Cross Reference Table Static Analysis for Control Dependence Dynamic Analysis for Data Dependence Slicer Future Works Cross Reference Table for optimized bytecode Improve Data Dependence analysis time

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 9

END

Thanks !

Question ?

(But, please speak

slowly

!)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 10