Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A lightweight.

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

Overview Structural Testing Introduction – General Concepts
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University On the Effectiveness.
 Program Slicing Long Li. Program Slicing ? It is an important way to help developers and maintainers to understand and analyze the structure.
Graph Coverage for Design Elements 1.  Use of data abstraction and object oriented software has increased importance on modularity and reuse.  Therefore.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extraction of.
Parameterized Object Sensitivity for Points-to Analysis for Java Presented By: - Anand Bahety Dan Bucatanschi.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Measuring Copying.
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 17: Code Mining.
Su Ping and Ma Xiao-xing Department of Computer Science and Technology Nanjing University Automated Analysis of Dynamic Dependences between Java Components.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Mining Coding Patterns to Detect Crosscutting Concerns.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
*Graduate School of Engineering Science, Osaka University
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
Automatic Identification of Concurrency in Handel-C Joseph C Libby, Kenneth B Kent, Farnaz Gharibian Faculty of Computer Science University of New Brunswick.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
2006/09/19AOAsia 21 Towards Locating a Functional Concern Based on a Program Slicing Technique Takashi Ishio 1,2, Ryusuke Niitani 2 and Katsuro Inoue 2.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What Kinds of.
Introduction Overview Static analysis Memory analysis Kernel integrity checking Implementation and evaluation Limitations and future work Conclusions.
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University DCCFinder: A Very- Large Scale Code Clone Analysis.
Graph Data Management Lab, School of Computer Science gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Investigation.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Program Slicing on Java byte-code for Locating Functional.
1 A Static Analysis Approach for Automatically Generating Test Cases for Web Applications Presented by: Beverly Leung Fahim Rahman.
Bug Localization with Machine Learning Techniques Wujie Zheng
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University How to extract.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 7 Clicker Questions September 22, 2009.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Towards Program.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Cage: A Keyword.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
Aspect Mining Jin Huang Huazhong University of Science & Technology, China
Extracting a Unified Directory Tree to Compare Similar Software Products Yusuke Sakaguchi, Takashi Ishio, Tetsuya Kanda, Katsuro Inoue Department of Computer.
How Can I Use This Method? 2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING HOW.
API Hyperlinking via Structural Overlap Fan Long, Tsinghua University Xi Wang, MIT CSAIL Yang Cai, MIT CSAIL.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Classification.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extraction of.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Whole Test Suite Generation. Abstract Not all bugs lead to program crashes, and not always is there a formal specification to check the correctness of.
DevCOP: A Software Certificate Management System for Eclipse Mark Sherriff and Laurie Williams North Carolina State University ISSRE ’06 November 10, 2006.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Software Ingredients:
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Experience Report: System Log Analysis for Anomaly Detection
Static Analysis of Object References in RMI-based Java Software
Source File Set Search for Clone-and-Own Reuse Analysis
Program Slicing Baishakhi Ray University of Virginia
Boris Todorov1, Raula Gaikovina Kula2, Takashi Ishio2, Katsuro Inoue1
Recommending Verbs for Rename Method using Association Rule Mining
TensorFlow: A System for Large-Scale Machine Learning
Dotri Quoc†, Kazuo Kobori†, Norihiro Yoshida
Near-Omniscient Debugging for Java Using Size-Limited Execution Trace
Presentation transcript:

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A lightweight dataflow analysis to support source code reading Takashi Ishio Shogo Etsuda, Katsuro Inoue Osaka University 1

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Research Background Developers often read source code written by other developers. –Software Inspection: to find potential problems –Code Search: to find reusable components in a software repository. 2

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Program slicing is promising … Program slicing has been applied to debugging and program comprehension. We implemented a program slicing tool for Java based on Soot framework. Soot is a Java bytecode analysis framework developed by McGill University. 3

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University … but, not so effective? The slicing tool takes 40 minutes to construct SDG for JEdit 4.2 (140 KLOC). –few seconds to compute a program slice Developers in a company said: “It is much faster than our previous tool!” but “it is still impractical for daily work.” Their source code is frequently updated. 4

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Our Approach: Simplified Data-flow Analysis Imprecise, but efficient Control-flow insensitive Object insensitive Inter-procedural 5 Target: Java Programs

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Variable Data-flow Graph A directed graph Node: variable, statement Edge: apporximated control- and data-flow We directly extract a data-flow graph from AST. –without a control-flow graph 6

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Data-flow Extraction A statement “a = b + c;” is translated to: 7 > a = b + c; > b > a data > c data lhs = rhs ; is regarded as a dataflow rhs  lhs.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Control-flow Insensitivity (a) X = Y; (b) Y = Z; (b) Y = Z; (a) X = Y; 8 > X = Y; > X > Z > Y = Z; > Y (a) (b) The transitive path Z  X is infeasible for the left code. Data Dependence No Data Dependence The same graph may be extracted from different code.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Approximated Control-Dependence An if statement controls its then/else blocks. –“if (X) { Y = Z; }” is translated to: 9 > Y = Z; control > Y > Z > X data

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A method graph static int max ( int x, int y ) { int result = y ; if ( x > y ) result = x ; return result ; } x y x > y result = y result result = x return result; > dataflow from callsites to callsites

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Inter-procedural Edges Method Call Field Access –A field is also a variable vertex. Object-insensitive 11 > max(x, y) xyreturn > max(x, y) x y > <<Field Write>> > size objsize <<Field Read>> objreturn

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University > Graph Traversal 12 > max(int,int) C.p size class C { void m() { int size = max(p, q); y.setSize(size); } arg1ret > setSize() objarg C.y s class D { void setSize (int s) { this.size = s; } …. } D.size max(…) (this) objarg arg2 C.q

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Implementation (1/2) 13 Data-flow edges are automatically traversed from a method where the caret is located. Graph Construction: a batch system Viewer: an Eclipse plug-in

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Implementation (2/2) 14 Only method calls, parameters and fields are visible.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Tradeoff Simplified analysis –AST and symbol table –Class Hierarchy Analysis No control-flow graph, no def-use analysis × Infeasible paths, unrealizable paths –Because of control-flow insensitivity 15

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Experiment Is it efficient? –Analyzed several Java programs Is it effective for program understanding? –We have assigned program understanding tasks to graduate students. 16

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Performance Measurement SoftwareSize (LOC) Time to construct AST and symbol table (sec.) Time to analyze dataflow (sec.) Total Time (sec.) ANTLR , JEdit 4.3pre11168, Apache Batik , Apache Cocoon , Azureus , Jboss 4.2.3GA696, ,051 JDK ,8871,0541,0012, on Windows Vista SP2, Intel® Core2 Duo 1.80 GHz, 2GB RAM

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Program Understanding Tasks Identify how a user’s action makes a sound beep in JEdit. EditAbbervDialog.java, Line 153 (Task A) JEditBuffer.java, Line 2038 (Task B) 30 minutes for each task (excluding graph construction) 18 Participant 1, 2Participant 3, 4Participant 5, 6Participant 7, 8 Task A with ToolTask A w/o ToolTask B with ToolTask B w/o Tool Task B with ToolTask A w/o ToolTask A with Tool “w/o Tool” means a regular Eclipse SDK without our plug-in.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Task A: JEdit sounds beep at EditAbbervDialog.java: line 153 public void actionPerformed(ActionEvent evt) { if (evt.getSource() == ok) { if (editor.getAbbrev() == null || editor.getAbbrev().length() == 0) { getToolkit().beep(); return; } if (!checkForExistingAbbrev()) return; isOK = true; } dispose(); } 19 The argument of setText(String) A return value of JTextField.getText() AbbrevsOptionPane. actionPerformed is called. The argument of AbbrevEditor.setAbbrev(String) (omitted) “Add” Button Clicked The correct answer is defined as a data-flow subgraph.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Correctness of answer Score = path(v1, m): 0.5 * (1 edge / 2 edges) + path(v2, m): 0.5 * (2 edge / 2 edges) = m v1 v2 [Example] Correct Answer: V = {v1, v2} A participant identified two red edges.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Result Average Score: with tool: 0.83 w/o tool: 0.73 t-test (a=0.05) shows the difference is significant. 21 with Tool without tool

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Observation No problem caused by infeasible paths. –Participants might manually investigate meaningful paths in the interactive view. –We need to evaluate how infeasible paths affect automated analysis. Detailed Analysis is still ongoing. 22

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Related Work Execution-After Relation [Beszédes, ICSM2007] –Control-flow based approximation of SDG GrouMiner [Nguyen, FSE2009] –API Usage Mining based on Graph Mining –Each method is translated to a “groum” that approximates control- and data-flow. Intra-procedural analysis 23

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Conclusion Simplified data-flow analysis –Much faster than regular dependence analysis –The analysis may generate infeasible paths, but it is still effective. Future Work –Detailed analysis on the result –A replicated study with industrial developers –Comparison with Program Slicing 24

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 25

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Threats to Validity Just a single case study. The effectiveness of an interactive view is included in the study. Score definition is fair? t-test assumes normal distribution of score. 26