Finding Code to Reuse Kerry Chang Human-Computer Interaction Institute Carnegie Mellon University 05-899D: Human Aspects of Software Development (HASD)

Slides:



Advertisements
Similar presentations
Assieme: Finding and Leveraging Implicit References in a Web Search Interface for Programmers I am Raphael Hoffmann and this is joint work with James Fogarty.
Advertisements

Testing Relational Database
2006 Adobe Systems Incorporated. All Rights Reserved. 1 End-user programming and Flash Jen deHaan Sr. Technical Writer April 23 rd 2006.
Usage of the memoQ web service API by LSP – a case study
Chapter 11 user support. Issues –different types of support at different times –implementation and presentation both important –all need careful design.
Introduction to metadata for IDAH fellows Jenn Riley Metadata Librarian Digital Library Program.
Engineering Village ™ ® Basic Searching On Compendex ®
Help and Documentation zUser support issues ydifferent types of support at different times yimplementation and presentation both important yall need careful.
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
Stimulating reuse with an automated active code search tool Júlio Lins – André Santos (Advisor) –
Client/Server Architecture
THE BASICS OF THE WEB Davison Web Design. Introduction to the Web Main Ideas The Internet is a worldwide network of hardware. The World Wide Web is part.
WEB DESIGNING Prof. Jesse A. Role Ph. D TM UEAB 2010.
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
Knowledge Science & Engineering Institute, Beijing Normal University, Analyzing Transcripts of Online Asynchronous.
Web Design Basic Concepts.
Chapter 5 Application Software.
Semantic Web Technologies Lecture # 2 Faculty of Computer Science, IBA.
UNIT-V The MVC architecture and Struts Framework.
Section 13.1 Add a hit counter to a Web page Identify the limitations of hit counters Describe the information gathered by tracking systems Create a guest.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
1 Introduction to Web Development. Web Basics The Web consists of computers on the Internet connected to each other in a specific way Used in all levels.
HTML Comprehensive Concepts and Techniques Intro Project Introduction to HTML.
Section 2.1 Compare the Internet and the Web Identify Web browser components Compare Web sites and Web pages Describe types of Web sites Section 2.2 Identify.
Stanford HCI Group Adobe Advanced Technology Labs Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code Joel.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Software Engineering Muhammad Fahad Khan
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
© Paradigm Publishing, Inc. 5-1 Chapter 5 Application Software Chapter 5 Application Software.
Evaluation of digital collections' user interfaces Radovan Vrana Faculty of Humanities and Social Sciences Zagreb, Croatia
1 Lesson 6 Exploring Microsoft Office 2007 Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
Tutorial 1: Getting Started with Adobe Dreamweaver CS4.
1 Web Basics Section 1.1 Compare the Internet and the Web Compare Web sites and Web pages Identify Web browser components Describe types of Web sites Section.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Evaluation of Adaptive Web Sites 3954 Doctoral Seminar 1 Evaluation of Adaptive Web Sites Elizabeth LaRue by.
Web Designing By Bhupendra Ratha, Lecturer School of Library & Information Science D.A.V.V., Indore.
Using a Template to Create a Resume and Sharing a Finished Document
1 PARSEWeb: A Programmer Assistant for Reusing Open Source Code on the Web Suresh Thummalapenta and Tao Xie Department of Computer Science North Carolina.
Tutorial 1: Browser Basics.
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Nobody’s Unpredictable Ipsos Portals. © 2009 Ipsos Agenda 2 Knowledge Manager Archway Summary Portal Definition & Benefits.
Requirements Engineering Requirements Elicitation Process Lecture-8.
Universiti Utara Malaysia Chapter 3 Introduction to ASP.NET 3.5.
UNIT 14 1 Websites. Introduction 2 A website is a set of related webpages stored on a web server. Webmaster: is a person who sets up and maintains a.
MULTIMEDIA DEFINITION OF MULTIMEDIA
User Support Chapter 8. Overview Assumption/IDEALLY: If a system is properly design, it should be completely of ease to use, thus user will require little.
© Paradigm Publishing Inc. 5-1 Chapter 5 Application Software.
2007. Software Engineering Laboratory, School of Computer Science S E Web-Harvest Web-Harvest: Open Source Web Data Extraction tool 이재정 Software Engineering.
Active Code Completion Cyrus Omar Computer Science School of Computer Science Carnegie Mellon University [ICSE12] YoungSeok Yoon Software Engineering Brad.
Chap#11 What is User Support?
August 2005 TMCOps TMC Operator Requirements and Position Descriptions Phase 2 Interactive Tool Project Presentation.
Exploiting Code Search Engines to Improve Programmer Productivity and Quality Suresh Thummalapenta Advisor: Dr. Tao Xie Department of Computer Science.
Search Engine using Web Mining COMS E Web Enhanced Information Mgmt Prof. Gail Kaiser Presented By: Rupal Shah (UNI: rrs2146)
2004/051 >> Supply Chain Solutions That Deliver Users.
Introduction to HTML Simple facts yet crucial to beginning of study in fundamentals of web page design!
1 Unified Modeling Language Michael K. Wildes University of California, Riverside – Extension Program Presentation 2.
Lesson 10—Networking BASICS1 Networking BASICS The Internet and Its Tools Unit 3 Lesson 10.
General Architecture of Retrieval Systems 1Adrienn Skrop.
Design Evaluation Overview Introduction Model for Interface Design Evaluation Types of Evaluation –Conceptual Design –Usability –Learning Outcome.
SEMANTIC WEB Presented by- Farhana Yasmin – MD.Raihanul Islam – Nohore Jannat –
XP Creating Web Pages with Microsoft Office
Human Computer Interaction Lecture 21 User Support
Introduction and Principles
Chapter 27 WWW and HTTP.
Chapter 7 –Implementation Issues
Presentation transcript:

