Towards a Repository of Common Programming Technologies Knowledge

Similar documents
Domain Knowledge Driven Program Analysis

Extracting Domain Ontologies from Domain Specific APIs

Designing RIA Accessibility: A Yahoo UI (YUI) Menu Case Study

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Evaluating the Reference and Representation of Domain Concepts in APIs. Daniel Ratiu, Jan Jürjens

Introduction to the JAVA UI classes Advanced HCI IAT351

Model-view-controller View hierarchy Observer

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

UI Software Organization

MICROSOFT EXCEL BIS 202. Lesson 1. Prepared By: Amna Alshurooqi Hajar Alshurooqi

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

CS 4300 Computer Graphics

Word Tutorial 3. Creating a Multiple- Page Report COMPREHENSIVE

SNS COLLEGE OF ENGINEERING, Coimbatore

Programming in C# Project 1:

Graphical User Interface (GUI)

UI Toolkits. HCID 520 User Interface Software & Technology

Object-Oriented Programming (OOP) Basics. CSCI 161 Introduction to Programming I

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Reference Services Division Presents. Microsoft Word 2

Microsoft Word 2010 : Tables

Starting Excel application

Graphics and Painting

A QUICK TOUR OF ADOBE ILLUSTRATOR CC (2018 RELEASE)

Multi-line PCB Text Support

PowerPoint Tutorial 2: Adding and Modifying Text and Graphic Objects 2013

Agenda. Programming Seminar. By: dr. Amal Khalifa. Coordinate systems Colors Fonts Drawing shapes Graphics2D API

While editing a page, a menu bar will appear at the top with the following options:

Interface Builders and Interface Description Languages

Dreamweaver CS4. Introduction. References :

Internet Application Developer

D WSMO Data Grounding Component

Chapter 3 Style Sheets: CSS

GUI Programming. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

Index LICENSED PRODUCT NOT FOR RESALE

Tutorial 3 - Welcome Application

Graphics and Java 2D Introduction OBJECTIVES. One picture is worth ten thousand words.

Documentation of the UJAC print module's XML tag set.

Educational Fusion. Implementing a Production Quality User Interface With JFC

This page intentionally left blank

Chapter 12 Advanced GUIs and Graphics

Quark XML Author for FileNet 2.8 with BusDocs Guide

Correcting Grammar as You Type

Oracle Enterprise Performance Reporting Cloud. What s New in June 2017 Update (17.06)

Java Programming Lecture 6

All the Swing components start with J. The hierarchy diagram is shown below. JComponent is the base class.

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Andriod Development Lecture 09

Chapter 14 JavaFX Basics. Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved.

user.book Page 45 Friday, April 8, :05 AM Part 2 BASIC STRUCTURAL MODELING

PART ONE 1. LAYOUT. A file in Excel is called a Workbook. Each Workbook is made up of Worksheets (usually three but more can be added).

TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill

Lesson 15 Working with Tables

Chapter 2 Welcome App

Correcting Grammar as You Type. 1. Right-click the text marked with the blue, wavy underline. 2. Click the desired option on the shortcut menu.

Microsoft Office Excel 2007: Basic. Course Overview. Course Length: 1 Day. Course Overview

Desktop Studio: Charts. Version: 7.3


where are we? ICS 105: Project in HCI ui toolkits what does the toolkit do? model-view-controller model-view-controller lectures

Inventions on using LDAP for different purposes- Part-3

Java Beans Component APIs for Java. Graham Hamilton JavaSoft

COURSE PROFILE: ENVISION USER TRAINING

Fall UI Design and Implementation 1

Human-Computer Interaction IS4300

Tools to Develop New Linux Applications

Quark XML Author October 2017 Update for Platform with Business Documents

Managing Learning Objects in Large Scale Courseware Authoring Studio 1

Desktop Studio: Charts

Chapter 7 Applets. Answers

GUI DYNAMICS Lecture July 26 CS2110 Summer 2011

Quark XML Author for FileNet 2.5 with BusDocs Guide

Labels and Envelopes in Word 2013

1 Font embedding in HTML page output

7. Apply a Range of Table Features

We will talk about Alt-Tab from the usability perspective. Think about: - Is it learnable? - Is it efficient? - What about errors and safety?

MS Word 2007: Graphics. Lesson Notes Author: Pamela Schmidt. The Drawing Tools Format Ribbon appears when the object is selected.

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Lab 3. Accessing GSM Functions on an Android Smartphone

Rich Text Editor Quick Reference

CS 251 Intermediate Programming GUIs: Components and Layout

Overview of the Adobe Dreamweaver CS5 workspace

G51PRG: Introduction to Programming Second semester Applets and graphics

challenges in domain-specific modeling raphaël mannadiar august 27, 2009

How to lay out a web page with CSS

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

4.0 - ENGRAVING TEXT AND A BARCODE ON ALUMILAZ

InDesign Part II. Create a Library by selecting File, New, Library. Save the library with a unique file name.

Microsoft Office Word 2016 for Mac

Modern Requirements4TFS 2018 Release Notes

