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

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Register Allocation CS 671 March 27, CS 671 – Spring Register Allocation - Motivation Consider adding two numbers together: Advantages: Fewer.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University On the Effectiveness.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extraction of.
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
Parameterized Object Sensitivity for Points-to Analysis for Java Presented By: - Anand Bahety Dan Bucatanschi.
Speeding Up Dataflow Analysis Using Flow- Insensitive Pointer Analysis Stephen Adams, Tom Ball, Manuvir Das Sorin Lerner, Mark Seigle Westley Weimer Microsoft.
1 Control Flow Analysis Mooly Sagiv Tel Aviv University Textbook Chapter 3
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
Symbolic Path Simulation in Path-Sensitive Dataflow Analysis Hari Hampapuram Jason Yue Yang Manuvir Das Center for Software Excellence (CSE) Microsoft.
C++ fundamentals.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
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.
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 17: Code Mining.
1 Using Heuristic Search Techniques to Extract Design Abstractions from Source Code The Genetic and Evolutionary Computation Conference (GECCO'02). Brian.
GAP- Generating Access Permissions IJAZ AHMED advised by : NESTOR CATANO
Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin.
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.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A lightweight.
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.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
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 PARSEWeb: A Programmer Assistant for Reusing Open Source Code on the Web Suresh Thummalapenta and Tao Xie Department of Computer Science North Carolina.
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.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
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.
Chapter 3 Object Interaction.  To construct interesting applications it is not enough to build individual objects  Objects must be combined so they.
Extracting a Unified Directory Tree to Compare Similar Software Products Yusuke Sakaguchi, Takashi Ishio, Tetsuya Kanda, Katsuro Inoue Department of Computer.
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 Extraction of.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
Register Allocation CS 471 November 12, CS 471 – Fall 2007 Register Allocation - Motivation Consider adding two numbers together: Advantages: Fewer.
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 9: Oct 18-22, 2010 Aditya Mathur Department of Computer Science Purdue.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
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.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
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)
Static Analysis of Object References in RMI-based Java Software
Control Flow Testing Handouts
Outline of the Chapter Basic Idea Outline of Control Flow Testing
©2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Important terms Black-box testing White-box testing Regression testing
Important terms Black-box testing White-box testing Regression testing
HW05: Graphs and Shortest Paths
Recommending Verbs for Rename Method using Association Rule Mining
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 Towards Program Understanding Supported by Data-flow Visualization Takashi Ishio Osaka University 1

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Research Background Modularization techniques decompose a single feature into modules. –To understand the feature, developers have to read multiple modules. Can we reduce #modules that developers have to read? 2

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Example: When a dialog is not closed? public void actionPerformed(ActionEvent evt) { if (evt.getSource() == ok) { if (editor.getAbbrev()==null || editor.getAbbrev().length()==0) { getToolkit().beep(); return; } // process the input... if (!checkForExistingAbbrev()) return; … // close the dialog dispose(); } 3 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

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Program slicing is promising, but … A slicing tool based on Soot framework takes 20 minutes to construct SDG for JEdit (160KLOC). –Most is spent for pointer analysis. –Few seconds to compute a program slice It is impractical for daily work. –A typical day: [Parnin, Software Quality Journal, 2011] a 2-hour programming session + several 30 minute sessions 4

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

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 A conditional predicate of if/for/while controls the enclosed statements. –“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 –Dynamic binding is resolved by CHA Field Access –A field is also a variable vertex. –Object-insensitive 11 > max(x, y) xyreturn > max(x, y) x y > size objsize > 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 Heuristic edges Library classes are ignored. Heuristic edges between set/get methods Example: Actual-parameter of setText(String)  a return value of getText() 13

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Fractal Value Filter Fractal Value [Koike, 1995] –A value of a node is divided to fan-in nodes. – A node whose fractal value is less than 0.1 is filtered out

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Implementation (1/2) 15 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) 16 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 17

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? –Assigned program understanding tasks to 16 developers. 18

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 an invalid user’s action is prevented in JEdit. EditAbbervDialog.java,Line 153 (Task A) JEditBuffer.java, Line 2038 (Task B) 30 minutes for each task (excluding graph construction) 16 participants (4 industrial + 12 graduate) 20 Group 1Group 2Group 3Group 4 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 Answer as a data-flow graph 21 AbbrevsOptionPane. actionPerformed is called. “add” button is pushed. The second argument of new EditAbbrevDialog The first argument of EditAbbrevDialog.init The argument of AbbrevEditor.setAbbrev(String) The value is the argument of JTextField.setText(String) The value is a return value of JTextField.getText() The string is a return value of AbbrevEditor.getAbbrev(). IF statement: A string is null or “”. Task A: the dialog is not closed. The conditions are explained by a user’s action on GUI or the external environment.

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.79 w/o tool: 0.71 t-test (a=0.05) shows the difference is significant. 23

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Observation No problem caused by infeasible data-flow edges. –Participants quickly confirmed source code and went back to the graph view. A data-flow graph allowed developers to know the progress of investigation tasks. A detailed graph was never used. –Participants combined data dependence among parameters with source code. –An “abstract” data-flow graph is enough for developers. 24

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 25

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Conclusion Simple data-flow analysis –Faster than regular dependence analysis –The analysis may generate infeasible paths, but it is still effective. Future Work –Experiment on other systems –Summarization of a long data-flow path for visualization –Evaluate how infeasible data-flow paths affect automated analysis 26