Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant.

Slides:



Advertisements
Similar presentations
ANT Another Neat Tool. What is ANT? What is Apache Ant? Ant is a Java-based build tool. In theory, it is kind of like Make, without Make's wrinkles and.
Advertisements

Java Testing Tools. junit is a testing harness for unit testing. emma is a code coverage tool. The tools can be used in concert to provide statement and.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.c files.
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.
Unit and Functional Testing with JUnit and Related Tools Greg Barnes University of Washington
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT – Another Neat Tool Representation and Management of Data on the Internet.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Declarative Languages. Declarative languages In an imperative programming language, a program specifies how to solve a problem In a declarative language,
1 Ant – Another Neat Tool Representation and Management of Data on the Internet.
© S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
JUnit Syed Nabeel. Motivation Unit Testing Responsibility of  developer Rarely done properly Developers Excuse: “I am too much in a hurry”
Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
Introduction to Ant David Rabinowitz. March 3rd, 2004 Object Oriented Design Course 2 Ant Yet another build tool? Why do we need one where there are make,
Programming Tools Eclipse JUnit Testing make and ant.
Introduction to Ant- a framework example Amit Shabtay.
Automating the Build Process using ANT SE-2030 Dr. Mark L. Hornick 1.
Using Ant to build J2EE Applications Kumar
Introduction to ant Guy Rixon AstroGrid Consortium Meeting
CSE 403 Lecture 11 Static Code Analysis Reading: IEEE Xplore, "Using Static Analysis to Find Bugs" slides created by Marty Stepp
Software Development Tools COMP220 Seb Coope Week 8 Lecture 1 Ant, Testing and JUnit (2) These slides are mainly based on “Java Development with Ant” -
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
Computer Science and Engineering College of Engineering The Ohio State University JUnit The credit for these slides goes to Professor Paul Sivilotti at.
Automating the Build Process using Ant SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.cpp.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
Ant Build Tools.  Creating a product from source may take several steps: Compile Link Copy files to various directories Remove intermediate files Generate.
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.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
JUnit test and Project 3 simulation. 2 JUnit The testing problems The framework of JUnit A case study Acknowledgement: using some materials from JUNIT.
Automating the Build Process using ANT SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
Ant Presentation by: Bart Taylor. What is Ant? The simple definition: A Java-based build tool The Official Definition: “Apache Ant is a Java-based build.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
JUnit Dwight Deugo Nesa Matic
JUnit Dwight Deugo Nesa Matic
Simple Java Unit Testing with JUnit 4 and Netbeans 6.1 Kiki Ahmadi JUG-Bonek.
Distributed Java Programming Build Management  A repeatable build management process allows you to integrate the development efforts of your team.
Software Development COMP220/COMP285 Seb Coope Introducing Ant These slides are mainly based on “Java Development with Ant” - E. Hatcher & S.Loughran.
JUnit A framework which provides hooks for easy testing of your Java code, as it's built Note: The examples from these slides can be found in ~kschmidt/public_html/CS265/Labs/Java/Junit.
Tools – Ant-MakeEtc 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Tools 12 – Hamcrest 10/02/
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
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.
Ant / continuous integration. Turning Client Vision into Results 2 Outline presentation Introduction Ant –History –Concepts –Tasks –Examples –Extending.
Unit, Regression, and Behavioral Testing Based On: Unit Testing with JUnit and CUnit by Beth Kirby Dec 13, 2002 Jules.
Test a Little, Code a Little Colin Sharples IBM Global Services New Zealand Colin Sharples IBM Global Services New Zealand.
Justin Bare and Deric Pang with material from Erin Peach, Nick Carney, Vinod Rathnam, Alex Mariakakis, Krysta Yousoufian, Mike Ernst, Kellen Donohue Section.
RTLAB Real-Time System Build automation School of Electronics Engineering College of IT Engineering Kyungpook National University Jun Sang ho (Rm) IT1-501.
Using Ant in Eclipse Dwight Deugo Nesa Matic
Makefiles Manolis Koubarakis Data Structures and Programming Techniques 1.
SG Introduction to ANT scmGalaxy Author: Rajesh Kumar
Java IDE Dwight Deugo Nesa Matic
An Introduction to Ant. What is Ant? How do you use it? Why would you want to?
Ant Presented by: Mindaugas Idzelis Tatum Krawczyk.
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
The make utility (original presentation courtesy of Alark Joshi)
J2EE Application Development
Ant.
Makefiles and the make utility
Credit to Eclipse Documentation
Introduction to JUnit IT323 – Software Engineering II
Nilanjan Banerjee Java Packages Ant CVS Project Submission
Eclipse JUnit Testing make and ant
Makefiles and the make utility
JUnit Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from the Eclipse 3.0 and.
The make utility (original presentation courtesy of Alark Joshi)
Presentation transcript:

Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant

