XSnippet: Mining For Sample Code Naiyana Tansalarak and Kajal Claypool Presented by: Shan Li CISC864.

Slides:



Advertisements
Similar presentations
PHP functions What are Functions? A function structure:
Advertisements

Based on Java Software Development, 5th Ed. By Lewis &Loftus
Advanced Programming in Java
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Parameterized Object Sensitivity for Points-to Analysis for Java Presented By: - Anand Bahety Dan Bucatanschi.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-Oriented PHP (1)
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 3 Object Oriented Programming in Java Language Basics Classes,
1 Evan Korth New York University Inheritance and Polymorphism Professor Evan Korth New York University.
1 Evan Korth New York University Inheritance and Polymorphism Professor Evan Korth New York University.
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Lecture 7: UML Class Diagrams CSE 111 7/15/20151Copyright W. Howden.
Unified Modeling Language
Chapter 3 Data Models.
LECTURE 07 Programming using C# Inheritance
System/Software Testing
Chapter 8 More Object Concepts
CS-434: Object-Oriented Programming Using Java Week 2
1 PARSEWeb: A Programmer Assistant for Reusing Open Source Code on the Web Suresh Thummalapenta and Tao Xie Department of Computer Science North Carolina.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
Arrays Module 6. Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array.
Tuc Goodwin  Object and Component-Oriented Programming  Classes in C#  Scope and Accessibility  Methods and Properties  Nested.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Object Based Programming Chapter 8. 2 In This Chapter We will learn about classes Garbage Collection Data Abstraction and encapsulation.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
CSE 341, S. Tanimoto Java brief review - 1 Java Brief Review Java’s strengths Object-oriented terminology Inheritance Interfaces An example with inheritance.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
Introduction to Java Chapter 7 - Classes & Object-oriented Programming1 Chapter 7 Classes and Object-Oriented Programming.
Constructors & Garbage Collection Ch. 9 – Head First Java.
Chapter 5 Introduction to Defining Classes
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
C++ Inheritance Data Structures & OO Development I 1 Computer Science Dept Va Tech June 2007 © McQuain Generalization versus Abstraction Abstraction:simplify.
Inheritance Inheritance is the process of extending the functionality of a class by defining a new class that inherit,all the features of extending class.
Chapter 6 - More About Problem Domain Classes1 Chapter 6 More About Problem Domain Classes.
Rigorous Testing by Merging Structural and Behavioral UML Representations Presented by Chin-Yi Tsai.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
1 C# - Inheritance and Polymorphism. 2 1.Inheritance 2.Implementing Inheritance in C# 3.Constructor calls in Inheritance 4.Protected Access Modifier 5.The.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Object Based Programming Chapter 8. 2 Contrast ____________________ Languages –Action oriented –Concentrate on writing ________________ –Data supports.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
CSE 413 Programming Languages & Implementation Hal Perkins Autumn 2012 Multiple Inheritance, Interfaces, Mixins 1.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Arrays Chapter 7.
Modeling with UML – Class Diagrams
Appendix 3 Object-Oriented Analysis and Design
Sections Inheritance and Abstract Classes
OOP: Encapsulation &Abstraction
The Movement To Objects
Unified Modeling Language
Review What is an object? What is a class?
Inheritance and Polymorphism
Chapter 11 Object-Oriented Design
Collaborations and Hierarchies
Nested class.
Lecture 23 Polymorphism Richard Gesick.
Object Based Programming
Corresponds with Chapter 7
Interfaces.
Chapter 20 Object-Oriented Analysis and Design
Chapter 12 Abstract Classes and Interfaces
Advanced Java Programming
Outline Anatomy of a Class Encapsulation Anatomy of a Method
CS 112 Programming 2 Lecture 02 Abstract Classes & Interfaces (2)
Precise Condition Synthesis for Program Repair
MAPO: Mining and Recommending API Usage Patterns
Presentation transcript:

XSnippet: Mining For Sample Code Naiyana Tansalarak and Kajal Claypool Presented by: Shan Li CISC864

Topics Overall of Research Purposes Contributions Approaches Detail in Approaches

Overall of Research Purposes: To provide sample codes for new developers to learn tech. quickly Approaches Mining sample codes from existing software systems

Overall of Research cont. Steps in Approaches Range of Queries generalized / specialized? Ranking Heuristics for context-sensitive / context- independence Such as: constructor function / constructor function of DOM Mining Algorithms BFSMINE Alg., restricts: inside a scope of a method Extensions to BFSMINE Alg.

Approaches: the Snippet Mining Processes Figure1: A high-level view of the snippet Mining Process

Approaches cont. The goal of the snippet mining is to mine from a given code sample repository all code snippets that satisfy a given user query Q, SelectionAgent pre-selects a set of code model instances cmi on B+ tree index defined on all types declared or referred to in the code sample repository. The MiningAgent invokes the BFSMINE algorithm for every code model instance

Approaches cont. BFSMINE algorithm traverses a code model instance and produces as output a set of paths P that represent the final code snippets returned to the user. On completion of the BFSMINE phase, the MiningAgent passes the collection of the paths P, to the PruningAgent.

Approaches cont. Queries The query retun all snippets s, containing codes that instantiate a type t q: (1) all codes that instantiate t q: (2) instantiation of t q is dependent of the code context, i.e. via a static method The following example

Approaches cont.

Queries A type-based instantiation query t q is instantiated from any type from the context CT(m) T (s) the lexically visible types in the code snippet s and CT (m) denotes the type context of the method CT (m) : all set of inherited types, visible types in a scope of method, all types for local fields

Approaches cont.

Queries Parent-based in instantiation query s denotes a snippet, CP (s) the parent context of the snippet, CP (m) the parent context of the method m. CP (m): The parent context of a method m, denoted as CP (m), is a set containing the superclass extended by its containing source class C, as well as all interfaces implemented by its containing source class C.

Approaches cont.

Source Code Model A graphic representation of the structure of source codes. Nodes: a type node, an object node, a method node Edges: inheritance, implement, composite, method, assignment or parameter edge.

Approaches cont. BFSMINE Algorithm Given a user query, The goal of the BFSMINE algorithm is to determine for all such instances n q, types and eventually code segments that instantiate the node n q and hence the query type t q. Domain(n q ) = {t q }

Approaches cont.

Extension-BFSMIN

Approaches cont. Extension-BFSMIN

Approaches cont.

Personal Comments Strengths User defined queries Results from a context-independent retrieval to various degrees of context-sensitive retrieval BFSMIN Algorithm based on a graph that represents a source code model allows mining across method boundaries Ranking heuristic (length, frequency, context ) for providing best-fit code snippets Multiple sample codes with the same query context-independent retrieval (length / frequency ) context-sensitive retrieval (context)

Personal Comments Potential weakness Results Is it possible to provide semantic ranking ? Why? Probably, the return code snippets do not have logic among them, just only a chunk of codes Validation approaches To prove that snippet codes is helpful for developers, authors use group test. Two groups with the same condition except that one uses snippet codes, other do not. Limited ?