Finding Code to Reuse Kerry Chang Human-Computer Interaction Institute Carnegie Mellon University D: Human Aspects of Software Development (HASD) Spring 2011 – Lecture 15

Carnegie Mellon University, School of Computer Science What can be reused? Programmers nowadays rely heavily on frameworks and libraries, such as C++ libraries and JAVA packages, to build their own applications. (Freeman, 1987; Basili et al., 1996) These libraries provide many code examples in theirs documentations to demonstrate different usages of the APIs. More examples can be found in unofficial tutorials, blogs and forums on the Internet in a more natural language. (Stylos et al., 2006; Brandt et al., 2009) 2

Carnegie Mellon University, School of Computer Science Why reusing code? Save time Less error-prone if calling APIs Learning Using examples to do unfamiliar tasks Reusing software resources allows programmers to create high- quality, full-feature applications on time (Sahavechaphan et al., 2006). 3

Carnegie Mellon University, School of Computer Science Why is it hard to reuse code? Code repository itself might not be that reusable Quality of the code (Biggerstaff et al., 1987; Meyer. 1987) Often too large for programmers to quickly identify useful code. Information might be separated and stored in different places (Hoffmann et al., 2007). 4

Carnegie Mellon University, School of Computer Science Why is it hard to reuse code? Programmers don’t know exactly what they are looking for and where to look for. (Mandelin et al., 2005; Thummalapenta et al., 2007; Fisher, 2001) Only know the general idea of the problem encountered instead of the right technical term or the actual name of the API needed. Unable to form a complete query. False understandings of the repository 5

Carnegie Mellon University, School of Computer Science Fisher,

Carnegie Mellon University, School of Computer Science Outline Introduction Behavior Studies Tools 7

Carnegie Mellon University, School of Computer Science Rosson et al., 1996 Observed 4 expert programmers creating GUI application. RGB Color mixer and library tool. 8

Carnegie Mellon University, School of Computer Science Rosson et al., 1996 The Reuse View Matcher 9

Carnegie Mellon University, School of Computer Science Rosson et al., 1996 Extensive “Reuse of uses” Programmers relied heavily on code in example applications that provided an implicit specification for reuse of the target class. “Usage context” 10

Carnegie Mellon University, School of Computer Science Rosson et al., 1996 Programming behavior was highly opportunistic. Interleaved between analysis and implementation, and frequently driven by testing and debugging. Only wish to understand the example if it’s necessary. Implication: the examples should be as simple and as generic as possible (ex. using several simple examples rather than one comprehensive but more complex example to demo the usage.) 11

Carnegie Mellon University, School of Computer Science Sen, 1997 Interested in study how people reuse design artifacts in the software development process. Before, many people believed that the ruse tasks were preformed in a sequence and followed a predetermined path beginning with searching and retrieving reusable objects. Proposed a cognitive model on the reuse behavior based on opportunism. 12

Carnegie Mellon University, School of Computer Science Sen,

Carnegie Mellon University, School of Computer Science Sen, 1997 Run a think-aloud study with 9 subjects. Construct an ER Diagram for an application scenario. A set of 20 example ERDs drawn in IEF was given to each subject for reuse. Findings: Software designers seldom choose the predetermined reuse path; instead, select it opportunistically. 14

Carnegie Mellon University, School of Computer Science Brandt et al., 2009 Conducted two studies about how people use online resources in programming tasks. Study 1: 20 participants Prototype a Web chat room using HTML, PHP, and Javascript. Think-aloud, audio and video screen capture 15

Carnegie Mellon University, School of Computer Science Brandt et al., 2009 Findings of Study 1: people use web for learning new knowledge, and clarifying, reminding pre-known knowledge. 16

Carnegie Mellon University, School of Computer Science Brandt et al., 2009 Study 2: Web search log analysis Community Search portal on Adobe’s Developer Network Web site Adobe Flex Web Application development framework Hand coded queries into 4 sessions: learning, reminding, unsure, and misgrouped. Query terms, content of the page visited, weather the person is an expert (determined by the person’s whole search history) 17

