Recitation 7 James Wei Professor Peck 2/28/2014. Covered in this Recitation LinkedList practice with JUnit testing Submit through ambient.

Slides:



Advertisements
Similar presentations
Machine Learning Homework
Advertisements

MAHDI OMAR JUNIT TUTORIAL. CONTENTS Installation of Junit Eclipse support for Junit Using Junit exercise JUnit options Questions Links and Literature.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
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.
Ch. 2 Exploring core JUnit. This chapter covers ■ Using the core JUnit classes ■ Understanding JUnit mechanisms ■ Understanding the JUnit lifecycle.
Objectives: Test Options JUnit Testing Framework TestRunners Test Cases and Test Suites Test Fixtures JUnit.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
WISTPC-09 : Session A Tariq M. King PhD Candidate Florida International University Workshop on Integrating Software Testing into Programming.
Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant.
Intro to CIT 594
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.
JUnit. Why is testing good? Due to psychological factors, programmers are bad testers. A computer can test much faster than a human Philosophy: “If it.
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.
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.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
INF 111 / CSE 121 Discussion Session Week 2 - Fall 2007 Instructor: Michele Rousseau TA: Rosalva Gallardo.
Xcode testing Using XCTest.
Computer Science and Engineering College of Engineering The Ohio State University JUnit The credit for these slides goes to Professor Paul Sivilotti at.
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
Intoduction to Unit Testing Using JUnit to structure Unit Testing SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
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.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Compsci 201 Recitation 11 Professor Peck Jimmy Wei 11/8/2013.
How to Build a Struts Application with JBuilder 9.
MANUAL FOR MAINTENANCE. 1.Click Menu maintenance 2.Create new complaint.
Simple Java Unit Testing with JUnit 4 and Netbeans 6.1 Kiki Ahmadi JUG-Bonek.
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
Week81 APCS-AB: Java Unit Testing Information today from “Unit Testing in BlueJ” October 28, 2005.
An Introduction to Designing, Executing and Sharing Workflows with Taverna Katy Wolstencroft myGrid University of Manchester IMPACT/Taverna Hackathon 2011.
Menu Planning & Ordering. Overview This tutorial will cover the step by step process for: – Menu planning – Ordering by menu plan – Ordering by order.
JUnit Don Braffitt Updated: 10-Jun-2011.
JUnit. Introduction JUnit is an open source Java testing framework used to write and run repeatable tests JUnit is integrated with several IDEs, including.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Debugging COMP T1.
1 Unit Testing with JUnit CS 3331 JUnit website at Kent Beck and Eric Gamma. Test Infected: Programmers Love Writing Tests, Java Report,
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.
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved.
It works! PPInfoScreen Server is now running and will display your deployed presentations Some instructions will follow…
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
1 COS 260 DAY 15 Tony Gauvin. 2 Agenda Questions? 6 th Mini quiz Today –Chapter 6 Assignment 4 posted –Due Nov 9 Capstone progress reports are due –Brief.
Test a Little, Code a Little Colin Sharples IBM Global Services New Zealand Colin Sharples IBM Global Services New Zealand.
Testing Data Structures Tao Xie Visiting Professor, Peking University Associate Professor, North Carolina State University
Justin Bare and Deric Pang with material from Erin Peach, Nick Carney, Vinod Rathnam, Alex Mariakakis, Krysta Yousoufian, Mike Ernst, Kellen Donohue Section.
Revolution Prep Directions: Look at your Practice ACT answer sheet. Follow the directions below. 1.Write this website on the top of your answer sheet:
Time to apply stuff… Faculty of Mathematics and Physics Charles University in Prague 5 th October 2015 Workshop 1 – Java Wrestling.
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,
SurveyDIG 2.1 Tutorial. Tutorial Contents Introduction Introduction Item Groups Item Groups –Creating new Groups –Naming Convention –Searching/Editing.
Today protected access modifier Using the debugger in Eclipse JUnit testing TDD Winter 2016CMPE212 - Prof. McLeod1.
Downloading and Installing GRASP-AF Workshop Ian Robson Information Analyst, North of England Cardiovascular Network.
CSE 143 Lecture 14: testing.
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Don Braffitt Updated: 26-Mar-2013
Dept of Computer Science University of Maryland College Park
ATS Application Programming: Java Programming
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Software Engineering 1, CS 355 Unit Testing with JUnit
COS 260 DAY 16 Tony Gauvin.
Credit to Eclipse Documentation
Introduction to JUnit CS 4501 / 6501 Software Testing
Path: Common > Application Appearance > Workspaces
Test-Driven Development
Introduction to JUnit IT323 – Software Engineering II
Creating Session By huda AlSuwailem.
Test-Driven Development
JUnit SWE 619 Spring 2008.
James Wei Professor Peck 9/20/2013
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Recitation 7 James Wei Professor Peck 2/28/2014

Covered in this Recitation LinkedList practice with JUnit testing Submit through ambient

First Steps Snarf the Recitation code for today You should be snarfing two classes: StringLinkedList – we will write methods for this StringLinkedListTester – we will use this to test our implementation Take a brief look over the StringLinkedList class, and be sure that you understand how it’s working

Quick Intro to JUnit Unit testing framework for Java Will run a series of unit tests specified by a tester class and display results in the JUnit view Note: if you snarf this code and all of your JUnit calls have errors (could not be resolved) even after importing JUnit, follow these steps: 1)Right click your project in the explorer sidebar 2)Go to “Build Path” -> “Configure Build Path” 3)Click on the “Libraries” tab 4)Click the “Add Library” button on the right sidebar 5)Select “JUnit“ from the list and hit next 6)Select “JUnit 4” from the dropdown menu and hit Finish If that doesn’t fix it then ask the TA separately

How to use JUnit How to set up a tester class: 1) Import junit Test class (org.junit.Test) 2) Create a public void method that takes no argument, e.g. “public void testMethod()”; convention is to prefix test methods with “test” 3) Annotate the method 4) Add assert() methods to the test method; commonly used ones include assertEquals(), assertNotNull(), assertTrue(), etc. (check javadoc for full list) 5) Repeat steps 2-4 for each test method you want to create 6) Running the tester class will bring up the JUnit sidebar. Each annotated test method will appear as a line item, and those that fail will display a failure trace below which shows exactly which assert statement failed

Couple Notes about JUnit Will NOT be tested on This knowledge is for your own benefit so that you are aware of the tools you have available to you as you code in the future

StringLinkedListTester First we will familiarize ourselves with the testing tool Open StringLinkedListTester.java and run it Five tests fail: testAddAtEnd testCompareTo testReverse moveToEnd testDouble We will fix all of these methods (yay!)

StringLinkedList Let’s code addAtEnd together! Complete the rest of the methods on your own, so that the JUnit tests all succeed—write the code on paper first as an exam prep exercise! Ask the TAs if you have any questions Submit your code via Ambient when you’re done!

Have a good weekend! Don’t forget to submit your code!