1 JUNIT - Introduction

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

JUnit

Introduction

1 © 2012 WIPRO LTD | WWW.WIPRO.COM


Agenda

Introduction to JUnit

2 © 2012 WIPRO LTD | WWW.WIPRO.COM


Objectives
At the end of this module, you will be able to explain:
• Basics of JUnit

3 © 2012 WIPRO LTD | WWW.WIPRO.COM


Introduction to JUnit

4 © 2012 WIPRO LTD | WWW.WIPRO.COM


JUNIT
• JUnit is an open source testing framework for Java
• JUnit test cases are Java classes that contain one
or more unit test methods
• It is a simple framework for creating automated unit
tests

5 © 2012 WIPRO LTD | WWW.WIPRO.COM


JUNIT

• These tests are grouped into test suites


• JUnit tests are pass/fail tests explicitly designed to run
without human intervention
• JUnit can be integrated with several IDEs, including
Eclipse
• The JUnit distribution can be downloaded as a single jar file
from http://www.junit.org
• It has to be kept in the classpath of the application to be
tested

6 © 2012 WIPRO LTD | WWW.WIPRO.COM


Junit - an open source testing framework
• JUnit has these advantages:
• it's simple to use
• it can test a single class at a time, or a suite of tests
can be created for a group of classes
• it greatly increases your confidence in the correctness
of your code
• it often improves the design of the class you are
testing - since you spend more time thinking about
how an object is actually used, instead of its
implementation, defects in its interface become more
obvious.

7 © 2012 WIPRO LTD | WWW.WIPRO.COM


8 © 2012 WIPRO LTD | WWW.WIPRO.COM
Summary

• Introduction to JUnit

9 © 2012 WIPRO LTD | WWW.WIPRO.COM


Thank You

10 © 2012 WIPRO LTD | WWW.WIPRO.COM

You might also like