INF 111 / CSE 121 Discussion Session Week 2 - Fall 2007 Instructor: Michele Rousseau TA: Rosalva Gallardo.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse cs112b1 – Lab01 by Rui Shi.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
MAHDI OMAR JUNIT TUTORIAL. CONTENTS Installation of Junit Eclipse support for Junit Using Junit exercise JUnit options Questions Links and Literature.
T ESTING WITH J UNIT IN E CLIPSE Farzana Rahman. I NTRODUCTION The class that you will want to test is created first so that Eclipse will be able to find.
Java Integrated Development Environments: ECLIPSE Part1 Installation.
Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant.
20-Jun-15 Eclipse. Most slides from: 2 About IDEs An IDE is an Integrated Development Environment.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
Eclipse Introduction Dwight Deugo Nesa Matic
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 CSC/ECE 517 Fall 2010 Lec. 2 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Debugging 5.Testing.
Presentation Outline What is JUnit? Why Use JUnit? JUnit Features Design of JUnit Downloading JUnit Writing Tests – TestCase – TestSuite Organizing The.
George Blank University Lecturer. JUnit for Test Driven Development By Vivek Bhagat, George Blank.
INF 123: Software Architectures, Distributed Systems, and Interoperability Discussion Session Week 1 - Spring 2008 Instructor: Prof. Richard N. Taylor.
RIMS II Online Order and Delivery System Tutorial on Downloading and Viewing Multipliers.
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Getting started with Eclipse By Alexander Butyaev.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
Understanding Eclipse Development Environment Hen-I Yang July 7, 2006
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: Eclipse (Extract from Syllabus) Reference:
Introduction to Eclipse Plug-in Development. Who am I? Scott Kellicker Java, C++, JNI, Eclipse.
Workbench Overview Dwight Deugo Nesa Matic
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
INF 123: Software Architectures, Distributed Systems, and Interoperability Discussion Session Week 1 - Spring 2008 Instructor: Prof. Richard N. Taylor.
CSC 216/001 Lecture 4. Unit Testing  Why is it called “unit” testing?  When should tests be written?  Before the code for a class is written.  After.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
CS 614: Theory and Construction of Compilers Lecture 18 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored –Projects grouping of related works –Resources generic term to.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Eclipse 3.1 IDE Overview.
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Eclipse 24-Apr-17.
Eclipse and JUnit. Eclipse Terms The Workbench Perspective –Collection of editors and views –Exampes: Java Pers., Debugging Persp. Editors (create a file)
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
Tool Install How to download & install Java 6 & Eclipse updated version based on Dr. G. L. Ray’s slides.
Eclipse. An IDE is an Integrated Development Environment Different IDEs meet different needs BlueJ, DrJava are designed as teaching tools Emphasis is.
Surya Bahadur Kathayat Outline  Ramses  Installing Ramses  Ramses Perspective (Views and Editors)  Importing/Exporting Example.
1 CSC 216 Lecture 3. 2 Unit Testing  The most basic kind of testing is called unit testing  Why is it called “unit” testing?  When should tests be.
© 2002 IBM Corporation Transaction Processing Facility TPF Users Group Acapulco May 2004 © 2004 IBM Corporation Pete Nicholls IBM Toronto Lab TPF Toolkit.
® IBM Software Group © 2007 IBM Corporation Module 1: Getting Started with Rational Software Architect Essentials of Modeling with IBM Rational Software.
SharePoint 2010 Key Parts to Navigation Shared Document Library Add/Remove item from Quick Launch Using the Search Choose a Topic.
Test a Little, Code a Little Colin Sharples IBM Global Services New Zealand Colin Sharples IBM Global Services New Zealand.
Intoduction to Andriod studio Environment With a hello world program.
Software Design– Unit Testing SIMPLE PRIMER ON Junit Junit is a free simple library that is added to Eclipse to all automated unit tests. The first step,
Eclipse 27-Apr-17.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Java IDE Dwight Deugo Nesa Matic
Avon Community School Corporation. INTEGRADE PROPOWERTEACHER  Multi-step functions  Limited in features  Not web-based  Must export grades  Must.
Development Environment
Chapter 2: The Visual Studio .NET Development Environment
ATS Application Programming: Java Programming
COSC-4840 Software Engineering
Eclipse 20-Sep-18.
Overview of Eclipse Lectures
Debugging with Eclipse
Test-Driven Development
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
By Rajanikanth B Eclipse IDE Overview By Rajanikanth B
Test-Driven Development
JUnit Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from the Eclipse 3.0 and.
Debugging with Eclipse
Presentation transcript:

INF 111 / CSE 121 Discussion Session Week 2 - Fall 2007 Instructor: Michele Rousseau TA: Rosalva Gallardo

Overview Introduction Goals Contact Information Policies Card Game Tools Eclipse JUnit

Goals Discuss details about the assignments Present tools Prepare for tests Review tests and assignments

Contact Information Rosalva Gallardo Office: DBH 5051 Office hours: Monday 11am - 1pm Please me if you plan to drop by Comments about next discussion

Policies Discussion Attend 1 discussion session. Will not take attendance. Turn off your cell phone. Ask questions about assignments. Assignments No late assignments. Bring questions about the assignment to the discussion session. Please do not wait until the last minute to ask questions about the assignments.