Carnegie Mellon University, School of Computer Science Brandt et al., 2009 Findings of Study 2: Query type predicts types of pages visited The first query was exclusively natural language in half of learning sessions, versus one third in reminding sessions Programmers were more likely to visit official API documentation in reminding sessions than in learning sessions Code-only queries accounted for 51% of all reminding queries. 18

Carnegie Mellon University, School of Computer Science Hoffmann et al., 2007 Looking more closely at the API-related session… 64.1% of the sessions contained queries that were merely descriptive but did not contain actual names of APIs, packages, types, or members 17.9% contained terms like “example”, “using”, or “sample code” 19

Carnegie Mellon University, School of Computer Science Summary – Behavior Stuides Programmers sometimes don’t know how to make a right query, because of lack of understanding to their task-at-hand and also to the repository itself. The reuse behavior is highly opportunistic, often interleaves activities such as searching, analyzing, learning, testing and writing code. Programmers mostly look for API-related information The search query can be in very different forms, ranging from being very specific, asking the actually name of the API, to merely descriptive, explaining problems the programmer encounters. Programmers like to learn the usage of the code through examples. 20

Carnegie Mellon University, School of Computer Science Outline Introduction Behavior Studies Tools 21

Carnegie Mellon University, School of Computer Science CodeBroker (Ye et al., 2002) Programmers cannot make good queries because of the lack of understanding of the reuse repository. Information delivery: automatically locates and presents programmers with task-relevant and personalized components. CodeBroker: an IDE plug-in that delivers components relevant to the task-at-hand and personalized to the background knowledge of an individual developer. 22

Carnegie Mellon University, School of Computer Science CodeBroker (Ye et al., 2002) 23

Carnegie Mellon University, School of Computer Science CodeBroker (Ye et al., 2002) Delivers components whenever a doc comment or a signature definition is entered. Results are sorted by relevance value. Personalize the delivered components: Discourse model: Filter out the component from this current development session. User model: Filter out the component forever! Subjects gave high ratings in terms of CodeBroker’s usefulness. 24

Carnegie Mellon University, School of Computer Science Blueprint (Brandt et al., 2010) Programmers often borrow code snippet from the Internet to use in their own code. Blueprint: a web search interface integrated into IDE that helps user locate sample code. Two advantages: Embedding search into IDE allows the search engine to leverage the users’ context. Better queries. Extracting code examples from Web pages and composing them in a consistent, code- centric search results view reduces the need to click through to Web pages to find example code. Easier to view and select a good result. 25

Carnegie Mellon University, School of Computer Science Blueprint (Brandt et al., 2010) (A) A hotkey places a search box at the programmer’s cursor position. (B)(C)(D) Search result (E) A running example of the example code (when possible) (F) Search terms (G) User’s rating for each example 26

Carnegie Mellon University, School of Computer Science Blueprint (Brandt et al., 2010) Provides a user interface for initiating queries and displaying results. Sends contextual information with each user query to the server. Notifies the user when the Web origin of examples they adapted has changed. 27

Carnegie Mellon University, School of Computer Science Assieme (Hoffmann et al., 2007) On the Web, the information the programmer needs often distributed on different pages. Identifying the correct API to use, seeking information about how to use it and sample code. Assieme: a Web search engine that supports programming search tasks by combining information from different web resources. JAR files, API documentation, explanatory text and sample code. 28

Carnegie Mellon University, School of Computer Science Assieme (Hoffmann et al., 2007) Main challenge: resolve “implicit references”. Many of the code examples online are stripped of import information and therefore will not compile. Ex. Phrase is actually com.lowagie.text.Phrase Can’t link separated resources correctly without knowing the full name. Approach: First compared with libraries to match package, type, method and field name. Determining a set of libraries that might be referenced. See if it can be compiled. 29

Carnegie Mellon University, School of Computer Science Assieme (Hoffmann et al., 2007) 30

Carnegie Mellon University, School of Computer Science PARSEWeb (Thummalapenta et al., 2007) Programmers often know what type of object they need, but don’t know how to get that object with a specific method sequence. (Really?) PARSEWeb: a tool that takes queries of the form “Source object type -> Destination object type” and returns suggested method sequences that can make the transformation happen. 31

Carnegie Mellon University, School of Computer Science 32 PARSEWeb (Thummalapenta et al., 2007)

Carnegie Mellon University, School of Computer Science d.mix (Hartmann et al., 2007) d.mix: a tool that enables users to copy different web service calls from web sites and compose the sampled API to create their own applications. Users select elements to sample from an annotated web site. d.mix then generates the underlining service call for users to reuse. 33

Carnegie Mellon University, School of Computer Science d.mix (Hartmann et al., 2007) video 34

Carnegie Mellon University, School of Computer Science Summary - Tools Help developers quickly get the information they need. Actively delivering the information according to programmer’s current task Integrating web search with IDE Collecting information from different places Allowing special query format Programming by examples 35

Carnegie Mellon University, School of Computer Science Summary - Tools Make the code repository more reusable? Quality of the code? How can programmers contribute to the code repository? 36

Carnegie Mellon University, School of Computer Science 37 Thanks!