Graphical User Interfaces (GUIs)

Chapter 6 Formatting Graphic Objects

CSS Selectors. element selectors. .class selectors. #id selectors

ver Wfl Adobe lif Sams Teach Yourself Betsy Bruce Robyn Ness SAMS 800 East 96th Street, Indianapolis, Indiana, USA WlM John Ray ^lg^

Exploring Microsoft Office Word 2007

ADJUST TABLE CELLS-ADJUST COLUMN AND ROW WIDTHS

Week 5 Creating a Calendar. About Tables. Making a Calendar From a Table Template. Week 5 Word 2010

1Anchors - Access. Part 23-1 Copyright 2004 ARCHIdigm. Architectural Desktop Development Guide PART 23 ANCHORS 1-23 ANCHORS

Oracle Enterprise Performance Reporting Cloud. What s New in the November Update (16.11)

Draw Guide. Chapter 9 Adding and Formatting Text

Transcription:

Towards a Repository of Common Programming Technologies Knowledge Daniel Ratiu, Martin Feilkas, Florian Deissenböck, Jan Jürjens, Radu Marinescu http://www4.in.tum.de/~ratiu/knowledge_repository.html STSM 10 June 2008

Situation Today Reverse engineering is a knowledge intensive activity To analyze programs, engineers need and use of a lot of knowledge about Application domain Software technologies... and how are they combined at the code level but... Today's automatic tool support does not use this knowledge because... There are currently no knowledge bases in a machine processable form, big enough and at the abstraction level of the source code

Situation Today (2) Ontologies are the de-facto technology for knowledge sharing A lot of research efforts in the semantic web However, a search for suitable ontologies for analyzing programs (e.g. Swoogle) is disappointing because: The existing ontologies do not cover the programming technologies domain Or cover only small parts thereof The concepts are not at the proper abstraction level that would enable automatic code analyses Repository of ontologies about programming technologies knowledge http://www4.in.tum.de/~ratiu/knowledge_repository.html

The Technologies Knowledge Repository http://www4.in.tum.de/~ratiu/knowledge_repository.html Contains common sense, basic knowledge that is known by every programmer, e.g.... Dialogs are graphical widgets,... have titles, layout information,... can contain other graphical components... can be opened, closed, moved

Usage Scenarios Concept location We need semantics for the concepts We need a conceptual (as opposed to structural) decomposition of the program Assessing the quality of APIs In what measure does an API cover its domain? How extensible is an API with respect to its domain? How faithful does the API implement the domain? How domain appropriate is an API?

Usage Scenarios (2) Enriching program analyses with semantic information Clone detection vs. detecting logical redundancies Multiple implementation of concepts in the code Design quality assessment vs. appropriateness of the decomposition A program abstraction implements different and unrelated domain concepts e.g. logical GodClass e.g. the persistency layer contains GUI concepts Indexing reusable components Map the components (APIs) to the domain concepts that they implement Search for suitable components in an automatic manner

Usage Scenarios (3) Teaching and technology transfer Which concepts represent the core of the domain? e.g. what are the most important GUI concepts? Defining a common technological vocabulary in projects Semantically rich IDE support Smart IDEs can look over the shoulder of programmers and give hints about the logical mistakes Conceptual type checking Enable active reuse warn if a concept is already implemented

Usage Scenarios... The possible applications of the ontologies repository are NOT limited to the ones enumerated above. Once a critical mass of knowledge is available in machine processable form, it will enable the development of semantic-aware program analysis tools.

Our approach for building the ontologies Existing APIs contain an important amount of knowledge about the programming technologies at the abstraction level of programs Every programming language provide its own implementation for GUIs, XML processing, data bases, networking,... We mine the existing APIs in order to extract domain ontologies that are at the abstraction level of the code represent a consensus in a community the APIs represent a de-facto vocabulary among programmers are already used and shared by millions of programmers

Different APIs offer different Views over the Domain b d f Programmer 1 Programmer 2 a c e g API 1 b' x API 2 b'' y a' c' a'' c'' Idea: different domain specific APIs offer different perspectives over the domain... but the domain is the same different implementation and design decisions different programming languages

