Study of Procedure Signature Evolution Software Engineering Project Preetha Ramachandran

Size: px
Start display at page:

Download "Study of Procedure Signature Evolution Software Engineering Project Preetha Ramachandran"

Transcription

1 Study of Procedure Signature Evolution Software Engineering Project Preetha Ramachandran 1.0 Introduction Software evolution is a continuous process. New features are frequently added, bugs fixed and code restructured for maintenance. Software projects often involve sources in C, C++, Java, scripts, makefiles, libraries and other files. In this project we aim to study the evolution of Java source files in a project. Source changes in Java frequently involve extending classes, adding new member variables, methods, introducing new interfaces, changing modifiers. We gather information on how often the signature patterns change. We study the addition of new classes, member methods, signature changes and modifiers changes. Software projects can use this information to study which portions of the sources are frequently changed and what is the change pattern if any. This information can be used to efficiently design better interfaces for extensibility, predict signature changes understand how the software is being changed to accommodate features. To study the evolution we used Kenyon[1,2] which is a convenient data extraction software. Kenyon helps extract the various revisions in the software repository and save this information in a database or file format. We implement a Java fact extractor which parses Java source files and class files and gathers information from each revision which is interesting to us. We then Run our analyzer over this information to gather evolution information and patterns. We used this infrastructure to analyze the evolution of Kenyon itself. SCM Repository Kenyon Local directory Java Fact Extractor Results depicting -Additions -Deletions -Return type -Modifier changes etc Analyzer Xml file for each revision containing nodes for each function Figure 1Project Algorithm Flow

2 2.0 The Algorithm Flow We used Kenyon to analyze the Kenyon repository itself. Kenyon provides interfaces to conveniently extract various revisions from the SCM repositories. Figure.1 illustrates the flow of the algorithm used in the project. Using Kenyon, we obtain the source files of the project we wish to analyze from the project's SCM repository. The Fact Extractor reads the source files, extracts data related to the method signatures and creates a graph containing information about methods, classes and their signatures. This information is then written out in a compact file format to disk. Kenyon also provides an interface to store the revision information in a database. For this project we have not used the database feature, rather directly stored the relevant information on disk. We then analyze the changes in these signatures over various revisions using the algorithm described in the Analyzer section. 2.1 Fact Extractor Projects written in Java usually involve the main development tree which mostly consists of Java sources. Projects also contain support libraries in the form of jar files and native sources written in C and C++. Sunghun Kim et al have analyzed signature change patterns for C projects[3]. We concentrate on studying the evolution of the Java portion of the sources only. We ignore any changes in the native C and C++ portions of the software. The fact extractor has the capability of parsing both the class files and Java source files in order to extract information about class and method signatures. Extracting information from a Java source file involves implementing almost all the functionality of a Java source compiler. It also involves completely understanding the language semantics. For our purpose we use the functionality provided by ANTLR[4]. ANTLR has the ability to parse the source files based on the language grammar files[4] and generate its internal representation which is a syntax tree. We selectively walk this syntax tree and gather relevant information. This scheme works very well to gather course grained information about the class file, its methods modifiers and member variables. However, it is complicated to gather information from the method bodies itself, as such information may reside in complicated expression which we may need to reduce. We found if a Java source file could be compiled using the standard Javac compiler, we can conveniently extract all the information from the Java class file. The Java class file format[5,6] is a compact and clear representation of the Java source file. It contains all the information in an easy to gather format. However, we found that some information like line numbers and variable names may not be reliably contained in the class file. Also, not all projects which made their source files available, did make their class files available. Generating their class files ourselves would require setting up the build environment which may not be easily configurable. The capability of parsing class files gives us more options to explore the caller-callee relationships in future and the ability to gather changes in binary distributions of the project and third party jar files. The Java fact extractor walks through the ANTLR syntax tree and generates a graph structure that contains a node for each class and each method. The class node contains the following attributes - hierarchy key which identifies the node as a class name of the class name of the source file if available package name

3 <graph name="system" formatversion="2"> <date>jan 31, :56:23 PM GMT</date> <id>259</id> <node name="edu.se.evolution.kenyon.configdata"> <Extends>java.lang.Object</Extends> <Implements>Comparable</Implements> <Import> edu.se.evolution.kenyon.scm.scmreposconfigspec edu.se.evolution.kenyon.util.* java.util.* net.sf.hibernate.* </Import> <Modifiers>public</Modifiers> <Package>edu.se.evolution.kenyon</Package> <SourceFile>ConfigData.java</SourceFile> <Variable>33:protected:Long:id</Variable> <hierarchy_level>class</hierarchy_level> <tag>configdata</tag> </node> <node name="edu.se.evolution.kenyon.configdata.configdata(scmreposconfigspec)"> <Modifiers>public</Modifiers> <Parametres>(SCMReposConfigSpec)</Parametres> <hierarchy_level>constructor</hierarchy_level> <tag>configdata</tag> <metrics> <Parameters_count>java.lang.Integer::1</Parameters_count> <lineno>java.lang.integer::40</lineno> </metrics> </node> <node name="edu.se.evolution.kenyon.configdata.addgraph(configgraph)"> <Modifiers>public</Modifiers> <Parametres>(ConfigGraph)</Parametres> <Returns>void</Returns> <hierarchy_level>procedure</hierarchy_level> <tag>addgraph</tag> <metrics> <Parameters_count>java.lang.Integer::1</Parameters_count> <lineno>java.lang.integer::73</lineno> </metrics> </node> <node name="edu.se.evolution.kenyon.configdata.addtorelateddata(string,java.io.serializable)"> <Modifiers>protected</Modifiers> <Parametres>(String,java.io.Serializable)</Parametres> <Returns>void</Returns> <hierarchy_level>procedure</hierarchy_level> <tag>addtorelateddata</tag> <metrics> <Parameters_count>java.lang.Integer::2</Parameters_count> <lineno>java.lang.integer::322</lineno> </metrics> Figure 2 A portion of the XML file generated by the Fact Extractor for revision 259 of the Kenyon project

