Core XP Practices with Java and Eclipse: Part 1

Size: px
Start display at page:

Download "Core XP Practices with Java and Eclipse: Part 1"

Transcription

1 1. Introduction Core XP Practices with Java and Eclipse: Part 1 This tutorial will illustrate some core practices of Extreme Programming(XP) while giving you a chance to get familiar with Java and the Eclipse IDE. The tools we will use are cross-platform and free off the web. Java - Object-oriented language and technology Eclipse - an open extensible IDE Junit - testing framework for Java unit tests Ant - Java-based build tool To illustrate these tools, we start with a simple Tic-Tac-Toe example application. 2. Example Application In XP, requirements are expressed as stories. These are short descriptions of features or qualities of the software that the customer desires. As an example consider a Tic-Tac-Toe game application. Traditionally in XP stories are written on index cards. Here they are listed below. 1. Allow 2 players to play a game of Tic-Tac-Toe on the computer. 2. Allow the players to input their move graphically (click on the board position). 3. The computer should prohibit illegal moves. 4. The computer should ascertain when the game is over and announce the winner. 5. The computer should indicate which markers formed part of a winning sequence. 6. After a game is completed, it should be easy to play another game. In XP, the initial list of stories may change over the life of the project. Some stories may not be implemented at all and new stories may be added. Developers will need further communications with the clients to specify details about stories and to determine if the stories have been implemented correctly. 3. Getting Started XP uses minimal up front planning. Even so, before diving into the code there is group discussion about what is to be accomplished. To get everyone on the same page, a metaphor is often used. Here we might say that this Tic-Tac-Toe game application should be a very straight-forward adaptation of the paper version. Early discussions most often involve the user and might use techniques such as paper prototyping to make more clear what the customer envisions. Software developers may even make some informal sketches of class diagrams and other forms of UML diagrams. The customer decides which stories are most important. Developers give feedback about the estimated effort required to implement each story. O X X O A sketch showing the major interface component. A board which allows the user to enter moves by clicking on a position. Our brainstorming might also surmise that we need to keep track of whose turn it is and what markers are placed on the board. Perhaps we could use an array to store the board. Figure 1: Early brainstorming and sketch of application s proposed user interface (GUI). javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

2 4. Readying the basic classes - focus on the Model Sometimes it is hard to think about the basic objects when all you can imagine is the sketch of the GUI. However, it is commonly recognized, that the GUI and the underlying functionality are most often better implemented as separate but cooperating objects. The underlying functionality (often referred to as the model) is independent of the particular GUI used to represent and manipulate it. This follows the Model- View-Controller paradigm (see Figure 2). We can develop the model separate from the interface. This better allows porting to different window systems, development of GUI s by trained GUI designers, better use of specialized hardware, etc. There are 2 immediate advantages for us: 1. Development can proceed without needing to know GUI programming; 2. Unit tests are much more easily automated if you don t need to worry about the GUI. Thus we focus first on the model component. This object should be able to store and represent the required state information. For instance, whose turn is it?, what is already on the board?. The model hides its internal data structures but should have methods that allow the view and the controller to communicate user manipulation requests and to respond to queries. The model class for our example is TTTGame. GUI Q. What is on the board so far? View attributes methods Model Underlying, application object, business logic, data, etc. TTTGame playertomove: keeps track of which player s turn it is... getwhoseturn(): returns the player whose turn it is.... Now we can begin to write tests which confirm the behavior of the model. The tests are to be written in Java using JUnit. In effect, the tests will stand in for the View and Controller objects.writing the tests within the Eclipse environment will demonstrate some of the features of that environment. We use Ant to help automate and manage development tasks. As our projects get larger automation becomes more important; getting these scripts to work properly might be an element of risk so we try to tackle it early. 5. Setting up a new Java project in Eclipse A. board positions with markers User wants to place another marker on board. Presents the model to the user. Controller Processes user requests to manipulate/query the model. Supplies view(s) with information from the model. Figure 2: The MVC separates the model from the way it is presented and manipulated by the user. Left, representative methods from the class which represents the model for the example TTTGame application. 1. Decide where you want to place your Java projects. Eclipse uses the idea of a workspace directory to store projects in. You can make Eclipse start up using your preferred workspace. If you are working in the lab and make use of a networked drive your work will be available to you no matter what machine you are on. 2. Create a new Java project (File --> New --> Project --> Java Project). Let Eclipse make a project directory for you in your workspace (See Figure 3). Pick a name that will be easy for you to recognize (tttproj). javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

3 Don t worry about the other options in this dialog since we will be using an Ant build script to control the compile and run procedures. Figure 3: Eclipse 3.0, New Java Project dialog. Define project name and hit Finish. Within your project directory it is good practice to group different types of files into different directories. In particular it is generally a good idea to keep your source code separate from the compiled code. Java also uses a close correspondence between java packages and directories. It makes life much easier to set up these directories carefully early on so they work well with the build script. Add a new source folder to your project called src (for source code files). Add a package (tttex) to the src folder. See Figure 4. Figure 4: Highlighting the src directory and popping up the right menu is an easy way to create a New Package within the src directory. javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

