A Look at Software Library Usage in Java. Jürgen Starek 2012

Size: px
Start display at page:

Download "A Look at Software Library Usage in Java. Jürgen Starek 2012"

Transcription

1 A Look at Software Library Usage in Java Jürgen Starek 2012

2

3 Could it be that half of all that code is actually never used?

4 Could it be that half of all that code is actually never used? Who needs all that stuff, anyway?

5 Measuring API Usage 5 / 56

6 Outline 1. Terminology and Concepts 2. Instrumenting javac 3. Methods and Tools 4. Measurements 5. Insights 6 / 56

7 1. Terminology and Concepts 7 / 56

8 Terminology A software library is a set of routines that are packaged so that they can easily be included in other software. In the Java world: JAR-files 8 / 56

9 Terminology A software library exposes its internal code through a well-defined API. 9 / 56

10 Terminology APIs cover problem domains. A domain in this sense is an area of related tasks. Domains are intended to represent the main usage areas of an API. 10 / 56

11 Terminology A feature is either a field a method a constructor A feature reference is any programmatic access to a feature. 11 / 56

12 Terminology A corpus is a set of code that provides the base data for statistical analyses. 12 / 56

13 Motivation Why Measure API Usage? Little previous work Potential applications for library developers Starting point for further projects in our working group 13 / 56

14 Motivation Why Use Large Corpora? Test for selection biases in previous studies using smaller corpora Large quality differences in real-world software cover amateur programmers' usage Analyze what average programmers do Rare phenomena stand out less 14 / 56

15 2. Instrumenting javac 15 / 56

16 Instrumenting javac: The Problem We need complete information about each feature call With inheritance hierarchy, in order to catch interfaces 16 / 56

17 17 / 56