Policies Questions , noteboard, office hours. If the TA considers that an s’ reply is beneficial for all the class, she will reply to all or post it in the Noteboard. An answer will be provided within 24 hours. Grading Always check your partial grades. If you have questions, please talk to the TA first, then with the instructor. Re-grade Double check before you bring it. Within 1 week, accompanied by a clear explanation of what needs to be reconsidered and why.

Card Game I want to know about YOU Write the following information in the card: Your Name Underline how you want to be called Your expectation for the discussion session

Eclipse (Slides adapted from S.E.Sim)

Eclipse Eclipse is an IDE (Integrated Development Environment) It’s an open source project Consortium of companies, including IBM Launched in November 2001 It’s a framework for software tools (“plug-ins” in Eclipse terminology) Main component is the workbench Ships with two plug-ins JDT (Java Development Tools) and PDE (Plug-in Development Environment)

JDT JDT – Java Development Tool Includes a variety of programming tools Editor with syntax highlighting Content Assist Quick Fix Source code searching Debugger Refactoring Code browser

Eclipse Concepts Resources Perspectives Views

Resources in a Workbench When working with Eclipse, you work with its resources Resources are organized as a file/directory structure in the Workbench They correspond to the actual files and directories in the Workspace There are three different levels on resources: Projects Folders Files

Organizing Resources project folder file Workbench Workspace It is possible to drag and drop resources directly between Workbench and the directory structure

Workbench Components Workbench contains perspectives Perspective contains views and editors views editor perspective

Perspectives Perspective defines initial layout of the views in the Workbench They are task oriented, i.e. they contain specific views for doing certain tasks: Java Perspective for manipulating Java code Resource Perspective for manipulating resources Debug Perspective for debugging applications One Workbench window contains many perspectives

Opening Perspective Perspectives can be open by: Clicking on a perspective shortcut button Choosing Window  Open Perspective… menu option

Available Perspectives By default, the following perspectives are available in the Workbench:

Views… The main purpose of a view is: To support editors To provide alternative presentation and navigation in the Workbench Views can have their own menus and toolbars Items available in menus and toolbars are available only in that view

…Views Views can: Appear on their own Appear stacked with other views Layout of the views can be changed by clicking on the title bar and moving views Single views can be moved together with other views Stacked views can be moved to be single views

Perspectives Available for Java When developing Java code commonly used perspectives are: Java Perspective Designed for working with Java projects Java Browsing Perspective Designed for browsing structure of Java projects Java Type Hierarchy Perspective Designed for exploring type hierarchy Debug Perspective Designed for debugging Java programs

Java Perspective Contains: Editor area Package Explorer View Hierarchy View Outline View Tasks View

Using Quick Fix Useful if Java compiler shows errors Gives options for fixing the errors Activated through Edit  Quick Fix menu option Error indication

Eclipse Useful links Eclipse Glossary: List of Plug-ins:

Eclipse Demo

JUnit JUnit is an open source testing framework for Java. It provides a common and reusable structure that is required for developing automate and repeatable unit tests for Java classes. It provides: A base class called TestCase that can be extended to create series of tests for your classes. An assertion library that can be used to evaluate the results of the tests.

Junit key classes TestCase - subclass contains your tests TestSuite - a composite of TestCases and/or TestSuites TestRunners - to run TestCases or TestSuites TestResult - collects results of multiple tests

How to use JUnit Each test class exercises one class in the system. Each test method exercises one method in the system. You also write additional test methods to exercise combinations of system methods. Class C { method m1(); method m2(); } Class D { method m3(); method m4(); } Class CTest extends TestCase { method testM1(); method testM2(); } Class DTest extends TestCase { method testM3(); method testM4(); }

How to use JUnit Each test method consists of a sequence of steps and some checks of the results. Once you have the unit tests written, you run them. You could run them directly from main(), but it is easier to use a test running utility. Options: Junit TestRunners or the Ant Junit task.

Junit Test Runner Sequence Test runner is given a list of test classes For each test class Create an instance of the test class For each test*() method Run setUp() method Run test method steps and checks If a check fails, an exception is thrown and the test method fails Test runner produces a report Some test runners work interactively

Junit Methods assertEquals(x,y) - Test passes if x and y are equal X and y can be primitives or any type with an appropiate equals method Three argument versions exist for floating point numbers assertFalse(b) - Test passes if boolean value b is false assertTrue(b) - Test passes if boolean value b is tru assertNull(o) - Test passes if object o is null assertNotNull(o) - Test passes if object o is not null assertSame(ox,oy) - Test passes if ox and oy refer to the same object assertNotSame(ox,oy) - Test passes if ox and oy do not refer to the same object

JUnit and Eclipse The recent version of the Eclipse JDT already has JUnit Plug-in built in. The plug-in includes: A wizard for assisting in creating a test case and test suite. An environment for running test cases.

Testing Hello World with JUnit Create a class Create a Test Case

Testing Hello World with JUnit Make sure Junit.jar is in the Build Path. Right Click on Project - > Properties

Testing HelloWorld with JUnit Run Test Test Passed Test did not pass

Junit Demo HelloWorld ShoppingCart (Adapted from Junit Primer)

Things to Notice setUp() method makes some variables that are used in the tests Oficially called “fixtures” tearDown() frees memory, prevents results of one test from affecting the next Only the first failure in a test method is reported Do not do too much in a single test Missing test cases: a new cart should be empty, add the same product twice, remove a product that was already removed, etc.

More Information Eclipse Help Help -> Help Contents -> Java Development User Guide -> Getting Started -> Basic Tutorial -> Writing and running Junit tests JUnit Home Page Junit Primer