4 extends information about which class it extends import strings if available modifiers that specifies if the class is public, private or protected implements - information about which interface it implements, if any members other than the methods in the class, represented as string Each node for a method which could also be a constructor contains the following attributes- hierarchy key name of the method of the form packagename.classname.functionname return type if the node does not represent a constructor modifiers parameters which is a ',' separated string of argument types parameter count line numbers exceptions that the method throws, if any After extracting this information, the Fact Extractor writes it to an XML file format, resulting in one XML file corresponding to each revision of the project. It also logs all the revisions written out in a separate file which the analyzer can read to compare revisions conveniently. Figure 2 shows a sample XML file generated from the Fact Extractor. 2.2 Analyzer The Java analyzer takes the graph structures generated by the fact extractor as the input, and sorts them based on the version dates. Two consecutive revisions are taken and compared with each other and changes recorded. The algorithm makes the assumption that the method whose name does not match the name of any of the methods in the previous version, is considered to be new. In other words, methods, variables and classes renamed or moved are also considered as new. The different steps in the comparison algorithm can be described as follows. Step 1 : For each method in the newer revision, search for the method with same name in the older revision. If no such method is found consider this method as new. Step 2: If a match is found we compare all the existing signatures of the method in the two revisions. protected:void <-(SCMReposConfigSpec,String,Date ) protected:void <-(SCMReposConfigSpec,String,Date,String,String ) Table 1 An example of parameter addition (A) in revision 87 of the Kenyon project for the function edu.se.evolution.kenyon.scm.scm.setspecprops() Step 3: If the methods in both revisions contain only one signature, then compare and record return type changes (R), modifier changes (M), parameter additions (A), parameter deletions (D), parameter additions and deletions combined (AD) and order changes(o). Parameter additions include only those cases in which the method in the newer revision has one or more parameters in addition to all the parameters of the method in the previous

5 revision. Table 1 shows an example of parameter addition. Similar logic holds for parameter deletions. AD denotes the case in which the method in the newer version contains only some of the parameters of the same method in the previous revision as well as some new parameters. Table 2 shows an example of AD. Order changes (O) are recorded for those methods which have exactly the same parameters as the method in the previous revision, but in a different order. public:void <-(SCMRepositoryInterface,FactExtractor,SystemAnalysis ) public:void <-(SCMRepositoryInterface,FactExtractor,Project ) Table 2 An example of parameter addition and deletion (AD) in revision 109 of the Kenyon project for the function edu.se.evolution.kenyon.datamanager.datamanager() Step 4: If either of the two methods contain more than one signature (i.e. the method is overloaded in any of the revisions) then create a list for each revision containing all the signatures for that method. For example, if a method foo() contains the signatures (char b) and (boolean c) in the old revision, and contains signatures (char b), (boolean c, int d), (boolean c, char g) in the new revision, then the two lists would contain list 1 (revision 1) : (char b), (boolean c) list 2 (revision 2) : (char b), (int c, int d), (boolean c, char g) For each method in list 2, search for an exact match in the list 1 and if found remove both the methods from their respective lists. At the end, each of the lists will contain methods which are in some ways different from all the methods of the other list. In the previous example, (char b) in list 2 has an exact match in list 1. So (char b) is removed from both the lists. The lists would now contain list 1 : (boolean c) list 2 : (int c, int d), (boolean c, char g) Sort the two lists based on the line number of the methods. For example, if the method with signature (boolean c, char g) exists at a smaller line number than that with signature (int c, int d), then after sorting, the lists would contain list 1 : (boolean c) list 2 : (boolean c, char g), (int c, int d) We assume that the user may have introduced new overloaded methods without disturbing the relative locations of existing methods, so the line number correlation is reasonable. If methods are rearranged, the algorithm can produce skewed results. We will need to apply stronger analysis in the future by taking into account the content of the function body and comparing them[7] instead of line numbers. Compare the n th method of list 1 to the n th method of list 2 using Step 3. Record the differences and delete the methods from their lists. In the above example, (boolean c) is compared to (boolean c, char g) and a parameter addition(a) is recorded for this method. The two lists now become list 1 : list 2 : (int c, int d) If all the methods of list 1 gets exhausted, and the list 2 is non-empty, then the