Fall 2007CS 2252 Eclipse command line arguments

Fall 2007CS 2253 Debugging in Eclipse

Fall 2007CS 2254 JUnit Testing JUnit is an open-source testing framework for Java You can create test cases and test suites by extending the appropriate class from the JUnit package

Fall 2007CS 2255 JUnit Testing JUnit has been integrated into Eclipse Make sure junit.jar is on the build path –use the Properties menu –or let Eclipse find it when you create the test case Create a test case –File -> New -> JUnit Test Case Run your application as a JUnit Test

Fall 2007CS 2256 In the TestCase class Write methods that test each of the methods of your class –use the assertion methods on next slide for testing results of methods You can override setup() and teardown() to create a set of objects to be shared by several tests

Fall 2007CS 2257 Assertion methods assertEquals( expected, actual) assertFalse( condition), assertTrue(condition) assertNull( object), assertNotNull( object) assertSame( ecpected, actual), assertNotSame(expected, actual) And many more

Fall 2007CS 2258 Sources of Information The home page for JUnit is at The documentation is at

Fall 2007CS 2259 Building Big Projects For very large projects, the process of recompiling all the modules that make up the project can take a long time. One way to reduce the amount of time needed to build a project is to only recompile the modules that have not changed and don't use modules that have changed. Two tools that determine what needs to be recompiled. –make –ant (for Java)

Fall 2007CS The make Utility make is a command generator designed to help you manage large projects –make allows you to specify dependencies between modules if a class depends on another class, it should be recompiled when that class changes –make allows you to specify how to compile a particular class –make uses these specifications to determine the minimum amount of work needed to recompile a program

Fall 2007CS How does make Work? make uses a file called Makefile (or makefile or GNUMakefile) to determine what needs to be recompiled. The makefile contains a set of rules for executing the jobs it can be asked to do. When you run make, it uses the rules in the makefile to determine what needs to be done. make does the minimum amount of work needed to get the job done.

Fall 2007CS The Makefile A make file consists of a set of rules Each rule has the form target: dependencies commands target is (usually) the name of a file to be created dependencies are the names of files that are needed to create the target commands is one or more commands that need to be executed to create the target. Each command is indented with a tab

Fall 2007CS Example TestPriorityQueue uses KWPriorityQueue. PrintDocument and ComparePrintDocuments objects ComparePrintDocuments uses PrintDocument objects KWPriorityQueue implements Queue

Fall 2007CS makefile TestPriorityQueue.class: TestPriorityQueue.java \ KWPriorityQueue.class PrintDocument.class \ ComparePrintDocuments.class javac TestPriorityQueue.java KWPriorityQueue.class: KWPriorityQueue.java Queue.class javac KWPriorityQueue.java Queue.class: Queue.java javac Queue.java

Fall 2007CS makefile (cont.) ComparePrintDocuments.class: \ ComparePrintDocuments.java PrintDocument.class javac ComparePrintDocuments.java PrintDocument.class: PrintDocument.java javac PrintDocument.java

Fall 2007CS Dummy targets The makefile can also have targets that don’t create files A target to run a java program TestPriorityQueue: TestPriorityQueue.class java TestPriorityQueue A target to remove class files clean: rm -f *.class

Fall 2007CS Sources of Information Managing Projects with make by Andrew Oram and Steve Talbot make_toc.htmlhttp:// make_toc.html Look at the man page man make

Fall 2007CS Ant make can be used with Java files ant was designed for building large Java projects –acronym for "Another Neat Tool" Ant uses XML format for build files

Fall 2007CS build files A build file is an xml file that contains exactly one project element main is target to build if none is given name and basedir are optional attributes for project

Fall 2007CS Targets A project element contains one or more targets Each target corresponds to a task –the main target is required depends attribute contains list of targets that this target needs

Fall 2007CS Tasks Each target contains one or more tasks There are a number of built-in tasks –java needs the classname attribute to be set to the main class –javac –jar - to create a java archive –javadoc - to create the documentation

Fall 2007CS Sources of Information Ant The Definitive Guide by Steve Holzner Ant is an open source Apache project –