1 / 14

Towards Locating a Functional Concern Based on a Program Slicing Technique

This paper proposes a heuristic approach to automatically extract and show collaborative software modules implementing functional concerns using program slicing. The approach involves identifying clue program elements, finding related modules, and understanding how the modules collaborate.

dbenoit
Download Presentation

Towards Locating a Functional Concern Based on a Program Slicing Technique

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Towards Locating a Functional Concern Based on a Program Slicing Technique Takashi Ishio1,2, Ryusuke Niitani2 and Katsuro Inoue2 1University of British Columbia 2Osaka University AOAsia 2

  2. Abstract • Software includes many functional concerns. • A functional concern is often implemented by collaborative software modules. • To understand a functional concern, you need to … • Identify clue program elements • Find related modules • Understand how the modules collaborate • We propose a heuristic approach to automatically extract and show the modules and their collaboration. costly AOAsia 2

  3. i = 3; • if (a > 0) { • print i; • } definition data dependence control dependence <3,i> use Program Slicing • An automatic technique to extract relevant statements and relations • A program P is converted to a program dependence graph. • vertices: statements in P • edges: control/data dependence relations • You specify a slicing criterion <s,v> in P. • s: a statement • v: a variable defined or used at s • You get statements that affect or depend on v by graph traversal. AOAsia 2

  4. dependence control flow concern (open document) slicing result Issue of Using Program Slicing • Slicing often results too many statements. • main(), crosscutting concerns, … • If you calculate a program slice for , slicing extracts . Main.main(args) App.run() Menu.onClick(buttonID) FileDialog.getPath() Document.open(path) File.read(path) MDI.add(document) Log.debug(message) App.quit() FileDialog.getPath() Document.save(path) File.write(path) AOAsia 2

  5. dependence control flow concern (open document) slicing result barrier Our Method (1/2) • To extract closely related statements, we terminate the graph traversalat the appropriate vertices. • A barrier [1] is a vertex that terminates the traversal. • The original barrier is set manually. Main.main(args) App.run() Menu.onClick(buttonID) FileDialog.getPath() Document.open(path) File.read(path) MDI.add(document) Log.debug(message) App.quit() FileDialog.getPath() Document.save(path) File.write(path) [1] Krinke, J.: Slicing, Chopping, and Path Conditions with Barriers. Software Quality Journal, Vol.12, No.4, pp.339-360,December 2004. AOAsia 2

  6. Our Method (2/2) • Automatically identify appropriate barriers • use heuristics • Extract a small subset of conservative slice • Closely related to criteria Conservative Slicing Our Method dependence specified criterion concern related result barrier automaticallyfound Barriers AOAsia 2

  7. Extracting a Functional Concernwith Slicing • Convert source code to a program dependence graph • Specify one or more methods or fields of interest to you • Inputs are converted to vertices • Extract related statements • Identify primary vertices • Identify barriers with heuristics • Slice using the result of i. and ii. • Visualize the result of 3. AOAsia 2

  8. 3.i.Identifying “primary vertices” • The vertices in which a barrier is not set • to avoid terminating important traversals • The vertices in the paths from dominator to post-dominator • dominator: the nearest common ancestor reachable to all specified vertices • post-dominator: the nearest common successor reachable from all specified vertices primary vertices dominator post-dominator Specified vertices = Your inputs AOAsia 2

  9. 3.ii.Identifying Barriers with Heuristics • A field access • pass data from one concern to another • A method entry point with no arguments • Its behavior is independent of the caller method. • An abstract method entry point • Its behavior is defined at the interface level. • Library • e.g. classes in java and javax package AOAsia 2

  10. dominator / post-dominator specified criterion barrier added by slicing 3.iii.Slicing • A backward/forward traversal from criteria • The traversal is terminated at barriers. primary vertices slicing result AOAsia 2

  11. Preliminary Case Study • Aim: estimate the effectiveness of our approach • Target Program: Duplicated File Checker • Java / 1331 LOC / 14 files • Overview main() → read arguments → begin file checking → notify → output → (end file checking) • Target Concern: “notify” • Input: 3 methods • notifyProgressValue, notifyErrorFile, notifyFinished AOAsia 2

  12. Results: size • Small subset (less than 1/4 about LOC) Size of slices Heuristic slice: Checker, FileList, FileMD5 and CheckerListener classes (Non-heuristic slice) – (Heuristic slice): Main, MainWindow and classes for GUI Extracted classes AOAsia 2

  13. Result: extracted slice(as a concern graph) • “Notify” concern is extracted appropriately. • No weakly related method (e.g. main()) Extracted slice (as a concern graph) criterion AOAsia 2

  14. Summary and Future Work • We proposed an approach to extract the collaborative modules implementing a functional concern. • We introduced heuristics into slicing. • Future Work • Develop a fully automated analysis tool • Apply various heuristics • e.g. a high fan-in method • Apply to large-scale software AOAsia 2

More Related