6 methods left in list 2 are considered to be the newly added overloaded methods (L). On the other hand, if the methods of list 2 get exhausted before those in list 1 then the methods left in list 1 are considered to be deleted. In our example L is recorded for void foo(int c, int d). 3.0 Results We used our project to study the evolution of procedure signatures in Kenyon. At the time of data collection there were 293 revisions containing 2047 methods. Figure 3`shows the results from our FE and Analyzer, depicting the number of methods that underwent each type of signature changes. We observe that the number of parameter additions(a) together with the number of parameter additions-and-deletions account for most of the changes. It is closely followed by the number of parameter deletions (D) and the newly added overloaded methods (L). We also found that there were more than 100 functions that were deleted. The class level changes included 27 Super Class changes, 11 modifier changes and 66 class-variable changes. Some of the longest patterns that we observed were ALDD(AD)DD, AADDL, AAAE and some of the shorter ones were AD, DL, AR, AL, RA and RD. The most commonly occurring changes were DMA, AD and L(AD). Types of Signature Changes as seen for Kenyon Additions Deletions Additions & Deletions Modifier change Return type changes Overloaded functions added Figure 3 Types of Signature Changes In order to analyze the type of changes in different revisions, we collected data in groups of 20 revisions. Figure 4 shows the signature changes graph over 293 revisions and figure 5 depicts the distribution of the different types of changes for each of the revision groups. We made the following observations. The maximum number of signature changes occurred between revision 80 and 100. We noticed all the different types of signature changes, parameter addition, deletion, return type, modifier changes and overloaded

7 functions were introduced during this time. There are a couple of windows, one at the beginning and the other after the spike in signature change activity, where we observe almost no changes. It appears that these were the periods when a lot of new classes and methods were introduced to accommodate the growth in the project and the existing methods remained almost unchanged with respect to their signatures. It is also interesting to see that during some intervals as the one between and , a number of new overloaded functions were added and were the only changes that took place during that time. Although, the overall number of parameter additions and deletions are more than the number of additions in overloaded functions, the latter appears to have a larger span over the revisions Figure 4 Change in the number of signature changes in the Kenyon project from revision 1 to revision

8 50 Number of Changes Overloaded method Modifier Add & Delete ReturnType Delete Add Revision Number Figure 5 Signature Change Types Over Revisions Threats to Validity The project uses a preliminary algorithm for taking into account overloaded functions while studying function evolution. The accuracy of the results obtained are dependent on the assumptions made in this algorithm. Secondly, while comparing two functions, the algorithm does not distinguish between addition/deletion of one parameter and addition/deletion of more than one parameter. For example, version 1 has a function void foo(int a), and in version 2 the function signature changes to void foo(int a, char b, int c), we record an addition as the parameter change. We do not count the total number of parameters added. We do not consider pseudo changes such as parameter name changes as long as the type remains the same. The project attempts to develop a methodology for signature analysis of functions for Java based projects in general. The results are obtained for one such project, Kenyon. The patterns observed in the signature changes are therefore specific to this project. 5.0 Conclusions And Future Work In this project we have established a framework for studying the evolution of Java classes and methods. We have applied this work on the Kenyon repository and identified change patterns. This work needs to be applied on more projects and larger repositories in order to find a general evolution pattern. Overloading in Java also provides a challenge in accurately identifying changes to methods. We may need to study other algorithms and works presented in this area to identify name changes and overloading.

9 6.0 References [1] User Manual: Kenyon, GRASE Lab Dept. of Computer Science, Baskin Engineering University of California, Santa Cruz [2] J.Bevan, Kenyon Project Homepage, 2005 [3] Sunghun Kim, E. James Whitehead, Jr., Analysis of Signature Change Patterns, 2005 [4] Another Tool for Language Recognition (ANTLR). [5] T. Lindholm, F. Yellin, The Java Virtual Machine Specification, 2nd Edition, AddisonWesley, [6] James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison Wesley, [7] Q. Tu, M.W. Godfrey, "An Integrated Approach for Studying Architectural Evolution", IWPC, Paris, 2002.

Frequently Asked Questions

Frequently Asked Questions Frequently Asked Questions This PowerTools FAQ answers many frequently asked questions regarding the functionality of the various parts of the PowerTools suite. The questions are organized in the following

More information

Annotation File Specification

Annotation File Specification Annotation File Specification Javari Team MIT Computer Science and Artificial Intelligence Lab javari@csail.mit.edu October 2, 2007 1 Purpose: External storage of annotations Java annotations are meta-data

More information

EECS168 Exam 3 Review

EECS168 Exam 3 Review EECS168 Exam 3 Review Exam 3 Time: 2pm-2:50pm Monday Nov 5 Closed book, closed notes. Calculators or other electronic devices are not permitted or required. If you are unable to attend an exam for any

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

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

Micro Pattern Evolution

Micro Pattern Evolution Sunghun Kim Department of Computer Science University of California, Santa Cruz Santa Cruz, CA, USA hunkim@cs.ucsc.edu ABSTRACT When analyzing the evolution history of a software project, we wish to develop

More information

Grammars and Parsing, second week

Grammars and Parsing, second week Grammars and Parsing, second week Hayo Thielecke 17-18 October 2005 This is the material from the slides in a more printer-friendly layout. Contents 1 Overview 1 2 Recursive methods from grammar rules

More information

WACC Report. Zeshan Amjad, Rohan Padmanabhan, Rohan Pritchard, & Edward Stow

WACC Report. Zeshan Amjad, Rohan Padmanabhan, Rohan Pritchard, & Edward Stow WACC Report Zeshan Amjad, Rohan Padmanabhan, Rohan Pritchard, & Edward Stow 1 The Product Our compiler passes all of the supplied test cases, and over 60 additional test cases we wrote to cover areas (mostly

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

CS11 Advanced Java. Winter Lecture 2

CS11 Advanced Java. Winter Lecture 2 CS11 Advanced Java Winter 2011-2012 Lecture 2 Today s Topics n Assertions n Java 1.5 Annotations n Classpaths n Unit Testing! n Lab 2 hints J Assertions! n Assertions are a very useful language feature

More information

Lab 2. Lexing and Parsing with ANTLR4

Lab 2. Lexing and Parsing with ANTLR4 Lab 2 Lexing and Parsing with ANTLR4 Objective Understand the software architecture of ANTLR4. Be able to write simple grammars and correct grammar issues in ANTLR4. Todo in this lab: Install and play

More information

When Java technology burst onto the Internet scene in 1995,

When Java technology burst onto the Internet scene in 1995, MOBILE CODE SECURITY SECURE JAVA CLASS LOADING The class loading mechanism, LI GONG Sun Microsystems central to Java, plays a key role in JDK 1.2 by enabling When Java technology burst onto the Internet

More information

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists COMP-202B, Winter 2009, All Sections Due: Tuesday, April 14, 2009 (23:55) You MUST do this assignment individually and, unless otherwise

More information

Abstract. We define an origin relationship as follows, based on [12].

Abstract. We define an origin relationship as follows, based on [12]. When Functions Change Their Names: Automatic Detection of Origin Relationships Sunghun Kim, Kai Pan, E. James Whitehead, Jr. Dept. of Computer Science University of California, Santa Cruz Santa Cruz, CA

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Exam Duration: 2hrs and 30min Software Design

Exam Duration: 2hrs and 30min Software Design Exam Duration: 2hrs and 30min. 433-254 Software Design Section A Multiple Choice (This sample paper has less questions than the exam paper The exam paper will have 25 Multiple Choice questions.) 1. Which

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Semantic Analysis. Compiler Architecture

Semantic Analysis. Compiler Architecture Processing Systems Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Source Compiler Architecture Front End Scanner (lexical tokens Parser (syntax Parse tree Semantic Analysis

More information

Project Compiler. CS031 TA Help Session November 28, 2011

Project Compiler. CS031 TA Help Session November 28, 2011 Project Compiler CS031 TA Help Session November 28, 2011 Motivation Generally, it s easier to program in higher-level languages than in assembly. Our goal is to automate the conversion from a higher-level

More information

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

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

Array. Prepared By - Rifat Shahriyar

Array. Prepared By - Rifat Shahriyar Java More Details Array 2 Arrays A group of variables containing values that all have the same type Arrays are fixed length entities In Java, arrays are objects, so they are considered reference types

More information

Java Internals. Frank Yellin Tim Lindholm JavaSoft

Java Internals. Frank Yellin Tim Lindholm JavaSoft Java Internals Frank Yellin Tim Lindholm JavaSoft About This Talk The JavaSoft implementation of the Java Virtual Machine (JDK 1.0.2) Some companies have tweaked our implementation Alternative implementations

More information

Supporting Class / C++ Lecture Notes

Supporting Class / C++ Lecture Notes Goal Supporting Class / C++ Lecture Notes You started with an understanding of how to write Java programs. This course is about explaining the path from Java to executing programs. We proceeded in a mostly

More information

Testing Exceptions with Enforcer

Testing Exceptions with Enforcer Testing Exceptions with Enforcer Cyrille Artho February 23, 2010 National Institute of Advanced Industrial Science and Technology (AIST), Research Center for Information Security (RCIS) Abstract Java library

More information

CSCI Lab 9 Implementing and Using a Binary Search Tree (BST)

CSCI Lab 9 Implementing and Using a Binary Search Tree (BST) CSCI Lab 9 Implementing and Using a Binary Search Tree (BST) Preliminaries In this lab you will implement a binary search tree and use it in the WorkerManager program from Lab 3. Start by copying this

More information

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE

More information

CS 330 Homework Comma-Separated Expression

CS 330 Homework Comma-Separated Expression CS 330 Homework Comma-Separated Expression 1 Overview Your responsibility in this homework is to build an interpreter for text-based spreadsheets, which are essentially CSV files with formulas or expressions

More information

Matt Meisinger, Akshata Ramesh, Alex Dong, Kate Haas

Matt Meisinger, Akshata Ramesh, Alex Dong, Kate Haas { Matt Meisinger, Akshata Ramesh, Alex Dong, Kate Haas Motivation Easy HTML manipulation: for extracting images, links, and other content from specific portions of the page. Traversing the hierarchical

More information

Compilers and computer architecture: A realistic compiler to MIPS

Compilers and computer architecture: A realistic compiler to MIPS 1 / 1 Compilers and computer architecture: A realistic compiler to MIPS Martin Berger November 2017 Recall the function of compilers 2 / 1 3 / 1 Recall the structure of compilers Source program Lexical

More information

Intermediate Code Generation

Intermediate Code Generation Intermediate Code Generation In the analysis-synthesis model of a compiler, the front end analyzes a source program and creates an intermediate representation, from which the back end generates target

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

COL728 Minor2 Exam Compiler Design Sem II, Answer all 5 questions Max. Marks: 20

COL728 Minor2 Exam Compiler Design Sem II, Answer all 5 questions Max. Marks: 20 COL728 Minor2 Exam Compiler Design Sem II, 2017-18 Answer all 5 questions Max. Marks: 20 1. Short questions a. Give an example of a program that is not a legal program if we assume static scoping, but

More information

How We Refactor, and How We Know it. Emerson Murphy-Hill, Chris Parnin, Andrew P. Black ICSE 2009

How We Refactor, and How We Know it. Emerson Murphy-Hill, Chris Parnin, Andrew P. Black ICSE 2009 How We Refactor, and How We Know it Emerson Murphy-Hill, Chris Parnin, Andrew P. Black ICSE 2009 Introduction Refactoring is the process of changing the structure of a program without changing the way

More information

Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan

Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Language Processing Systems Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Semantic Analysis Compiler Architecture Front End Back End Source language Scanner (lexical analysis)

More information

Run-time Environments. Lecture 13. Prof. Alex Aiken Original Slides (Modified by Prof. Vijay Ganesh) Lecture 13

Run-time Environments. Lecture 13. Prof. Alex Aiken Original Slides (Modified by Prof. Vijay Ganesh) Lecture 13 Run-time Environments Lecture 13 by Prof. Vijay Ganesh) Lecture 13 1 What have we covered so far? We have covered the front-end phases Lexical analysis (Lexer, regular expressions,...) Parsing (CFG, Top-down,

More information

Strings and Loops CSE moodle.yorku.ca. moodle.yorku.ca CSE 1020

Strings and Loops CSE moodle.yorku.ca. moodle.yorku.ca CSE 1020 Strings and Loops CSE 1020 moodle.yorku.ca Strings Strings are immutable objects. The state of an immutable object cannot be changed. The String API does not contain any mutators. The StringBuffer class

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Praktische Softwaretechnologie

Praktische Softwaretechnologie Praktische Softwaretechnologie Lecture 2. Károly Bósa () Research Institute for Symbolic Computation (RISC) 1 Books James Gosling, Bill Joy, Guy Steele The JavaTM Language Specification 2 Books James Gosling,

More information

Java TM Introduction. Renaud Florquin Isabelle Leclercq. FloConsult SPRL.

Java TM Introduction. Renaud Florquin Isabelle Leclercq. FloConsult SPRL. Java TM Introduction Renaud Florquin Isabelle Leclercq FloConsult SPRL http://www.floconsult.be mailto:info@floconsult.be Java Technical Virtues Write once, run anywhere Get started quickly Write less

More information

Java Programming. Manuel Oriol, March 22nd, 2007

Java Programming. Manuel Oriol, March 22nd, 2007 Java Programming Manuel Oriol, March 22nd, 2007 Goal Teach Java to proficient programmers 2 Roadmap Java Basics Eclipse Java GUI Threads and synchronization Class loading and reflection Java Virtual Machines

More information

Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava

Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava Nathan Burles 1, Edward Bowles 1, Alexander E. I. Brownlee 2, Zoltan A. Kocsis 2, Jerry Swan 1, Nadarajen Veerapen 2

More information

Exploring Dynamic Compilation Facility in Java

Exploring Dynamic Compilation Facility in Java Exploring Dynamic Compilation Facility in Java Dingwei He and Kasi Periyasamy Computer Science Department University of Wisconsin-La Crosse La Crosse, WI 54601 kasi@cs.uwlax.edu Abstract Traditional programming

More information

The design of the PowerTools engine. The basics

The design of the PowerTools engine. The basics The design of the PowerTools engine The PowerTools engine is an open source test engine that is written in Java. This document explains the design of the engine, so that it can be adjusted to suit the

More information

Make sure you have the latest Hive trunk by running svn up in your Hive directory. More detailed instructions on downloading and setting up

Make sure you have the latest Hive trunk by running svn up in your Hive directory. More detailed instructions on downloading and setting up GenericUDAFCaseStudy Writing GenericUDAFs: A Tutorial User-Defined Aggregation Functions (UDAFs) are an excellent way to integrate advanced data-processing into Hive. Hive allows two varieties of UDAFs:

More information

c) And last but not least, there are javadoc comments. See Weiss.

c) And last but not least, there are javadoc comments. See Weiss. CSCI 151 Spring 2010 Java Bootcamp The following notes are meant to be a quick refresher on Java. It is not meant to be a means on its own to learn Java. For that you would need a lot more detail (for

More information

CE221 Programming in C++ Part 1 Introduction

CE221 Programming in C++ Part 1 Introduction CE221 Programming in C++ Part 1 Introduction 06/10/2017 CE221 Part 1 1 Module Schedule There are two lectures (Monday 13.00-13.50 and Tuesday 11.00-11.50) each week in the autumn term, and a 2-hour lab

More information

Abstract Semantics for Java 1.4 Programs

Abstract Semantics for Java 1.4 Programs Abstract Semantics for Java 1.4 Programs Part I of: Verification of LePUS3/Class-Z Specifications: Sample models and Abstract Semantics for Java 1.4 Technical Report CSM-471, ISSN 1744-8050 Jonathan Nicholson,

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

Core JAVA Training Syllabus FEE: RS. 8000/-

Core JAVA Training Syllabus FEE: RS. 8000/- About JAVA Java is a high-level programming language, developed by James Gosling at Sun Microsystems as a core component of the Java platform. Java follows the "write once, run anywhere" concept, as it

More information

Getting It Right COMS W4115. Prof. Stephen A. Edwards Spring 2007 Columbia University Department of Computer Science

Getting It Right COMS W4115. Prof. Stephen A. Edwards Spring 2007 Columbia University Department of Computer Science Getting It Right COMS W4115 Prof. Stephen A. Edwards Spring 2007 Columbia University Department of Computer Science Getting It Right Your compiler is a large software system developed by four people. How

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

Week 8: Operator overloading

Week 8: Operator overloading Due to various disruptions, we did not get through all the material in the slides below. CS319: Scientific Computing (with C++) Week 8: Operator overloading 1 The copy constructor 2 Operator Overloading

More information

Wrapping a complex C++ library for Eiffel. FINAL REPORT July 1 st, 2005

Wrapping a complex C++ library for Eiffel. FINAL REPORT July 1 st, 2005 Wrapping a complex C++ library for Eiffel FINAL REPORT July 1 st, 2005 Semester project Student: Supervising Assistant: Supervising Professor: Simon Reinhard simonrei@student.ethz.ch Bernd Schoeller Bertrand

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 1: Introduction, HelloWorld Program and use of the Debugger 17 January 2019 SP1-Lab1-2018-19.pptx Tobi Brodie (tobi@dcs.bbk.ac.uk) 1 Module Information Lectures: Afternoon

More information

Run-time Environments

Run-time Environments Run-time Environments Status We have so far covered the front-end phases Lexical analysis Parsing Semantic analysis Next come the back-end phases Code generation Optimization Register allocation Instruction

More information

{pankai, ejw,

{pankai, ejw, Textual and Behavioral Views of Function Changes Kai Pan, E. James Whitehead, Jr., Guozheng Ge Dept. of Computer Science Baskin Engineering University of California, Santa Cruz {pankai, ejw, guozheng}@cs.ucsc.edu

More information

Compiler Design Spring 2017

Compiler Design Spring 2017 Compiler Design Spring 2017 7.5 Method invocation Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation 1 Admin issues There will be a recitation session today In CAB G 11 @ 15:15

More information

Run-time Environments

Run-time Environments Run-time Environments Status We have so far covered the front-end phases Lexical analysis Parsing Semantic analysis Next come the back-end phases Code generation Optimization Register allocation Instruction

More information

CS52 - Assignment 8. Due Friday 4/15 at 5:00pm.

CS52 - Assignment 8. Due Friday 4/15 at 5:00pm. CS52 - Assignment 8 Due Friday 4/15 at 5:00pm https://xkcd.com/859/ This assignment is about scanning, parsing, and evaluating. It is a sneak peak into how programming languages are designed, compiled,

More information

CS260 Intro to Java & Android 03.Java Language Basics

CS260 Intro to Java & Android 03.Java Language Basics 03.Java Language Basics http://www.tutorialspoint.com/java/index.htm CS260 - Intro to Java & Android 1 What is the distinction between fields and variables? Java has the following kinds of variables: Instance

More information

C. E. McDowell August 25, Baskin Center for. University of California, Santa Cruz. Santa Cruz, CA USA. abstract

C. E. McDowell August 25, Baskin Center for. University of California, Santa Cruz. Santa Cruz, CA USA. abstract Unloading Java Classes That Contain Static Fields C. E. McDowell E. A. Baldwin 97-18 August 25, 1997 Baskin Center for Computer Engineering & Information Sciences University of California, Santa Cruz Santa

More information

Improving Origin Analysis with Weighting Functions

Improving Origin Analysis with Weighting Functions Improving Origin Analysis with Weighting Functions Lin Yang, Anwar Haque and Xin Zhan Supervisor: Michael Godfrey University of Waterloo Introduction Software systems must undergo modifications to improve

More information

ASSIGNMENT 5 Objects, Files, and More Garage Management

ASSIGNMENT 5 Objects, Files, and More Garage Management ASSIGNMENT 5 Objects, Files, and More Garage Management COMP-202B, Winter 2010, All Sections Due: Wednesday, April 14, 2009 (23:55) You MUST do this assignment individually and, unless otherwise specified,

More information

The NetRexx Interpreter

The NetRexx Interpreter The NetRexx Interpreter http://www2.hursley.ibm.com/netrexx/ RexxLA / WarpTech -- 26 May 2000 Mike Cowlishaw IBM Fellow mfc@uk.ibm.com netrexxi Overview Introduction to NetRexx Demo. -- compiling and interpreting

More information

System Software Assignment 1 Runtime Support for Procedures

System Software Assignment 1 Runtime Support for Procedures System Software Assignment 1 Runtime Support for Procedures Exercise 1: Nested procedures Some programming languages like Oberon and Pascal support nested procedures. 1. Find a run-time structure for such

More information

An Introduction To Writing Your Own Classes CSC 123 Fall 2018 Howard Rosenthal

An Introduction To Writing Your Own Classes CSC 123 Fall 2018 Howard Rosenthal An Introduction To Writing Your Own Classes CSC 123 Fall 2018 Howard Rosenthal Lesson Goals Understand Object Oriented Programming The Syntax of Class Definitions Constructors this Object Oriented "Hello

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

Copyright 2007 Pearson Addison-Wesley Copyright 2018 Aiman Hanna All rights reserved

Copyright 2007 Pearson Addison-Wesley Copyright 2018 Aiman Hanna All rights reserved Comp 249 Programming Methodology Chapter 13 Generics & The ArrayList Class Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia University, Montreal, Canada These slides has

More information

Type Hierarchy. Lecture 6: OOP, autumn 2003

Type Hierarchy. Lecture 6: OOP, autumn 2003 Type Hierarchy Lecture 6: OOP, autumn 2003 The idea Many types have common behavior => type families share common behavior organized into a hierarchy Most common on the top - supertypes Most specific at

More information

Homework #10 due Monday, April 16, 10:00 PM

Homework #10 due Monday, April 16, 10:00 PM Homework #10 due Monday, April 16, 10:00 PM In this assignment, you will re-implement Dictionary as Map container class using the same data structure. A Map has an associated entry set and that set will

More information

boolean, char, class, const, double, else, final, float, for, if, import, int, long, new, public, return, static, throws, void, while

boolean, char, class, const, double, else, final, float, for, if, import, int, long, new, public, return, static, throws, void, while CSCI 150 Fall 2007 Java Syntax The following notes are meant to be a quick cheat sheet for Java. It is not meant to be a means on its own to learn Java or this course. For that you should look at your

More information

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7 Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7 1 Problem Ralph owns the Trinidad Fruit Stand that sells its fruit on the street, and he wants to use a computer

More information

CSCI0330 Intro Computer Systems Doeppner. Lab 02 - Tools Lab. Due: Sunday, September 23, 2018 at 6:00 PM. 1 Introduction 0.

CSCI0330 Intro Computer Systems Doeppner. Lab 02 - Tools Lab. Due: Sunday, September 23, 2018 at 6:00 PM. 1 Introduction 0. CSCI0330 Intro Computer Systems Doeppner Lab 02 - Tools Lab Due: Sunday, September 23, 2018 at 6:00 PM 1 Introduction 0 2 Assignment 0 3 gdb 1 3.1 Setting a Breakpoint 2 3.2 Setting a Watchpoint on Local

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 1: Introduction, HelloWorld Program and use of the Debugger 11 January 2018 SP1-Lab1-2017-18.pptx Tobi Brodie (tobi@dcs.bbk.ac.uk) 1 Module Information Lectures: Afternoon

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

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

Chapter 1. Preliminaries

Chapter 1. Preliminaries Chapter 1 Preliminaries Chapter 1 Topics Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation Criteria Influences on Language Design Language Categories Language

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

C-1. Overview. CSE 142 Computer Programming I. Review: Computer Organization. Review: Memory. Declaring Variables. Memory example

C-1. Overview. CSE 142 Computer Programming I. Review: Computer Organization. Review: Memory. Declaring Variables. Memory example CSE 142 Computer Programming I Variables Overview Concepts this lecture: Variables Declarations Identifiers and Reserved Words Types Expressions Assignment statement Variable initialization 2000 UW CSE

More information

Advanced Programming - CS239

Advanced Programming - CS239 Advanced Programming - CS239 Department of Computer Science LAB: EXPERIMENTING WITH SPECIALIZATION Getting Ready: Before going any further you should: 1. Make a directory on your N: drive for this lab.

More information

Programming Assignment 1

Programming Assignment 1 CMPS 101 Algorithms and Abstract Data Types Programming Assignment 1 Introduction The purpose of this assignment is threefold: to make sure everyone is up to speed with Java, to practice modularity and

More information

Maltepe University Computer Engineering Department. BİL 133 Algoritma ve Programlama. Chapter 8: Arrays and pointers

Maltepe University Computer Engineering Department. BİL 133 Algoritma ve Programlama. Chapter 8: Arrays and pointers Maltepe University Computer Engineering Department BİL 133 Algoritma ve Programlama Chapter 8: Arrays and pointers Basics int * ptr1, * ptr2; int a[10]; ptr1 = &a[2]; ptr2 = a; // equivalent to ptr2 =

More information

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java Introduction Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2 Problem Solving The purpose of writing a program is to solve a problem

More information

Configuration Management for Component-based Systems

Configuration Management for Component-based Systems Configuration Management for Component-based Systems Magnus Larsson Ivica Crnkovic Development and Research Department of Computer Science ABB Automation Products AB Mälardalen University 721 59 Västerås,

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

KU Compilerbau - Programming Assignment

KU Compilerbau - Programming Assignment 716.077 KU Compilerbau - Programming Assignment Univ.-Prof. Dr. Franz Wotawa, Birgit Hofer Institute for Software Technology, Graz University of Technology April 20, 2011 Introduction During this semester

More information

Automatic Identification of Bug-Introducing Changes

Automatic Identification of Bug-Introducing Changes Automatic Identification of Bug-Introducing Changes Sunghun Kim 1, Thomas Zimmermann 2, Kai Pan 1, E. James Whitehead, Jr. 1 1 University of California, Santa Cruz, CA, USA {hunkim, pankai, ejw}@cs.ucsc.edu

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

Objects and Iterators

Objects and Iterators Objects and Iterators Can We Have Data Structures With Generic Types? What s in a Bag? All our implementations of collections so far allowed for one data type for the entire collection To accommodate a

More information

Enhancing the IOA Code Generator s Abstract Data Types A Report of Atish Nigam s 2001 Summer Work

Enhancing the IOA Code Generator s Abstract Data Types A Report of Atish Nigam s 2001 Summer Work Enhancing the IOA Code Generator s Abstract Data Types A Report of Atish Nigam s 2001 Summer Work This past summer I worked on a number of different aspects of the IOA Code Generator. While the initial

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

Comp 248 Introduction to Programming Chapter 4 & 5 Defining Classes Part B

Comp 248 Introduction to Programming Chapter 4 & 5 Defining Classes Part B Comp 248 Introduction to Programming Chapter 4 & 5 Defining Classes Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia University, Montreal, Canada These slides has

More information

Method Resolution Approaches. Dynamic Dispatch

Method Resolution Approaches. Dynamic Dispatch Method Resolution Approaches Static - procedural languages (w/o fcn ptrs) Dynamically determined by data values C with function pointers Compile-time analysis can estimate possible callees Dynamically

More information

Type Hierarchy. Comp-303 : Programming Techniques Lecture 9. Alexandre Denault Computer Science McGill University Winter 2004

Type Hierarchy. Comp-303 : Programming Techniques Lecture 9. Alexandre Denault Computer Science McGill University Winter 2004 Type Hierarchy Comp-303 : Programming Techniques Lecture 9 Alexandre Denault Computer Science McGill University Winter 2004 February 16, 2004 Lecture 9 Comp 303 : Programming Techniques Page 1 Last lecture...

More information

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing Introduction 1 Chapter 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design 2007 Pearson Addison-Wesley. All rights reserved Focus of the Course Object-Oriented Software Development

More information

Programming Assignment III

Programming Assignment III Programming Assignment III First Due Date: (Grammar) See online schedule (submission dated midnight). Second Due Date: (Complete) See online schedule (submission dated midnight). Purpose: This project

More information

16-Dec-10. Consider the following method:

16-Dec-10. Consider the following method: Boaz Kantor Introduction to Computer Science IDC Herzliya Exception is a class. Java comes with many, we can write our own. The Exception objects, along with some Java-specific structures, allow us to

More information

AUTOMATIC GRAPHIC USER INTERFACE GENERATION FOR VTK

AUTOMATIC GRAPHIC USER INTERFACE GENERATION FOR VTK AUTOMATIC GRAPHIC USER INTERFACE GENERATION FOR VTK Wilfrid Lefer LIUPPA - Université de Pau B.P. 1155, 64013 Pau, France e-mail: wilfrid.lefer@univ-pau.fr ABSTRACT VTK (The Visualization Toolkit) has

More information

Comp 249 Programming Methodology

Comp 249 Programming Methodology Comp 249 Programming Methodology Chapter 7 - Inheritance Part A Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia University, Montreal, Canada These slides has been extracted,

More information

ASSIGNMENT 5 Objects, Files, and a Music Player

ASSIGNMENT 5 Objects, Files, and a Music Player ASSIGNMENT 5 Objects, Files, and a Music Player COMP-202A, Fall 2009, All Sections Due: Thursday, December 3, 2009 (23:55) You MUST do this assignment individually and, unless otherwise specified, you

More information