Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graph Data Management Lab, School of Computer Science gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet.

Similar presentations


Presentation on theme: "Graph Data Management Lab, School of Computer Science gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet."— Presentation transcript:

1 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Sheng Huang, Yiqi Lu, Yanghua Xiao and Wei Wang School of Computer Science Fudan University Shanghai, China XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation Yu Wang, IBM China Research Lab Shanghai, China

2 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 2 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Outline  Motivation  Solution  Evaluation  Conclusion

3 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 3 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Framework-based programming  Framework-based programming XML configuration file Client code Example: Action class and struts- config.xml  Programmers need to accurately configure many xml files during the development of a large application based on frameworks Example: Struts, Spring, iBatis  Errors in XML configuration file leads to: Fatal consequence: runtime fault or application failure

4 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 4 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Prons and cons  Prons: Simplify implementation Make programs more structural High productivity of development  Cons: Complex Lack of documentation  Consequences: Incorrect and inefficient usage of the frameworks in the coding phase Defects are easily introduced into the software

5 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 5 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Problems login "> Class LoginAcion implement Action { IResultMsg login(String username, String pwd){….}} LoginAction.java Login.jsp <action path=“/LoginFormAction" type=“LoginAction“ method=“Login” …… struts-config.xml Client code: Want to finish configuration file: Problem: can we recommend XML configuration snippets automatically?

6 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 6 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Previous works Previous approaches XML schema templates File Context Code snippets 1. Schema based approach2. Other code recommending approach 12 Code repositories Association rule mining Code snippets Our approach 1n Open source code repositories … Frequent Tree pattern mining Code snippets

7 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 7 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Challenges  Diversity of frameworks Struts, Spring, iBatis……  Structural complexity of XML configuration file Tree structure Elements, attributes,….  Semantic mapping between xml configuration files and client codes

8 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 8 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Our Contribution  A xml snippet recommendation solution Mine reusable XML patterns XML code assistance by three queries Type query, Structural Query and Context query  An eclipse plug-in XMLSnippet: http://gdm.fudan.edu.cn/Wiki.jsp?page=XMLSnippet http://gdm.fudan.edu.cn/Wiki.jsp?page=XMLSnippet  Extensive evaluation of our tool

9 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 9 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Demo 1. Type Query(TQ) The query to get the recommendation of one specific type of framework as the initial content of an empty XML document. 2. Structural Query(SQ) The query to get the subtree recommendation according to the position of the current cursor in the XML document under editing. 3. Context Query(CQ) The query to get the sample reference to help programmers to input the context sensitive attribute/element values. <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts- config_1_1.dtd"> Blank file <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts- config_1_1.dtd"> struts-config.xml

10 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 10 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Outline  Motivation  Solution  Evaluation  Conclusion

11 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 11 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 XMLSnippet Approach Offline mining Online query

12 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 12 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 XMLSnippet Approach

13 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 13 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Frequent tree pattern mining  Input: XML code repository  Objective: mines XML repository to generate snippets  Apply frequent subtree mining algorithm [Chi and Xia, TKDE 05] to get frequent pattern  Use Trie to index result

14 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 14 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Frequent tree pattern mining Build candidate subtree set from root element Grows the subtree pattern Keep candidates whose frequency are larger than threshold Return the result frequent subtree patterns Result Map Class Result Map Result Result Map Class Result Result Map ClassResult Column Property Pattern- growth method

15 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 15 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 XMLSnippet Approach

16 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 16 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Source code indexing  Build a Prefix tree to index all root-to- leaf-node paths in frequent tree patterns To fast answer SQ and CQ according to the editing prefix  Each node in the prefix tree corresponds to a root-to-leaf-node paths in the tree pattern.

17 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 17 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Online Query  Once the hotkey is triggered, the prefix tree of the XML Doc under editing is fed to subtree query processing to find matched FTPs TQ: will return the fundamental XML structure of the framework to fill the empty XML Doc SQ: will return snippets generated from an appropriate FTP with the same subtree of XML doc context CQ: when an attribute value is expected, the tool will leverage the context syntax tree (CST) to generate candidate values extracted from corresponding client codes by association mining

18 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 18 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Outline  Motivation  Solution  Evaluation  Conclusion

19 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 19 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 What to evaluate? 1.Generality: Could the tool be applied to different frameworks? 2.Effectiveness: Could the tool produce reusable snippets to shorten the programming cycle? 3.Usability: Is the tool useful for programmers with different skill levels? 4.Efficiency: Could the tool mine frequent tree patterns, build index and propose reusable snippets efficiently?

20 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 20 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Test project  The test project is a simple book store management project including the basic CRUD (Create, Retrieval, Update, and Delete) functions.  Programmers under evaluation

21 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 21 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 RQ1: Generality Generality. Could the tool be applied to different frameworks?

22 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 22 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 RQ2 & RQ3: Effectiveness and Usability  3 tasks: Task 1: Initialize Web.xml for the target application Task 2: Construct the Struts_Config.xml Task 3: Construct the iBATIS configuration xml files  Evaluation result

23 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 23 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 RQ4: Efficiency Could the tool mine frequent tree patterns, build index and propose reusable snippets efficiently?

24 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 24 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Outline  Problem  Example  XMLSnippet approach  Evaluation  Conclusion

25 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 25 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Conclusion  Propose a method to recommend reusable XML snippets to help programmers configure XML files Key technique : close frequent tree mining prefix tree based indexing  Future work: Value recommendation Online version of XMLSnippet

26 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 THANK YOU! Q/A

27 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 27 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Frequent used attribute and element combination will be recommended together for SQ in XMLSnippet

28 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 28 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012

29 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 29 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 In order to finish the same task as XMLSnippet do in on step, the Eclipse XMLEditor needs several steps…. Step 1 Add Element “Action”

30 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 30 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Step 2 Add Child Element “forward” of Element Action

31 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 31 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Step 3 Add attribute “type”

32 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 32 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 Step 3 Add attribute “scope”

33 Graph Data Management Lab, School of Computer Science GDM@FUDANGDM@FUDAN gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012 33 XMLSnippet: A Coding Assistant for XML Configuration Snippet Recommendation 34 th Annual IEEE Computer Software and Applications Conference, Izmir, Turkey, 16-20 July, 2012


Download ppt "Graph Data Management Lab, School of Computer Science gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet."

Similar presentations


Ads by Google