4 3. Since we are getting used to Xp practices, we will start with Test First Development (TFD) How do we express a test for code that doesn t exist? Think about how we would want to use the system if it did exist and how could we tell if it was working correctly. Start simply. For instance, when the application starts, the model should be initialized to some well defined start state. The view will need to query the model for its state information so it can be visually represented accurately on the display. An easy place to start might be that the model should be initialized so it is player X s turn. Rather than coding the model first, we code a test assuming the model does what we want. These tests can be placed into a separate class. They use assert calls so that they can automatically verify correctness. Such a test might look like what is shown in Figure 5. The JUnit framework provides various assert methods to compare results to what is expected. The framework automatically calls methods which start with the word test. package tttex; import junit.framework.testcase; public class TTTGameTester extends TestCase { public void testfirstturn() { int whoseturn; TTTGame game = new TTTGame(); whoseturn = game.getwhoseturn(); assertequals("initial player turn", TTTGame.PLAYER_X, whoseturn); Figure 5: A test to see if the game correctly starts with the turn belonging to player X Position the cursor over the lightbulb to see possible solutions Figure 6: Eclipse feedback to show error lines and possible solutions. Create a new java class named TTTGameTester in the tttex package (select the package and use the right button pop-up menu: New --> Class). Replace the contents of the file by Copy/Pasting from Figure 5. Eclipse will scan the code and indicate lines which may contain errors (red x boxes). Lightbulbs show that Eclipse has some possible suggestions for fixes. See Figure 6. If you hold the cursor down over the top lightbulb (a suggestion fo r the problem with the import statement) suggestions will pop-up. Select the one which adds the JUnit library to this project (the last choice). The package view on the right will show another library (junit.jar) added to your project and the source code will have only 2 problem lines left. These problems are because the class TTTGame does not exist. javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

5 4. To get the test to compile, let s create the TTTGame class. The goal is to keep it simple and to get it compile with a minimal amount of work. Create the TTTGame class shown in Figure 7. package tttex; public class TTTGame { public static final int PLAYER_X = 2; public int getwhoseturn() { return 0; Figure 7: A simple TTTGame class so that we can compile the test code. 5. To actually compile and run the test, we need to add in our build file for Ant. A generic starting file for this purpose is given in Figure 8 This is not Java it is an XML build file for Ant. Store it at the top level of your project directory and name it build.xml.(new --> File, create as a simple file) <?xml version="1.0" encoding="utf-8"?> <!-- build.xml, for Ant to manage Java projects, cs435, Wainer --> <project basedir="." default="compile"> <property file="local.properties"/> <property name="build.dir" value="build"/> <property name="src.dir" value="src"/> <property name="dist.dir" value="dist"/> <target name="init" description="creates temporary directories" > <mkdir dir="${build.dir/classes"/> <mkdir dir="${dist.dir"/> <target name="clean" depends="init" description="removes temporary directories" > <delete dir="${build.dir"/> <delete dir="${dist.dir" failonerror="false"/> <delete file="start.jar"/> <target name="compile" depends="init" > <javac debug="true" deprecation="true" destdir="${build.dir/classes" srcdir="${src.dir" verbose="true"> <classpath> <!-- gives location of junit framework objects to java compiler --> <pathelement location="${junit_home/junit.jar"/> </classpath> </javac> Figure 8: A generic starting file for Ant. Save as build.xml. (listing continues) javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

6 <target name="testmodel" depends="compile" description="execute Unit Tests" > <java classname="junit.swingui.testrunner" failonerror="true" fork="true"> <arg value="pack.modeltester"/> <classpath> <pathelement location="${junit_home/junit.jar"/> <pathelement location="${build.dir/classes"/> </classpath> </java> <target name="run" depends="compile" description="run the Application" > <java classname="pack.someapp" failonerror="true" fork="true"> <classpath> <pathelement location="${build.dir/classes"/> <pathelement location="${build.dir/.."/> </classpath> </java> <target name="archive" depends="compile" description="creates a distribution jar file" > <jar casesensitive="false" destfile="${dist.dir/some.jar"> <fileset dir="${build.dir/classes"> <include name="**/*.class"/> <exclude name="**/*tester.class"/> </fileset> <fileset dir="."> <include name="images/*"/> <include name="sounds/*"/> </fileset> <manifest> <attribute name="main-class" value="pack.someapp"/> </manifest> </jar> <target name="runjar" depends="archive" description="run the jarred Application" > <java failonerror="true" fork="true" jar="dist/some.jar"/> </project> Figure 8(continued): A generic starting file for Ant. See text for instructions. After the file has been saved you should see it (with an ant icon ) in the package editor. Right menu it and open it with the Ant editor. If the code pasted over a little ugly, you might want to move the cursor to the editor, get the pop-up menu and select the format option to clean things up. The file given in Figure 8 still needs to be customized for your project. Using the editor menu s Find/Replace options (use the javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

7 case sensitive option), change PACK to tttex, and SOME and MODEL to TTTGame. Save your file. Note the outline view at the right shows the various Ant targets in your file (init, clean, testmodel...). 6. Run the test by selecting the testmodel task in the Ant Outline view and getting the right button menu. Select Run --> Ant Build (the first option without the...). If you haven t saved source files you ll be given a chance to do so. The instructions in the build file will be executed by Ant. The build file contains dependency information so it knows, for instance, that before running the test, the code should be compiled. As the script is executed, information is sent to the Eclipse console. In this case, you will see that the compile could not succeed because of 3 errors. These errors are due to the compiler not being able to find the JUnit framework. The build script is giving specifics about how to compile your code: where the source and libraries are, where to store the byte code etc. Since you (or possibly your team-mates) may be running this code on different machines, some things such as library locations may change. To allow for easy customization, a file called local properties should be created within your project directory. It defines a script variable, junit_home, which gives the location of the JUnit directory on your machine. No matter what platform you are using, subdirectories along this path should be separated by forward slashes. You can find this information very easily by clicking on the JUNIT_HOME icon for your project shown in the Package window. An example is given in Figure 9. (Note, all slashes are forward slashes even on Windows). #define junit_home as the directory where junit is on your system junit_home=d:/eclipse/plugins/org.junit_3.8.1 Figure 9: An example of a local.properties file. It defines the directory holding the JUnit jar. After you have created and saved your local.properties file, try running the testmodel task again. It should run (it might take a while to start up) and display graphical feedback for your JUnit test. The red bar indicates at least one test did not pass. Figure 10: Red bar feedback from JUnit tests shows at least one test failed to pass. javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

8 7. It is good practice to have the test fail initially. Fixing it then gives a greater confidence not only in the feature itself but also in the test. Here the test failed because the method getwhoseturn() returns the number 0 instead of the value for PLAYER_X. A simple correction should fix the problem. Make it return PLAYER_X. Later we know this will have to be more complex (it won t always be player X s turn) but for now this is the simplest thing that will work. Make the change and run the test again. You should get the green bar feedback indicating that all your tests have passed. 6. Building up your code incrementally using TFD At this point you have a start. What should the next mini-goal be? How about making sure that the board itself is initialized properly. Here you might do some brainstorming about what sort of information the board might contain and what sort of interface you will provide to access it. One choice might be to represent what is on the board with integer constants and to represent the board with an integer array. We can make a call to the model and it can pass back a copy of the integer array representing the current contents of the board. The first thing to code is another test. Add the following new method to the TTTGameTester class. (Figure 11) public void testinitboard() { int[] theboard; TTTGame game = new TTTGame(); theboard = game.getboard(); boolean allclear = true; for (int i =0; i<9; i++) { if (theboard[i]!= TTTGame.EMPTY) { allclear = false; break; asserttrue("board should be empty",allclear); Figure 11: A new test to confirm the board is initialized correctly. The IDE (or the compiler if you try it) flag errors because getboard() and TTTGame.EMPTY are not defined. That tells us what we need to work on in the TTTGame class. See the code in Figure 12. package tttex; public class TTTGame { public static final int PLAYER_X = 2; public static final int EMPTY = 0; public int getwhoseturn() { return PLAYER_X; public int[] getboard() { return new int[9]; Figure 12: TTTGame class is updated to include EMPTY and getboard(). javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

9 Update the TTTGame class and try to run the tests. You might be surprised to see that the tests actually pass. Obviously these functions are still too simple right? If they need to be more complicated then write a test that fails with the software s current version. Add just enough complexity to make the tests pass. Exercises: a. Write a test to see if a marker can be placed on the board at a desired location. (What design issues come up? Should you be able to place a marker anywhere?) b. Write a test to see if the player s turn is updated once a move is made. Your tests should be clearly named and developed one at a time. Running the tests should give the green bar show of success. The TTTGame class should only be made as complicated as needed to pass the tests. As you continue working, you should fix any previous tests that break. If older tests no longer make sense or need to be modified, then change them. Use descriptive test names and meaningful assert comment strings. Think ahead to how the GUI (view/controller) will interact with the model. The view will have to ask the model everything necessary to be able to visualize it. The controller will have to be able to forward user requests to the model. The JUnit tests should call the same model methods that the GUI will need to call. c. Suggest 2 more tests that are needed to develop/test the logic of the model. If you can t think of anymore for the first 3 stories, also consider the 4th story. PROBLEMS/NOTES: Ant Build can t find compiler (javac) - an error experienced when trying to compile code using an Ant script from within Eclipse sometimes occurs on Windows XP. Ant cannot find where the compiler is. A solution is to go to Eclipse s Window Menu. Select Preferences -> Ant -> Runtime. Pick the Classpath tab and access the Global properties. From here, Add External Jars. You ll want to find and select the tool.jar underneath the Java jdk lib directory. That should solve the problem. (In the 2102 lab check under D:\Program Files\Java\jdk1.5.0\lib) An error (Virtual Machine not found) may occur when trying to run Ant scripts. Go to the Run Menu, select External Tools and then the External Tools... option. Highlight the build.xml file. Select the JRE tab. Make the JRE separate and select an installed jdk. Next Topic: Visualizing the Game - Starting on the Graphical User Interface Considering the time available and the customer s priorities, our first iteration will only focus on stories 1 through 3. While the game logic should remain in the TTTGame class, we ll also need to get development going for the interface. Some of this development would naturally proceed in parallel in a larger group. javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

10 Eclipse 3.0 IDE showing Java perspective and JUnit GUI test runner in foreground. javaxpgetstarted1.s05, prepared by Michael Wainer, Spring

Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit

Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit 1. Introduction These tools are all available free over the internet as is Java itself. A brief description of each follows.

More information

Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit

Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit 1. Introduction These tools are all available free over the internet as is Java itself. A brief description of each follows.

More information

Prototyping a Swing Interface with the Netbeans IDE GUI Editor

Prototyping a Swing Interface with the Netbeans IDE GUI Editor Prototyping a Swing Interface with the Netbeans IDE GUI Editor Netbeans provides an environment for creating Java applications including a module for GUI design. Here we assume that we have some existing

More information

Software Building (Sestavování aplikací)

Software Building (Sestavování aplikací) Software Building (Sestavování aplikací) http://d3s.mff.cuni.cz Pavel Parízek parizek@d3s.mff.cuni.cz CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics What is software building Transforming

More information

Software Development. COMP220/COMP285 Seb Coope Ant: Structured Build

Software Development. COMP220/COMP285 Seb Coope Ant: Structured Build Software Development COMP220/COMP285 Seb Coope Ant: Structured Build These slides are mainly based on Java Development with Ant - E. Hatcher & S.Loughran. Manning Publications, 2003 Imposing Structure

More information

CS201 - Assignment 3, Part 2 Due: Wednesday March 5, at the beginning of class

CS201 - Assignment 3, Part 2 Due: Wednesday March 5, at the beginning of class CS201 - Assignment 3, Part 2 Due: Wednesday March 5, at the beginning of class For this assignment we will be developing a text-based Tic Tac Toe game 1. The key to this assignment is that we re going

More information

Ant. Originally ANT = Another Neat Tool. Created by James Duncan Davidson Now an Apache open-source project

Ant. Originally ANT = Another Neat Tool. Created by James Duncan Davidson Now an Apache open-source project Ant Originally ANT = Another Neat Tool Created by James Duncan Davidson Now an Apache open-source project Ants are amazing insects Can carry 50 times their own weight Find the shortest distance around

More information

An Introduction to Ant

An Introduction to Ant An Introduction to Ant Overview What is Ant? Installing Ant Anatomy of a build file Projects Properties Targets Tasks Example build file Running a build file What is Ant? Ant is a Java based tool for automating

More information

Getting Started with the Cisco Multicast Manager SDK

Getting Started with the Cisco Multicast Manager SDK CHAPTER 1 Getting Started with the Cisco Multicast Manager SDK Cisco Multicast Manager (CMM) 3.2 provides a Web Services Definition Language (WSDL)-based Application Programming Interface (API) that allows

More information

Eclipse Environment Setup

Eclipse Environment Setup Eclipse Environment Setup Adapted from a document from Jeffrey Miller and the CS201 team by Shiyuan Sheng. Introduction This lab document will go over the steps to install and set up Eclipse, which is

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

Carrera: Analista de Sistemas/Licenciatura en Sistemas. Asignatura: Programación Orientada a Objetos

Carrera: Analista de Sistemas/Licenciatura en Sistemas. Asignatura: Programación Orientada a Objetos Carrera: / Asignatura: Programación Orientada a Objetos REFACTORING EXERCISE WITH ECLIPSE - 2008- Observation: This refactoring exercise was extracted of the web site indicated in the section Reference

More information

Creating a new CDC policy using the Database Administration Console

Creating a new CDC policy using the Database Administration Console Creating a new CDC policy using the Database Administration Console When you start Progress Developer Studio for OpenEdge for the first time, you need to specify a workspace location. A workspace is a

More information

GWT in Action by Robert Hanson and Adam Tacy

GWT in Action by Robert Hanson and Adam Tacy SAMPLE CHAPTER GWT in Action by Robert Hanson and Adam Tacy Chapter 2 Copyright 2007 Manning Publications brief contents PART 1 GETTING STARTED...1 1 Introducing GWT 3 2 Creating the default application

More information

Running Java Programs

Running Java Programs Running Java Programs Written by: Keith Fenske, http://www.psc-consulting.ca/fenske/ First version: Thursday, 10 January 2008 Document revised: Saturday, 13 February 2010 Copyright 2008, 2010 by Keith

More information

6.170 Laboratory in Software Engineering Eclipse Reference for 6.170

6.170 Laboratory in Software Engineering Eclipse Reference for 6.170 6.170 Laboratory in Software Engineering Eclipse Reference for 6.170 Contents: CVS in Eclipse o Setting up CVS in Your Environment o Checkout the Problem Set from CVS o How Do I Add a File to CVS? o Committing

More information

Introduction to Eclipse

Introduction to Eclipse Introduction to Eclipse Ed Gehringer Using (with permission) slides developed by Dwight Deugo (dwight@espirity.com) Nesa Matic (nesa@espirity.com( nesa@espirity.com) Sreekanth Konireddygari (IBM Corp.)

More information

1. Go to the URL Click on JDK download option

1. Go to the URL   Click on JDK download option Download and installation of java 1. Go to the URL http://www.oracle.com/technetwork/java/javase/downloads/index.html Click on JDK download option 2. Select the java as per your system type (32 bit/ 64

More information

Lecture (01) Getting started. Dr. Ahmed ElShafee

Lecture (01) Getting started. Dr. Ahmed ElShafee Lecture (01) Getting started Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, fundamentals of Programming I, Agenda Download and Installation Java How things work NetBeans Comments Structure of the program Writing

More information

Lukáš Asník. Software Development & Monitoring Tools (NSWI126)

Lukáš Asník. Software Development & Monitoring Tools (NSWI126) Lukáš Asník Software Development & Monitoring Tools (NSWI126) Contents tasks , , conditionally processed targets attributes if and unless properties in external files dependencies

More information

State Application Using MVC

State Application Using MVC State Application Using MVC 1. Getting ed: Stories and GUI Sketch This example illustrates how applications can be thought of as passing through different states. The code given shows a very useful way

More information

ICOM 4015 Advanced Programming Laboratory. Chapter 1 Introduction to Eclipse, Java and JUnit

ICOM 4015 Advanced Programming Laboratory. Chapter 1 Introduction to Eclipse, Java and JUnit ICOM 4015 Advanced Programming Laboratory Chapter 1 Introduction to Eclipse, Java and JUnit University of Puerto Rico Electrical and Computer Engineering Department by Juan E. Surís 1 Introduction This

More information

CMPSCI 187 / Spring 2015 Hangman

CMPSCI 187 / Spring 2015 Hangman CMPSCI 187 / Spring 2015 Hangman Due on February 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015 Hangman Contents Overview

More information

Storing and Managing Code with CVS

Storing and Managing Code with CVS Storing and Managing Code with CVS One of the most important things you do, as a software developer, is version source code and other project files. What does it mean to version a file? According to Merriam

More information

Javac and Eclipse tutorial

Javac and Eclipse tutorial Javac and Eclipse tutorial Author: Balázs Simon, BME IIT, 2013. Contents 1 Introduction... 2 2 JRE and JDK... 2 3 Java and Javac... 2 4 Environment variables... 3 4.1 Setting the environment variables

More information

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below. CS520 Setting Up the Programming Environment for Windows Suresh Kalathur 1. Java8 SDK Java8 SDK (Windows Users) For Windows users, download the Java8 SDK as shown below. The Java Development Kit (JDK)

More information

Introduction to Extreme Programming. Extreme Programming is... Benefits. References: William Wake, Capital One Steve Metsker, Capital One Kent Beck

Introduction to Extreme Programming. Extreme Programming is... Benefits. References: William Wake, Capital One Steve Metsker, Capital One Kent Beck Introduction to Extreme Programming References: William Wake, Capital One Steve Metsker, Capital One Kent Beck Extreme Programming is... Lightweight software development method used for small to medium-sized

More information

Embedding Graphics in JavaDocs (netbeans IDE)

Embedding Graphics in JavaDocs (netbeans IDE) Embedding Graphics in JavaDocs (netbeans IDE) This note describes how to embed HTML-style graphics within your JavaDocs, if you are using Netbeans. Additionally, I provide a few hints for package level

More information

Eclipse Setup. Opening Eclipse. Setting Up Eclipse for CS15

Eclipse Setup. Opening Eclipse. Setting Up Eclipse for CS15 Opening Eclipse Eclipse Setup Type eclipse.photon & into your terminal. (Don t open eclipse through a GUI - it may open a different version.) You will be asked where you want your workspace directory by

More information

Creating Flex Applications with IntelliJ IDEA

Creating Flex Applications with IntelliJ IDEA Creating Flex Applications with IntelliJ IDEA In this tutorial you will: 1. Create an IntelliJ IDEA project with Flex-enabled module 2. Create Ant build configuration to compile and run Flex application

More information

CSE 403 Lecture 11. Static Code Analysis. Reading: IEEE Xplore, "Using Static Analysis to Find Bugs"

CSE 403 Lecture 11. Static Code Analysis. Reading: IEEE Xplore, Using Static Analysis to Find Bugs CSE 403 Lecture 11 Static Code Analysis Reading: IEEE Xplore, "Using Static Analysis to Find Bugs" slides created by Marty Stepp http://www.cs.washington.edu/403/ FindBugs FindBugs: Java static analysis

More information

Introduction to Extreme Programming

Introduction to Extreme Programming Introduction to Extreme Programming References: William Wake, Capital One Steve Metsker, Capital One Kent Beck Robert Martin, Object Mentor Ron Jeffries,et.al. 12/3/2003 Slide Content by Wake/Metsker 1

More information

You should now start on Chapter 4. Chapter 4 introduces the following concepts

You should now start on Chapter 4. Chapter 4 introduces the following concepts Summary By this stage, you have met the following principles : the relationship between classes and objects that a class represents our understanding of something weʼre interested in, in a special and

More information

1.00 Lecture 2. What s an IDE?

1.00 Lecture 2. What s an IDE? 1.00 Lecture 2 Interactive Development Environment: Eclipse Reading for next time: Big Java: sections 3.1-3.9 (Pretend the method is main() in each example) What s an IDE? An integrated development environment

More information

Continuous Integration (CI) with Jenkins

Continuous Integration (CI) with Jenkins TDDC88 Lab 5 Continuous Integration (CI) with Jenkins This lab will give you some handson experience in using continuous integration tools to automate the integration periodically and/or when members of

More information

COMP220/285 Lab sessions 1-3

COMP220/285 Lab sessions 1-3 COMP220/285 Lab sessions 1-3 Contents General Notes... 2 Getting started... 2 Task 1 Checking your ANT install... 2 Task 2 Checking your JUnit install... 2 Task 3 JUnit documention review... 4 Task 4 Ant

More information

Unit Tests. Unit Testing. What to Do in Unit Testing? Who Does it? 4 tests (test types) You! as a programmer

Unit Tests. Unit Testing. What to Do in Unit Testing? Who Does it? 4 tests (test types) You! as a programmer Unit Tests Unit Testing Verify that each program unit works as it is intended and expected along with the system specification. Units to be tested: classes (methods in each class) in OOPLs User requirements

More information

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

2 Getting Started. Getting Started (v1.8.6) 3/5/2007 2 Getting Started Java will be used in the examples in this section; however, the information applies to all supported languages for which you have installed a compiler (e.g., Ada, C, C++, Java) unless

More information

Lesson 10: Quiz #1 and Getting User Input (W03D2)

Lesson 10: Quiz #1 and Getting User Input (W03D2) Lesson 10: Quiz #1 and Getting User Input (W03D2) Balboa High School Michael Ferraro September 1, 2015 1 / 13 Do Now: Prep GitHub Repo for PS #1 You ll need to submit the 5.2 solution on the paper form

More information

Gant as Ant and Maven Replacement

Gant as Ant and Maven Replacement Gant as Ant and Maven Replacement Dr Russel Winder Concertant LLP russel.winder@concertant.com russel@russel.org.uk Groovy and Grails User Group 2007 Russel Winder 1 Aims and Objectives Convince people

More information

Module Road Map. 7. Version Control with Subversion Introduction Terminology

Module Road Map. 7. Version Control with Subversion Introduction Terminology Module Road Map 1. Overview 2. Installing and Running 3. Building and Running Java Classes 4. Refactoring 5. Debugging 6. Testing with JUnit 7. Version Control with Subversion Introduction Terminology

More information

Introduction to Computation and Problem Solving

Introduction to Computation and Problem Solving Class 3: The Eclipse IDE Introduction to Computation and Problem Solving Prof. Steven R. Lerman and Dr. V. Judson Harward What is an IDE? An integrated development environment (IDE) is an environment in

More information

Packaging Your Program into a Distributable JAR File

Packaging Your Program into a Distributable JAR File Colin Kincaid Handout #5 CS 106A August 8, 2018 Packaging Your Program into a Distributable JAR File Based on a handout by Eric Roberts and Brandon Burr Now that you ve written all these wonderful programs,

More information

Java Program Structure and Eclipse. Overview. Eclipse Projects and Project Structure. COMP 210: Object-Oriented Programming Lecture Notes 1

Java Program Structure and Eclipse. Overview. Eclipse Projects and Project Structure. COMP 210: Object-Oriented Programming Lecture Notes 1 COMP 210: Object-Oriented Programming Lecture Notes 1 Java Program Structure and Eclipse Robert Utterback In these notes we talk about the basic structure of Java-based OOP programs and how to setup and

More information

Kevin Lee IBM Rational Software SCM23

Kevin Lee IBM Rational Software SCM23 Accelerating and Automating the Build Process with IBM Rational ClearCase and Ant Kevin Lee IBM Rational Software kevin.lee@uk.ibm.com Agenda Overview of Ant What is Ant The Ant build file Typical Ant

More information

Javadocing in Netbeans (rev )

Javadocing in Netbeans (rev ) Javadocing in Netbeans (rev. 2011-05-20) This note describes how to embed HTML-style graphics within your Javadocs, if you are using Netbeans. Additionally, I provide a few hints for package level and

More information

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics Eclipse JVM, main method and using Eclipse Produced by: Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list Files in Java. Java Virtual Machine. main method. Eclipse

More information

JDO Tools Guide (v5.1)

JDO Tools Guide (v5.1) JDO Tools Guide (v5.1) Table of Contents Maven Plugin.............................................................................. 2 pom.xml Integration.......................................................................

More information

Practical Java. Using ant, JUnit and log4j. LearningPatterns, Inc. Collaborative Education Services

Practical Java. Using ant, JUnit and log4j. LearningPatterns, Inc.  Collaborative Education Services Using ant, JUnit and log4j LearningPatterns, Inc. www.learningpatterns.com Collaborative Education Services Training Mentoring Courseware Consulting Student Guide This material is copyrighted by LearningPatterns

More information

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software. Introduction to Netbeans This document is a brief introduction to writing and compiling a program using the NetBeans Integrated Development Environment (IDE). An IDE is a program that automates and makes

More information

Prerequisites for Eclipse

Prerequisites for Eclipse Prerequisites for Eclipse 1 To use Eclipse you must have an installed version of the Java Runtime Environment (JRE). The latest version is available from java.com/en/download/manual.jsp Since Eclipse includes

More information

COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE. Instructor: Prasun Dewan (FB 150,

COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE. Instructor: Prasun Dewan (FB 150, COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE Instructor: Prasun Dewan (FB 150, dewan@unc.edu) SCOPE: BASICS AND BEYOND Basic use: CS 1 Beyond basic use: CS2 2 DOWNLOAD FROM WWW.ECLIPSE.ORG Get the

More information

Restructuring AZDBLab

Restructuring AZDBLab Restructuring AZDBLab The Science of Databases 2/20/2010 Version 5.0 Adam Robertson I hereby grant to the University of Arizona Library the nonexclusive worldwide right to reproduce and distribute my dissertation

More information

CHAPTER 1INTRODUCTION... 3 CHAPTER 2INSTALLING ECLIPSE...

CHAPTER 1INTRODUCTION... 3 CHAPTER 2INSTALLING ECLIPSE... Table of Contents CHAPTER 1INTRODUCTION... 3 CHAPTER 2INSTALLING ECLIPSE... 4 2.1ABOUT JAVA... 4 2.2DIFFERENT EDITIONS OF JAVA... 5 CHAPTER 3DOWNLOADING AND INSTALLING JAVA... 6 CHAPTER 4INSTALLING THE

More information

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to:

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to: Get JAVA To compile programs you need the JDK (Java Development Kit). To RUN programs you need the JRE (Java Runtime Environment). This download will get BOTH of them, so that you will be able to both

More information

There are several files including the start of a unit test and the method stubs in MindNumber.java. Here is a preview of what you will do:

There are several files including the start of a unit test and the method stubs in MindNumber.java. Here is a preview of what you will do: Project MindNumber Collaboration: Solo. Complete this project by yourself with optional help from section leaders. Do not work with anyone else, do not copy any code directly, do not copy code indirectly

More information

TEST DRIVEN DEVELOPMENT

TEST DRIVEN DEVELOPMENT PERSONAL SOFTWARE ENGINEERING PROJECT: TEST DRIVEN DEVELOPMENT Kirsi Männistö kirsi.mannisto@welho.com 60114V PSEA_Test_driven_development.rtf Page 1 of 1 RoadRunners Change history Version Description

More information

CMPSCI 187 / Spring 2015 Hanoi

CMPSCI 187 / Spring 2015 Hanoi Due on Thursday, March 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 Contents Overview 3 Learning Goals.................................................

More information

i2b2 Workbench Developer s Guide: Eclipse Neon & i2b2 Source Code

i2b2 Workbench Developer s Guide: Eclipse Neon & i2b2 Source Code i2b2 Workbench Developer s Guide: Eclipse Neon & i2b2 Source Code About this guide Informatics for Integrating Biology and the Bedside (i2b2) began as one of the sponsored initiatives of the NIH Roadmap

More information

Package Management and Build Tools

Package Management and Build Tools Package Management and Build Tools Objektumorientált szoftvertervezés Object-oriented software design Dr. Balázs Simon BME, IIT Outline Ant+Ivy (Apache) Maven (Apache) Gradle Bazel (Google) Buck (Facebook)

More information

- 1 - Handout #33 March 14, 2014 JAR Files. CS106A Winter

- 1 - Handout #33 March 14, 2014 JAR Files. CS106A Winter CS106A Winter 2013-2014 Handout #33 March 14, 2014 JAR Files Handout by Eric Roberts, Mehran Sahami, and Brandon Burr Now that you ve written all these wonderful programs, wouldn t it be great if you could

More information

CS 201 Software Development Methods Spring Tutorial #1. Eclipse

CS 201 Software Development Methods Spring Tutorial #1. Eclipse CS 201 Software Development Methods Spring 2005 Tutorial #1 Eclipse Written by Matthew Spear and Joseph Calandrino Edited by Christopher Milner and Benjamin Taitelbaum ECLIPSE 3.0 DEVELOPING A SIMPLE PROGRAM

More information

Life Without NetBeans

Life Without NetBeans Life Without NetBeans Part A Writing, Compiling, and Running Java Programs Almost every computer and device has a Java Runtime Environment (JRE) installed by default. This is the software that creates

More information

Web-enable a 5250 application with the IBM WebFacing Tool

Web-enable a 5250 application with the IBM WebFacing Tool Web-enable a 5250 application with the IBM WebFacing Tool ii Web-enable a 5250 application with the IBM WebFacing Tool Contents Web-enable a 5250 application using the IBM WebFacing Tool......... 1 Introduction..............1

More information

JPA Tools Guide (v5.0)

JPA Tools Guide (v5.0) JPA Tools Guide (v5.0) Table of Contents Maven Plugin.............................................................................. 2 pom.xml Integration.......................................................................

More information

Extending The QiQu Script Language

Extending The QiQu Script Language Extending The QiQu Script Language Table of Contents Setting up an Eclipse-Javaproject to extend QiQu...1 Write your first QiQu Command...2 getcommandname...2 getdescription...2 getcommandgroup...2 isusingsubcommand...3

More information

Tic-Tac-Toe. By the time you are done with this activity, you and your team should be able to:

Tic-Tac-Toe. By the time you are done with this activity, you and your team should be able to: Tic-Tac-Toe Team Name: Manager: Recorder: Presenter: Analyst: This is a Process Oriented Guided Inquiry Learning (POGIL) activity. You and your team will examine a working program. A series of questions

More information

Assignment 1. Application Development

Assignment 1. Application Development Application Development Assignment 1 Content Application Development Day 1 Lecture The lecture provides an introduction to programming, the concept of classes and objects in Java and the Eclipse development

More information

An Integrated Approach to Managing Windchill Customizations. Todd Baltes Lead PLM Technical Architect SRAM

An Integrated Approach to Managing Windchill Customizations. Todd Baltes Lead PLM Technical Architect SRAM An Integrated Approach to Managing Windchill Customizations Todd Baltes Lead PLM Technical Architect SRAM Event hashtag is #PTCUSER10 Join the conversation! Topics What is an Integrated Approach to Windchill

More information

1. The Apache Derby database

1. The Apache Derby database 1. The Apache Derby database In these instructions the directory jdk_1.8.0_112 is named after the version 'number' of the distribution. Oracle tend to issue many new versions of the JDK/ JRE each year.

More information

CSCI 201 Lab 1 Environment Setup

CSCI 201 Lab 1 Environment Setup CSCI 201 Lab 1 Environment Setup "The journey of a thousand miles begins with one step." - Lao Tzu Introduction This lab document will go over the steps to install and set up Eclipse, which is a Java integrated

More information

S8352: Java From the Very Beginning Part I - Exercises

S8352: Java From the Very Beginning Part I - Exercises S8352: Java From the Very Beginning Part I - Exercises Ex. 1 Hello World This lab uses the Eclipse development environment which provides all of the tools necessary to build, compile and run Java applications.

More information

Getting Started (1.8.7) 9/2/2009

Getting Started (1.8.7) 9/2/2009 2 Getting Started For the examples in this section, Microsoft Windows and Java will be used. However, much of the information applies to other operating systems and supported languages for which you have

More information

Getting Started with Eclipse/Java

Getting Started with Eclipse/Java Getting Started with Eclipse/Java Overview The Java programming language is based on the Java Virtual Machine. This is a piece of software that Java source code is run through to produce executables. The

More information

Software Installation for CS121

Software Installation for CS121 Software Installation for CS121 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University August 26, 2005 1 Installation of Java J2SE 5 SDK 1. Visit Start Settings Control Panel

More information

Tuesday, November 15. Testing

Tuesday, November 15. Testing Tuesday, November 15 1 Testing Testing Waterfall model show testing as an activity or box In practice, testing is performed constantly There has never been a project where there was too much testing. Products

More information

What s NetBeans? Like Eclipse:

What s NetBeans? Like Eclipse: What s NetBeans? Like Eclipse: It is a free software / open source platform-independent software framework for delivering what the project calls "richclient applications" It is an Integrated Development

More information

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008 MEDIA COMPUTATION DRJAVA Lecture 11.3 November 7, 2008 LEARNING GOALS Understand at practical level Where to get DrJava How to start DrJava Dr Java features How to add items to the classpath for DrJava

More information

CHAPTER 6. Java Project Configuration

CHAPTER 6. Java Project Configuration CHAPTER 6 Java Project Configuration Eclipse includes features such as Content Assist and code templates that enhance rapid development and others that accelerate your navigation and learning of unfamiliar

More information

Practical Objects: Test Driven Software Development using JUnit

Practical Objects: Test Driven Software Development using JUnit 1999 McBreen.Consulting Practical Objects Test Driven Software Development using JUnit Pete McBreen, McBreen.Consulting petemcbreen@acm.org Test Driven Software Development??? The Unified Process is Use

More information

The Intel VTune Performance Analyzer: Insights into Converting a GUI from Windows* to Eclipse*

The Intel VTune Performance Analyzer: Insights into Converting a GUI from Windows* to Eclipse* The Intel VTune Performance Analyzer: Insights into Converting a GUI from Windows* to Eclipse* Aaron Levinson Intel Corporation Copyright 2004, Intel Corporation. All rights reserved. Intel, VTune and

More information

EMC Documentum Composer

EMC Documentum Composer EMC Documentum Composer Version 6.0 SP1.5 User Guide P/N 300 005 253 A02 EMC Corporation Corporate Headquarters: Hopkinton, MA 01748 9103 1 508 435 1000 www.emc.com Copyright 2008 EMC Corporation. All

More information

CMPSCI 187 / Spring 2015 Sorting Kata

CMPSCI 187 / Spring 2015 Sorting Kata Due on Thursday, April 30, 8:30 a.m Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 Contents Overview 3 Learning Goals.................................................

More information

JAVA V Tools in JDK Java, winter semester ,2017 1

JAVA V Tools in JDK Java, winter semester ,2017 1 JAVA Tools in JDK 1 Tools javac javadoc jdb javah jconsole jshell... 2 JAVA javac 3 javac arguments -cp -encoding -g debugging info -g:none -target version of bytecode (6, 7, 8, 9) --release -source version

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

13 th Windsor Regional Secondary School Computer Programming Competition

13 th Windsor Regional Secondary School Computer Programming Competition SCHOOL OF COMPUTER SCIENCE 13 th Windsor Regional Secondary School Computer Programming Competition Hosted by The School of Computer Science, University of Windsor WORKSHOP I [ Overview of the Java/Eclipse

More information

Certified Core Java Developer VS-1036

Certified Core Java Developer VS-1036 VS-1036 1. LANGUAGE FUNDAMENTALS The Java language's programming paradigm is implementation and improvement of Object Oriented Programming (OOP) concepts. The Java language has its own rules, syntax, structure

More information

Index. Symbols. /**, symbol, 73 >> symbol, 21

Index. Symbols. /**, symbol, 73 >> symbol, 21 17_Carlson_Index_Ads.qxd 1/12/05 1:14 PM Page 281 Index Symbols /**, 73 @ symbol, 73 >> symbol, 21 A Add JARs option, 89 additem() method, 65 agile development, 14 team ownership, 225-226 Agile Manifesto,

More information

Development Practice and Quality Assurance. Version Control. The first thing you should be told when you start a new job - Steve Freeman

Development Practice and Quality Assurance. Version Control. The first thing you should be told when you start a new job - Steve Freeman 302 Development Practice and Quality Assurance In this section we will talk about and demonstrate technical practices that modern development teams commonly undertake in order to deliver software smoothly

More information

Adding Existing Source Code in NetBeans CS288, Autumn 2005 Lab 002

Adding Existing Source Code in NetBeans CS288, Autumn 2005 Lab 002 Adding Existing Source Code in NetBeans CS288, Autumn 2005 Lab 002 Purpose This document will show how to incorporate existing source code within a NetBeans project. It will also introduce the concept

More information

JUnit Howto. Blaine Simpson

JUnit Howto. Blaine Simpson JUnit Howto Blaine Simpson JUnit Howto Blaine Simpson Published $Date: 2005/09/18 23:40:47 $ Table of Contents 1. Introduction... 1 Available formats for this document... 1 Purpose... 1 Support... 2 What

More information

Lab #1: A Quick Introduction to the Eclipse IDE

Lab #1: A Quick Introduction to the Eclipse IDE Lab #1: A Quick Introduction to the Eclipse IDE Eclipse is an integrated development environment (IDE) for Java programming. Actually, it is capable of much more than just compiling Java programs but that

More information

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015 xtreme Programming (summary of Kent Beck s XP book) 1 Contents The software development problem The XP solution The JUnit testing framework 2 The Software Development Problem 3 Risk Examples delivery schedule

More information

This assignment requires that you complete the following tasks (in no particular order).

This assignment requires that you complete the following tasks (in no particular order). Construction Objectives The objectives of this assignment are: (1) Implement your FCS design with high-quality code and thorough unit tests (2) Gain experience doing a task breakdown (3) Gain experience

More information

CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class

CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class One of the keys to writing good code is testing your code. This assignment is going to introduce you and get you setup to

More information

Struts Tools Reference Guide. Version: beta1

Struts Tools Reference Guide. Version: beta1 Struts Tools Reference Guide Version: 3.0.0.beta1 1. Introduction... 1 1.1. Key Features of Struts Tools... 1 1.2. Other relevant resources on the topic... 2 2. Projects... 3 2.1. Creating a New Struts

More information

The Fénix Framework Detailed Tutorial

The Fénix Framework Detailed Tutorial Understanding the Fénix Framework in a couple of steps... for new FF users Lesson 1: Welcome to the Fénix Framework project Fénix Framework allows the development of Java- based applications that need

More information

Department of Computer Science University of Pretoria. Introduction to Computer Science COS 151

Department of Computer Science University of Pretoria. Introduction to Computer Science COS 151 Department of Computer Science University of Pretoria Introduction to Computer Science COS 151 Practical 1 16 February 2018 1 Plagiarism Policy The Department of Computer Science considers plagiarism as

More information

Project #1 Seam Carving

Project #1 Seam Carving Project #1 Seam Carving Out: Fri, Jan 19 In: 1 Installing, Handing In, Demos, and Location of Documentation 1. To install, type cs016 install seamcarve into a shell in the directory in which you want the

More information

NetBeans IDE Java Quick Start Tutorial

NetBeans IDE Java Quick Start Tutorial NetBeans IDE Java Quick Start Tutorial Welcome to NetBeans IDE! This tutorial provides a very simple and quick introduction to the NetBeans IDE workflow by walking you through the creation of a simple

More information