18 package org.cogkit.gridface.interfaces; import import import import java.util.calendar; java.util.enumeration; java.util.vector; java.util.hashtable; import org.cogkit.abstraction.interfaces.executableobject; import org.cogkit.abstraction.interfaces.statuslistener; import org.cogkit.abstraction.interfaces.task; /** * Grid command can be executed in cog-abstraction as tasks. */ public interface GridCommand extends StatusListener, ExecutableObject { public Task gettask(); public void settask(task newtask); public Integer getid(); public void setcommand(string command); public Vector getarguments(); public Calendar getsubmittedtime(); public Calendar getcompletedtime(); shortened example code from the CogKit project 18 / 56

19 package org.cogkit.gridface.interfaces; import import import import java.util.calendar; java.util.enumeration; java.util.vector; java.util.hashtable; import org.cogkit.abstraction.interfaces.executableobject; import org.cogkit.abstraction.interfaces.statuslistener; import org.cogkit.abstraction.interfaces.task; /** * Grid command can be executed in cog-abstraction as tasks. */ public interface GridCommand extends StatusListener, ExecutableObject { public Task gettask(); public void settask(task newtask); public Integer getid(); public void setcommand(string command); public Vector getarguments(); public Calendar getsubmittedtime(); public Calendar getcompletedtime(); shortened example code from the CogKit project 19 / 56

20 package org.cogkit.gridface.interfaces; import import import import java.util.calendar; java.util.enumeration; java.util.vector; java.util.hashtable; import org.cogkit.abstraction.interfaces.executableobject; import org.cogkit.abstraction.interfaces.statuslistener; import org.cogkit.abstraction.interfaces.task; /** * Grid command can be executed in cog-abstraction as tasks. */ public interface GridCommand extends StatusListener, ExecutableObject { public Task gettask(); public void settask(task newtask); public Integer getid(); public void setcommand(string command); public Vector getarguments(); public Calendar getsubmittedtime(); public Calendar getcompletedtime(); shortened example code from the CogKit project 20 / 56

21 package org.cogkit.gridface.interfaces; import import import import java.util.calendar; java.util.enumeration; java.util.vector; java.util.hashtable; import org.cogkit.abstraction.interfaces.executableobject; import org.cogkit.abstraction.interfaces.statuslistener; import org.cogkit.abstraction.interfaces.task; /** * Grid command can be executed in cog-abstraction as tasks. */ public interface GridCommand extends StatusListener, ExecutableObject { public Task gettask(); public void settask(task newtask); public Integer getid(); public void setcommand(string command); public Vector getarguments(); public Calendar getsubmittedtime(); public Calendar getcompletedtime(); shortened example code from the CogKit project 21 / 56

22 Counting occurences of add...? %> grep -ir \.add\( * grep -v.svn head examples/gcm/gcmdependencytest.java: examples/mimehandler/mimehandlereditortest.java: impl/commands/copycommandimpl.java: impl/commands/copycommandimpl.java: impl/commands/copydircommandimpl.java: impl/commands/copydircommandimpl.java: impl/commands/gridcommandimpl.java: impl/commands/gridcommandimpl.java: impl/commands/gridcommandimpl.java: impl/commands/copyfilecommandimpl.java: identities.add(0,previd); myframe.getcontentpane().add(mhe); taskgraph.add(gettask); taskgraph.add(puttask); taskgraph.add(gettask); taskgraph.add(puttask); this.arguments.add(args[i]); this.arguments.add(arg); statuslisteners.add(listener); taskgraph.add(gettask);...no. We need type information. 22 / 56

23 23 / 56

24 24 / 56

25 Hacking into the compile chain javac compile stages Parse Enter Annotate Attribute Flow Desugar Generate From David Erni, Adrian Kuhn: The Hacker's Guide to Javac, Universität Bern, / 56

26 Hacking into the compile chain Injecting own code Custom annotation processor for all code Parse Enter Annotate JSR269 Attribute Flow Desugar Generate From David Erni, Adrian Kuhn: The Hacker's Guide to Javac, Universität Bern, / 56

27 Accessing public class Analyzer extends AbstractProcessor { // Initialize the public synchronized void init(processingenvironment procenv) { super.init(procenv); // Inject our TaskListener into the compiler context t = new TaskListen(); ((JavacProcessingEnvironment)procEnv).getContext().put(taskListener.class, t); } /** * Since we do our analysis elsewhere, returning false enables * other annotation processors to again process the same * annotations we encounter here, i.e. we don t claim them. public boolean process(set<? extends TypeElement> annotations, RoundEnvironment r) { return false; } 27 / 56

28 Automatically launching plugins ANT autoloads all JARs in ~/.ant/lib/ with correct service entry file 28 / 56

29 3. Methods and Tools 29 / 56

30 Source Corpus Creation Desired corpus properties: large many domains different code quality SourceForge as repository of choice Subversion & ANT only 30 / 56

31 The Analysis Process Search criteria SourceForge Repositories SVN Checkout Local source code repo Building and Fact extraction Relational database Manual API tagging Report usage data drives API selection Manual API selection Manual download Local binary API repo 31 / 56

32 API Corpus Creation Controlled, well-known set of APIs Core Java + 3rd party Initially: Manual download Later: Iterative extension of corpus Goal: > 50% of API features from known sources Manual tagging 32 / 56

33 The Analysis Process Search criteria SourceForge Repositories SVN Checkout Local source code repo Building and Fact extraction Relational database Manual API tagging Report usage data drives API selection Manual API selection Manual download Local binary API repo 33 / 56

34 Fact Extraction Instrumented javac Provides Access to entire AST Detailed type and inheritance information for every feature reference 34 / 56

35 The Analysis Process Search criteria SourceForge Repositories SVN Checkout Local source code repo Building and Fact extraction Relational database Manual API tagging Report usage data drives API selection Manual API selection Manual download Local binary API repo 35 / 56

36 The Database All feature references Which feature? From which API? Referenced from which project? Additionally: API data Metadata 36 / 56

37 Storage and Interpretation of Extracted Data Relational database MySQL MyISAM ~ 1.5 GB total Standard SQL queries Postprocessing and automation with Python Graphs with gnuplot 37 / 56

38 The Analysis Process Search criteria SourceForge Repositories SVN Checkout Local source code repo Building and Fact extraction Relational database Manual API tagging Report usage data drives API selection Manual API selection Manual download Local binary API repo 38 / 56

39 The Analysis Process Search criteria SourceForge Repositories SVN Checkout Local source code repo Building and Fact extraction Relational database Manual API tagging Report usage data drives API selection Manual API selection Manual download Local binary API repo Automated using makefiles 39 / 56

40 4. Measurements 40 / 56

41 Basic Corpus Data from AST-based Analyses Metric Built projects Packages Classes Methods Feature References Value / 56

42 Feature Sources in largest projects 42 / 56

43 Feature Sources Source All Projects Reference Projects Core Java Manually tagged APIs Automatically tagged APIs 32.2 % 9.9 % 8.6 % 41.2 % 27.8 % 21.5 % Default package Others 2.5 % 46.8 % 1.7 % 7.8 % 43 / 56

44 A detailed look at Feature Sources 44 / 56

45 Distinct APIs per project 45 / 56

46 API Feature Ratio 46 / 56

47 Feature Usage Distribution 47 / 56

48 Feature Usage Distribution of selected APIs from the XML Domain 48 / 56

49 Copying library code Lots of projects copy libraries' code into their own code repo Don't! Bloat Old versions Tracking of security issues 49 / 56

50 Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Sof Free Software Foundation, Inc., 51 Franklin Street, Fif USA. package java.util; import java.io.ioexception; import java.io.objectinputstream; import java.io.objectoutputstream; import java.io.serializable; Jon Zeppieri Eric Blake (ebb9@ .byu.edu) TreeSet < Collections#synchronizedSet(Set) < LinkedHashSet < updated to 1.4 < public class HashSet<T> extends AbstractSet<T> implements Set<T>, Cloneable, Serializable private transient HashMap<T, String> map; public HashSet(int initialcapacity, float loadfactor) public HashSet(Collection<? extends T> c) public boolean add(t o) public Object clone() HashSet<T> copy = null; copy = (HashSet<T>) super.clone(); copy.map = (HashMap<T, String>) map.clone(); public Iterator<T> iterator() HashMap init(int capacity, float load) > Iterator<T> it = map.iterator(hashmap.keys); > map.put((t) s.readobject(), ""); > Copyright (C) 1998, 1999, 2001, 2004 Free Software Free Software Foundation, Inc., 59 Temple Place, USA. package org.placelab.collections; //import java.io.ioexception; //import java.io.objectinputstream; //import java.io.objectoutputstream; //import java.io.serializable; * * public class HashSet extends AbstractSet implements Set, Cloneable//, Serializable private transient HashMap map; public HashSet(int initialcapacity, int loadfactor) public HashSet(Collection c) public boolean add(object o) public Object pclone() HashSet copy = null; copy = (HashSet) super.pclone(); copy.map = (HashMap) map.pclone(); public Iterator iterator() HashMap init(int capacity, int load) /* NOT IN MIDP Iterator it = map.iterator(hashmap.keys); */ /* NOT IN MIDP map.put(s.readobject(), ""); */ sdiff output comparing two implementations of the HashSet class. - Left: API version as delivered with GNU Classpath Right: version from the tsg project Only lines that differ between the two versions are shown. 50 / 56

51 51 / 56

52 5. Insights 52 / 56

53 Contributions A first glimpse at API usage in Open Source projects shallow and few New analysis method for automated corpus-based analyses Understanding of pitfalls and inaccuracies in automated analyses 53 / 56

54 Library best practices For library writers: Small, well-bounded problem domains Don't break compatibility For library users: Don't copy Use Decorator, Facade, Adapter patterns 54 / 56

55 Use cases for JSR269-based hacks immutablej: A javac annotation processor that makes Java variables default to immutable Code completion tools like Lombok / 56

56 Sources A Large-Scale Analysis of Java API Usage. Jürgen Starek. Diploma thesis, Universität Koblenz, 2012 The Hacker's Guide to Javac. David Erni, Adrian Kuhn. Universität Bern, 2008 Further reading Large-Scale, AST-based API-usage analysis of Open Source Java projects. Ralf Lämmel, Ekaterina Pek, Jürgen Starek. In: SAC '11 Proceedings of the 2011 ACM Symposium on Applied Computing, p ACM, New York, / 56

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

The Object Class. java.lang.object. Important Methods In Object. Mark Allen Weiss Copyright 2000

The Object Class. java.lang.object. Important Methods In Object. Mark Allen Weiss Copyright 2000 The Object Class Mark Allen Weiss Copyright 2000 1/4/02 1 java.lang.object All classes either extend Object directly or indirectly. Makes it easier to write generic algorithms and data structures Makes

More information

Hashing as a Dictionary Implementation

Hashing as a Dictionary Implementation Hashing as a Dictionary Implementation Chapter 22 Contents The Efficiency of Hashing The Load Factor The Cost of Open Addressing The Cost of Separate Chaining Rehashing Comparing Schemes for Collision

More information

A simple map: Hashtable

A simple map: Hashtable Using Maps A simple map: Hashtable To create a Hashtable, use: import java.util.*; Hashtable table = new Hashtable(); To put things into a Hashtable, use: table.put(key, value); To retrieve a value from

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Appendix for Large-scale, AST-based API-usage analysis of open-source Java projects

Appendix for Large-scale, AST-based API-usage analysis of open-source Java projects Appendix for Large-scale, AST-based API-usage analysis of open-source Java projects Ralf Lämmel 1,2 and Ekaterina Pek 2 and Jürgen Starek 1 1 Software Languages Team, Universität Koblenz-Landau, Germany

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Domain-Driven Design Activity

Domain-Driven Design Activity Domain-Driven Design Activity SWEN-261 Introduction to Software Engineering Department of Software Engineering Rochester Institute of Technology Entities and Value Objects are special types of objects

More information

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

COMP 401 COPY: SHALLOW AND DEEP. Instructor: Prasun Dewan

COMP 401 COPY: SHALLOW AND DEEP. Instructor: Prasun Dewan COMP 401 COPY: SHALLOW AND DEEP Instructor: Prasun Dewan PREREQUISITE Composite Object Shapes Inheritance 2 CLONE SEMANTICS? tostring() Object equals() clone() Need to understand memory representation

More information

Peers Techno log ies Pv t. L td. Core Java & Core Java &Adv Adv Java Java

Peers Techno log ies Pv t. L td. Core Java & Core Java &Adv Adv Java Java Page 1 Peers Techno log ies Pv t. L td. Course Brochure Core Java & Core Java &Adv Adv Java Java Overview Core Java training course is intended for students without an extensive programming background.

More information

Java Persistence API (JPA) Entities

Java Persistence API (JPA) Entities Java Persistence API (JPA) Entities JPA Entities JPA Entity is simple (POJO) Java class satisfying requirements of JavaBeans specification Setters and getters must conform to strict form Every entity must

More information

JPA. Java persistence API

JPA. Java persistence API JPA Java persistence API JPA Entity classes JPA Entity classes are user defined classes whose instances can be stored in a database. JPA Persistable Types The term persistable types refers to data types

More information

Hashing. Reading: L&C 17.1, 17.3 Eck Programming Course CL I

Hashing. Reading: L&C 17.1, 17.3 Eck Programming Course CL I Hashing Reading: L&C 17.1, 17.3 Eck 10.3 Defne hashing Objectives Discuss the problem of collisions in hash tables Examine Java's HashMap implementation of hashing Look at HashMap example Save serializable

More information

27/04/2012. Objectives. Collection. Collections Framework. "Collection" Interface. Collection algorithm. Legacy collection

27/04/2012. Objectives. Collection. Collections Framework. Collection Interface. Collection algorithm. Legacy collection Objectives Collection Collections Framework Concrete collections Collection algorithm By Võ Văn Hải Faculty of Information Technologies Summer 2012 Legacy collection 1 2 2/27 Collections Framework "Collection"

More information

Top Down Design vs. Modularization

Top Down Design vs. Modularization 6.170 Quiz Review Topics: 1. Decoupling 2. 3. AF & RI 4. Iteration Abstraction & Iterators 5. OMs and Invariants 6. Equality, Copying, Views 7. 8. Design Patterns 9. Subtyping 10. Case Studies Decomposition

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

JBoss Tattletale 1.1 Developer's Guide

JBoss Tattletale 1.1 Developer's Guide JBoss Tattletale 1.1 Developer's Guide Betraying all your project's naughty little secrets Copyright 2009 Red Hat Middleware Table of Contents 1. About JBoss Tattletale...1 1.1. The team...1 1.2. Thanks

More information

Core Java Syllabus DAY -1 :

Core Java Syllabus DAY -1 : Core Java Syllabus DAY -1 : How to write Java Program Compiling and Executing java program Phases of java program Analysis of main() method What is JDK, JRE, JVM, JIT Features of Java DAY -2 : Identifiers

More information

CMSC 132: Object-Oriented Programming II

CMSC 132: Object-Oriented Programming II CMSC 132: Object-Oriented Programming II Java Support for OOP Department of Computer Science University of Maryland, College Park Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation

More information

CS1020 Data Structures and Algorithms I Lecture Note #15. Hashing. For efficient look-up in a table

CS1020 Data Structures and Algorithms I Lecture Note #15. Hashing. For efficient look-up in a table CS1020 Data Structures and Algorithms I Lecture Note #15 Hashing For efficient look-up in a table Objectives 1 To understand how hashing is used to accelerate table lookup 2 To study the issue of collision

More information

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle Boggle If you are not familiar with the game Boggle, the game is played with 16 dice that have letters on all faces. The dice are randomly deposited into a four-by-four grid so that the players see the

More information

JAVA SYLLABUS FOR 6 MONTHS

JAVA SYLLABUS FOR 6 MONTHS JAVA SYLLABUS FOR 6 MONTHS Java 6-Months INTRODUCTION TO JAVA Features of Java Java Virtual Machine Comparison of C, C++, and Java Java Versions and its domain areas Life cycle of Java program Writing

More information

public Candy() { ingredients = new ArrayList<String>(); ingredients.add("sugar");

public Candy() { ingredients = new ArrayList<String>(); ingredients.add(sugar); Cloning Just like the name implies, cloning is making a copy of something. To be true to the nature of cloning, it should be an exact copy. While this can be very useful, it is not always necessary. For

More information

CSCI 200 Lab 3 Using and implementing sets

CSCI 200 Lab 3 Using and implementing sets CSCI 200 Lab 3 Using and implementing sets In this lab, you will write a program that manages a set of workers, using the Worker hierarchy you developed in Lab 2. You will also implement your own version

More information

Crash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++

Crash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++ Crash Course in Java Netprog: Java Intro 1 Why Java? Network Programming in Java is very different than in C/C++ much more language support error handling no pointers! (garbage collection) Threads are

More information

Cloning Enums. Cloning and Enums BIU OOP

Cloning Enums. Cloning and Enums BIU OOP Table of contents 1 Cloning 2 Integer representation Object representation Java Enum Cloning Objective We have an object and we need to make a copy of it. We need to choose if we want a shallow copy or

More information

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content Core Java - SCJP Course content NOTE: For exam objectives refer to the SCJP 1.6 objectives. 1. Declarations and Access Control Java Refresher Identifiers & JavaBeans Legal Identifiers. Sun's Java Code

More information

What is an Iterator? An iterator is an abstract data type that allows us to iterate through the elements of a collection one by one

What is an Iterator? An iterator is an abstract data type that allows us to iterate through the elements of a collection one by one Iterators What is an Iterator? An iterator is an abstract data type that allows us to iterate through the elements of a collection one by one 9-2 2-2 What is an Iterator? An iterator is an abstract data

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

Introduction: Manual Testing :

Introduction: Manual Testing : : What is Automation Testing? Use of Automation. Where do we use. Tools that Do Automation. Web Applications vs Standalone Applications. What is selenium? How selenium works. Manual Testing : HTML: Detailed

More information

A web-based IDE for Java

A web-based IDE for Java A web-based IDE for Java Software Engineering Laboratory By: Supervised by: Marcel Bertsch Christian Estler Dr. Martin Nordio Prof. Dr. Bertrand Meyer Student Number: 09-928-896 Content 1 Introduction...3

More information

Exercises Software Development I. 08 Objects II. Generating and Releasing Objects (Constructors/Destructors, this, Object cloning) December 3rd, 2014

Exercises Software Development I. 08 Objects II. Generating and Releasing Objects (Constructors/Destructors, this, Object cloning) December 3rd, 2014 Exercises Software Development I 08 Objects II Generating and Releasing Objects (Constructors/Destructors, this, Object cloning) December 3rd, 2014 Software Development I Winter term 2014/2015 Priv.-Doz.

More information

Selenium Testing Course Content

Selenium Testing Course Content Selenium Testing Course Content Introduction What is automation testing? What is the use of automation testing? What we need to Automate? What is Selenium? Advantages of Selenium What is the difference

More information

Sets and Maps. Part of the Collections Framework

Sets and Maps. Part of the Collections Framework Sets and Maps Part of the Collections Framework The Set interface A Set is unordered and has no duplicates Operations are exactly those for Collection int size( ); boolean isempty( ); boolean contains(object

More information

Innovative and Pragmatic Java Source Code Generation. Nikolche Mihajlovski

Innovative and Pragmatic Java Source Code Generation. Nikolche Mihajlovski Innovative and Pragmatic Java Source Code Generation Nikolche Mihajlovski Introduction Hello, world! System.out.println("Hello, GeeCON world!"); Person me = new Person(); me.setfirstname("nikolche"); me.setlastname("mihajlovski");

More information

Tony Valderrama, SIPB IAP 2010

Tony Valderrama, SIPB IAP 2010 Today Java API java.util java.io More OOP Generics Enum.jar files JNI Q & A Announcements Course website: http://sipb.mit.edu/iap/java/ Email: sipb-iap-java@mit.edu package java.io Images from the Java

More information

JAVA. 1. Introduction to JAVA

JAVA. 1. Introduction to JAVA JAVA 1. Introduction to JAVA History of Java Difference between Java and other programming languages. Features of Java Working of Java Language Fundamentals o Tokens o Identifiers o Literals o Keywords

More information

Core Java Contents. Duration: 25 Hours (1 Month)

Core Java Contents. Duration: 25 Hours (1 Month) Duration: 25 Hours (1 Month) Core Java Contents Java Introduction Java Versions Java Features Downloading and Installing Java Setup Java Environment Developing a Java Application at command prompt Java

More information

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring Java Outline Java Models for variables Types and type checking, type safety Interpretation vs. compilation Reasoning about code CSCI 2600 Spring 2017 2 Java Java is a successor to a number of languages,

More information

PVS. Empirical Study of Usage and Performance of Java Collections. Diego Costa, 1 Artur Andrzejak, 1 Janos Seboek, 2 David Lo

PVS. Empirical Study of Usage and Performance of Java Collections. Diego Costa, 1 Artur Andrzejak, 1 Janos Seboek, 2 David Lo Empirical Study of Usage and Performance of Java Collections Diego Costa, Artur Andrzejak, Janos Seboek, 2 David Lo Heidelberg University, 2 Singapore Management University PVS Empirical Study of Usage

More information

Classes, interfaces, & documentation. Review of basic building blocks

Classes, interfaces, & documentation. Review of basic building blocks Classes, interfaces, & documentation Review of basic building blocks Objects Data structures literally, storage containers for data constitute object knowledge or state Operations an object can perform

More information

Collections (Java) Collections Framework

Collections (Java) Collections Framework Collections (Java) https://docs.oracle.com/javase/tutorial/collections/index.html Collection an object that groups multiple elements into a single unit. o store o retrieve o manipulate o communicate o

More information

1 OBJECT-ORIENTED PROGRAMMING 1

1 OBJECT-ORIENTED PROGRAMMING 1 PREFACE xvii 1 OBJECT-ORIENTED PROGRAMMING 1 1.1 Object-Oriented and Procedural Programming 2 Top-Down Design and Procedural Programming, 3 Problems with Top-Down Design, 3 Classes and Objects, 4 Fields

More information

The Proxy Pattern. Design Patterns In Java Bob Tarr

The Proxy Pattern. Design Patterns In Java Bob Tarr The Proxy Pattern Intent Provide a surrogate or placeholder for another object to control access to it Also Known As Surrogate Motivation A proxy is a person authorized to act for another person an agent

More information

CMSC 202H. Containers and Iterators

CMSC 202H. Containers and Iterators CMSC 202H Containers and Iterators Container Definition A container is a data structure whose purpose is to hold objects. Most languages support several ways to hold objects Arrays are compiler-supported

More information

Lecture 16: Case Study: The Java Collections API

Lecture 16: Case Study: The Java Collections API Lecture 16: Case Study: The Java Collections API You can t be a competent Java programmer without understanding the crucial parts of the Java library. The basic types are all in java.lang, and are part

More information

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar Java Classes Introduction to the Java Programming Language Produced by Eamonn de Leastar edeleastar@wit.ie Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Voyager Interoperability Guide Version 1.1 for Voyager 8.0

Voyager Interoperability Guide Version 1.1 for Voyager 8.0 Voyager Interoperability Guide Version 1.1 for Voyager 8.0 Table of Contents Introduction... 3 Audience... 3 Prerequisites... 3 Overview... 3 Contacting Technical Support... 3 The Distributed Data Model...

More information

The Art of Metaprogramming in Java. Falguni Vyas Dec 08, 2012

The Art of Metaprogramming in Java. Falguni Vyas Dec 08, 2012 The Art of Metaprogramming in Java Falguni Vyas Dec 08, 2012 Metadata What is Metadata? Data that describes other data Defined as data providing information about one or more aspects of the data, such

More information

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started Application Development in JAVA Duration Lecture: Specialization x Hours Core Java (J2SE) & Advance Java (J2EE) Detailed Module Part I: Core Java (J2SE) Getting Started What is Java all about? Features

More information

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS Core Java SYLLABUS COVERAGE Introduction. OOPS Package Exception Handling. Multithreading Applet, AWT, Event Handling Using NetBean, Ecllipse. Input Output Streams, Serialization Networking Collection

More information

CSE 331 Final Exam 12/9/13

CSE 331 Final Exam 12/9/13 Name There are 10 questions worth a total of 100 points. Please budget your time so you get to all of the questions. Keep your answers brief and to the point. The exam is closed book, closed notes, closed

More information

From C++ to Java. Duke CPS

From C++ to Java. Duke CPS From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed on JVM byte-code is highly-portable, write

More information

Software Engineering Design & Construction

Software Engineering Design & Construction Winter Semester 17/18 Software Engineering Design & Construction Dr. Michael Eichberg Fachgebiet Softwaretechnik Technische Universität Darmstadt A Critical View on Inheritance 2 A Critical View On Inheritance

More information

15CS45 : OBJECT ORIENTED CONCEPTS

15CS45 : OBJECT ORIENTED CONCEPTS 15CS45 : OBJECT ORIENTED CONCEPTS QUESTION BANK: What do you know about Java? What are the supported platforms by Java Programming Language? List any five features of Java? Why is Java Architectural Neutral?

More information

A Large-Scale Analysis of Java API Usage

A Large-Scale Analysis of Java API Usage A Large-Scale Analysis of Java API Usage Diplomarbeit zur Erlangung des Grades eines Diplom-Informatikers im Studiengang Informatik vorgelegt von Jürgen Starek Koblenz, im März 2010 Erstgutachter: Zweitgutachter:

More information

Abstract Classes and Interfaces

Abstract Classes and Interfaces Abstract Classes and Interfaces Reading: Reges and Stepp: 9.5 9.6 CSC216: Programming Concepts Sarah Heckman 1 Abstract Classes A Java class that cannot be instantiated, but instead serves as a superclass

More information

Mixed projects: Java + Kotlin. Svetlana Isakova

Mixed projects: Java + Kotlin. Svetlana Isakova Mixed projects: Java + Kotlin Svetlana Isakova Compilation of a mixed project *.kt kotlinc *.class *.jar *.java javac *.class Nullability Nullability Type =? Java Kotlin Nullability annotations @Nullable

More information

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models Human-computer interaction Lecture 1b: Design & Implementation Human-computer interaction is a discipline concerned with the design, implementation, and evaluation of interactive systems for human use

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Class Dependency Analyzer CDA Developer Guide

Class Dependency Analyzer CDA Developer Guide CDA Developer Guide Version 1.4 Copyright 2007-2017 MDCS Manfred Duchrow Consulting & Software Author: Manfred Duchrow Table of Contents: 1 Introduction 3 2 Extension Mechanism 3 1.1. Prerequisites 3 1.2.

More information

Complete Java Contents

Complete Java Contents Complete Java Contents Duration: 60 Hours (2.5 Months) Core Java (Duration: 25 Hours (1 Month)) Java Introduction Java Versions Java Features Downloading and Installing Java Setup Java Environment Developing

More information

What is the Java Collections Framework?

What is the Java Collections Framework? 1 of 13 What is the Java Collections Framework? To begin with, what is a collection?. I have a collection of comic books. In that collection, I have Tarzan comics, Phantom comics, Superman comics and several

More information

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS Chapter 1 : Chapter-wise Java Multiple Choice Questions and Answers Interview MCQs Java Programming questions and answers with explanation for interview, competitive examination and entrance test. Fully

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS Java language Part 1. Java fundamentals Yevhen Berkunskyi, NUoS eugeny.berkunsky@gmail.com http://www.berkut.mk.ua What Java is? Programming language Platform: Hardware Software OS: Windows, Linux, Solaris,

More information

5/23/2015. Core Java Syllabus. VikRam ShaRma

5/23/2015. Core Java Syllabus. VikRam ShaRma 5/23/2015 Core Java Syllabus VikRam ShaRma Basic Concepts of Core Java 1 Introduction to Java 1.1 Need of java i.e. History 1.2 What is java? 1.3 Java Buzzwords 1.4 JDK JRE JVM JIT - Java Compiler 1.5

More information

104. Intermediate Java Programming

104. Intermediate Java Programming 104. Intermediate Java Programming Version 6.0 This course teaches programming in the Java language -- i.e. the Java Standard Edition platform. It is intended for students with previous Java experience

More information

The class Object. Lecture CS1122 Summer 2008

The class Object.  Lecture CS1122 Summer 2008 The class Object http://www.javaworld.com/javaworld/jw-01-1999/jw-01-object.html Lecture 10 -- CS1122 Summer 2008 Review Object is at the top of every hierarchy. Every class in Java has an IS-A relationship

More information

Table of Contents. Tutorial API Deployment Prerequisites... 1

Table of Contents. Tutorial API Deployment Prerequisites... 1 Copyright Notice All information contained in this document is the property of ETL Solutions Limited. The information contained in this document is subject to change without notice and does not constitute

More information

Subversion Release Manager

Subversion Release Manager Subversion Release Manager Plugin Information No information for the plugin 'svn-release-mgr' is available. It may have been removed from distribution. This plugin allows you to set up a job in Jenkins

More information

Class Libraries. Readings and References. Java fundamentals. Java class libraries and data structures. Reading. Other References

Class Libraries. Readings and References. Java fundamentals. Java class libraries and data structures. Reading. Other References Reading Readings and References Class Libraries CSE 142, Summer 2002 Computer Programming 1 Other References» The Java tutorial» http://java.sun.com/docs/books/tutorial/ http://www.cs.washington.edu/education/courses/142/02su/

More information

CMSC 132: Object-Oriented Programming II. Effective Java. Department of Computer Science University of Maryland, College Park

CMSC 132: Object-Oriented Programming II. Effective Java. Department of Computer Science University of Maryland, College Park CMSC 132: Object-Oriented Programming II Effective Java Department of Computer Science University of Maryland, College Park Effective Java Textbook Title Effective Java, Second Edition Author Joshua Bloch

More information

FindBugs review of Glassfish v2 b09

FindBugs review of Glassfish v2 b09 FindBugs review of Glassfish v2 b09 William Pugh Univ. of Maryland http://www.cs.umd.edu/~pugh/ FindBugs Open source static analysis tool for finding defects in Java programs Analyzes classfiles Generates

More information

CS2113 Lab: Collections 10/29/2018

CS2113 Lab: Collections 10/29/2018 CS2113 Lab: Collections Yawei Wang 10/29/2018 Install and Use IntelliJ on Mac or Window If you haven t installed JDK before, go to https://www.oracle.com/technetwork/java/javaseproducts/downloads/in dex.html

More information

Introduction to Java Programming

Introduction to Java Programming Introduction to Java Programming Length: 5 Days Description: This course presents an overview of the Java programming language, including file I/O threads. In order to build a solid foundation for Java

More information

JAVA. Duration: 2 Months

JAVA. Duration: 2 Months JAVA Introduction to JAVA History of Java Working of Java Features of Java Download and install JDK JDK tools- javac, java, appletviewer Set path and how to run Java Program in Command Prompt JVM Byte

More information

PIC 20A The Basics of Java

PIC 20A The Basics of Java PIC 20A The Basics of Java Ernest Ryu UCLA Mathematics Last edited: November 1, 2017 Outline Variables Control structures classes Compilation final and static modifiers Arrays Examples: String, Math, and

More information

JAVA MOCK TEST JAVA MOCK TEST II

JAVA MOCK TEST JAVA MOCK TEST II http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

Java Programming. Atul Prakash

Java Programming. Atul Prakash Java Programming Atul Prakash Java Language Fundamentals The language syntax is similar to C/ C++ If you know C/C++, you will have no trouble understanding Java s syntax If you don't, it will be easier

More information

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p.

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p. A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p. 9 Classes and Objects p. 11 Creating Objects p. 12 Static or

More information

C++ for System Developers with Design Pattern

C++ for System Developers with Design Pattern C++ for System Developers with Design Pattern Introduction: This course introduces the C++ language for use on real time and embedded applications. The first part of the course focuses on the language

More information

Chapter 13 Abstract Classes and Interfaces

Chapter 13 Abstract Classes and Interfaces Chapter 13 Abstract Classes and Interfaces 1 Abstract Classes Abstraction is to extract common behaviors/properties into a higher level in the class hierarch so that they are shared (implemented) by subclasses

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

Inheritance and Interfaces

Inheritance and Interfaces Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical

More information

Introduction to JPA. Fabio Falcinelli

Introduction to JPA. Fabio Falcinelli Introduction to JPA Fabio Falcinelli Me, myself and I Several years experience in active enterprise development I love to design and develop web and standalone applications using Python Java C JavaScript

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

List ADT. Announcements. The List interface. Implementing the List ADT

List ADT. Announcements. The List interface. Implementing the List ADT Announcements Tutoring schedule revised Today s topic: ArrayList implementation Reading: Section 7.2 Break around 11:45am List ADT A list is defined as a finite ordered sequence of data items known as

More information

Getting started with Java

Getting started with Java Getting started with Java by Vlad Costel Ungureanu for Learn Stuff Programming Languages A programming language is a formal constructed language designed to communicate instructions to a machine, particularly

More information

JAVA SYLLABUS FOR 6 WEEKS

JAVA SYLLABUS FOR 6 WEEKS JAVA SYLLABUS FOR 6 WEEKS Java 6-Weeks INTRODUCTION TO JAVA History and Features of Java Comparison of C, C++, and Java Java Versions and its domain areas Life cycle of Java program Writing first Java

More information

CS18000: Programming I

CS18000: Programming I CS18000: Programming I Testing Basics 19 April 2010 Prof. Chris Clifton Testing Programs Your programs are getting large and more complex How do you make sure they work? 1. Reason about the program Think

More information

Core Java Syllabus. Overview

Core Java Syllabus. Overview Core Java Syllabus Overview Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems' Java

More information

EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule Berner Fachhochschule Technik und Informatik EJB 3 Entities Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content Characteristics of entities Programming

More information

CMSC 202. Containers

CMSC 202. Containers CMSC 202 Containers Container Definition A container is a data structure whose purpose is to hold objects. Most languages support several ways to hold objects. Arrays are compiler-supported containers.

More information

Introduction to Java Programming

Introduction to Java Programming Introduction to Java Programming Length: 5 Days Description: This course presents an overview of the Java programming language, including file I/O threads. In order to build a solid foundation for Java

More information

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question) CS/B.TECH/CSE(New)/SEM-5/CS-504D/2013-14 2013 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers

More information

Lab5. Wooseok Kim

Lab5. Wooseok Kim Lab5 Wooseok Kim wkim3@albany.edu www.cs.albany.edu/~wooseok/201 Question Answer Points 1 A or B 8 2 A 8 3 D 8 4 20 5 for class 10 for main 5 points for output 5 D or E 8 6 B 8 7 1 15 8 D 8 9 C 8 10 B

More information

PeerSim HOWTO: search framework and algorithms on peersim

PeerSim HOWTO: search framework and algorithms on peersim PeerSim HOWTO: search framework and algorithms on peersim Gian Paolo Jesi (jesi@cs.unibo.it) Simon Patarin (patarin@cs.unibo.it) November, 24 1 Introduction This tutorial is aimed to give you a step by

More information