Extracting Domain Knowledge from APIs (CSMR'08 -- Ratiu, Feilkas, Jürjens) b a c b' x b'' y a' c' a'' c'' API 1 API 2... by exploiting the similarities between the APIs

Example Position hasprop Control, Component hasprop Size Button isa Label hasprop Text Java AWT package java.awt; class Component extends Object { int getsize() {... } int getlocation() {... } } class Button extends Component {... } class Label extends Component { String gettext() {... } }.Net Windows Forms namespace Windows.Forms; class Control :... { public Point Location { get; set; } public Size Size { get; set; } public string Text { get; set; } } class Label : Control {... } class ButtonBase : Control {... }

Describing Domain Knowledge with Ontologies Describe the domain as light-weighted ontologies represented as graphs (set of triples: subject verb - object): Nodes domain concepts Edges relations between the concepts isa - between subordinate and superordinate e.g. Window isa Component hasproperty between a concept and its properties e.g. Component hasproperty Size Size Component actson between an action and the entities on which it is performed e.g. Resize actson Window isdoer between an object and the hasprop e.g. Window isdoer Paint isa Window isdoer Paint actson Resize

Extraction Steps Step 1: abstract the APIs in order to facilitate their comparison Step 2: inspect how are the abstract relations reflected in APIs Step 3: apply the ontology extraction algorithm Step 4: eliminate the noise

Step 1: Abstracting APIs We abstract APIs as graphs Nodes = (lexically normalized) names of public program elements Edges = program relations between the program elements hassupcls, hasacc (Java), hasatt, hasprop (C#), hasmeth, haspar, hastype, hasconstr class Component { int getsize() {... } int getlocation() {... } void show() {... } } Component class Button extends Component {... } class Label extends Component { String hassupcls gettext() {... }... } Button Label hasmeth hasacc hasacc Show getsize getlocation gettext class Control... { Point Location { get; set; } Size Size { get; set; } String Text { get; set; } void show() Control {... } } class Label : Control {... } class ButtonBase : Control {... } hassupcls hasmeth ButtonBase Label hasprop Show Size Location Text

Step 2: Reflecting abstract relations in APIs The taxonomic relation (isa) is typically implemented as: sub-classing (hassupcls) sequences of sub-classes (<hassupcls, hassupcls>) the type of a variable (hastype) Example: Dialog is a Window Window Dialog isa Ontology APIs public class Window {... } public class Dialog extends Window {...} Window hassupcls Dialog public class Window {... } public class Container extends Window {...} public class Dialog extends Container {...} hassupcls hassupcls Window Container Dialog public class SomeClass { public Window adialog;... } Window hastype adialog

Step 2: Reflecting abstract relations in APIs (2) The relation hasproperty between a concept and its properties is typically implemented as: the attribute of a class (hasatt) the accessor of a class (hasacc) the parameter of a constructor (<hasconstr, haspar>) Example: Window has Title Window hasproperty Title Ontology APIs public class Window { public String title;... } Window hasatt Title public class Window { public String gettitle() {... } } Window hasacc gettitle public class Window { public Window(String atitle) {... } } hasctr haspar Window Window atitle

Step 3: Ontology extraction algorithm Extract the ontology as the intersection of the API graphs: Matching nodes based on the similarity of the names Matching edges according to the defined mapping strategies At every step we discover a triple from our ontology Position hasprop Control, Component hasprop Size Ontology Show isdoer Button isa Label hasprop Text APIs hasmeth Show hasmeth Show Component hasacc getsize Control hasprop Size hassupcls Button Label hasacc getlocation gettext hassupcls ButtonBase Label Location Text

Example: GUI Concepts Accelerator Alpha Bar Accessible Angle Bar Menu Accessible Context Append Base Accessible Description Applet Baseline Action Arc Bgcolor Action Command Arc Angle Block Action Listener Arc Height Blue Activate Arc Width Border Active Area Border Style Align Ascent Bottom Alignment Attribute Bound Alignment X Back Box Alignment Y Back Color Browser Button Border Background Button Background Image

GUI Triples (1) Button hasproperty Active Button hasproperty Style Button hasproperty Alignment Button hasproperty Text Button hasproperty Background Button isa Component Button hasproperty Container Button isa Container Button hasproperty Content Button isa Control Button hasproperty Enable Button isa Item Button hasproperty Focus Button isa Widget Button hasproperty Image Button isdoer Check Button hasproperty Label Button isdoer Click Button hasproperty Margin Button isdoer Focus Button hasproperty Minimum Size Button isdoer Lost Focus Button hasproperty Mnemonic Button isdoer Mouse Drag Button hasproperty Name Button isdoer Mouse Move Button hasproperty Parent Button isdoer Notify

GUI Triples (2) Font hasproperty Bound Font hasproperty Family Font hasproperty Handle Font hasproperty Name Font hasproperty Size Font hasproperty Style Font isa Attribute Font isa Resource Font isa Text

The Knowledge Repository Contributors: Martin Feilkas (.Net) Adrian Linhard (Smalltalk) Petru Mihancea (C++) Yongming Li Daniel Ratiu (Java) Available ontologies GUI -- > 450 Concepts, > 1400 Relations XML -- > 150 Concepts, > 300 Relations Collections -- 46 Concepts, 62 Relations Calendar -- 46 Concepts, 46 Relations License: LGPL http://www4.in.tum.de/~ratiu/knowledge_repository.html

Scaling-up with Semantic Technologies Extracting (parts of) an ontology from analyzing more domain specific APIs is only the first step, in the practice there are several pressing issues like: Obtaining richer ontologies More kinds of relations, more semantic (constraints) Validating and manually completing the ontology Correctness and completeness Evolving the extracted ontology Analyze new APIs, consistently merge new concepts Manipulating big ontologies

We build a community for the technologies repository Users use the ontologies in your research / tools Contributors enhance the repository http://www4.in.tum.de/~ratiu/knowledge_repository.html