KEMBAR78
Jack borden jb471909_junit1 | PPTX
Unit Testing Framework
Jack Borden
CS4561










In the mid-90’s, Kent Beck developed the
first xUnit test tool for Smalltalk.
Beck and Gamma created JUnit on an
airplane.
Junit has become the standard tool for TestDriven development in Java.
Junit is now a part of many java IDEs
including: Eclipse
Xunit tools have been developed for other
language paradigms






Cactus: Test framework for unit testing serverside java code. Cactus lowers the cost of writing
tests for server-side code. (uses Junit)
Abbot: Java GUI unit testing and functional
testing. Provides methods to reproduce user
actions and examine the state of GUI
componnents
JunitPref: Collection of Junit test decorators used
to measure the performance and scalability of
functionality contained within existing Junit Tests








DbUnit: Extension of Junit, targeted for
database-driven projects that put your database
into a known state between test runs.
XMLunit: Extension of Junit for xml

StrutsTestCase: Extension of JunitTestcase class
that allows testing of individual action objects
with or without a running servlet engine.
Ect…


Junit is a very reliable unit testing framework.



Over 30% of all GitHub projects use Junit.







Using Junit will help to optimize software
components.
Junit is free to use.
Junit framework is quite handy and will help to
make your projects run smoother and faster.




Because Junit is a free testing framework
software, there is no downside to using it.
Junit will only help to make your projects
better, there really is no downside to using it
besides having to code test scases.


Junit is an open source framework



Provides annotation to identify test methods



Provides assertions for testing expected results



Provides test runners for running tests



Junit tests allow you to write code
faster, increasing quality








Junit is simple.
Junit tests can be run automatically, which
allows for immediate feedback.

Junit tests can be organized into test suites
containing test cases.
Junit shows test progress, green if pass & red
for fail.




Unit Test Case tests another part of code and
sees if it works as expected
Two outcomes: One pass, One fail, must be
declared.




http://www.youtube.com/watch?v=qU9DmFa
45rc (Java)
http://www.youtube.com/watch?v=E9aSPeGk
HmA (eclipse)


Updating eclipse drivers, or checking
regularly at Junit.org will ensure the latest
drivers are updated for Junit




Eclipse is offered on a wide variety of
operating systems.
With Junit already included in Eclipse
software, anyone is able to access this great
tool.


Create a file with functions to test: The
picture below describes a simple calculator.






Create a new Junit class: When
creating, Eclipse will automatically
add the new class to your projects
build path
Create a Test Suite file to test each
junit function:
Provide values for each testing
function:
◦ assertEquals(“result”,120, tester.
sum(48,72));
◦ 120 = the value to test against
48 + 72


Create a main class to implement the Junit
test suite.


Simply click debug as Junit, and if your test suite passes all test cases,
you will see a green bar indicating that your functions are working
properly
GitHub. "JUnit." JUnit. GitHub, n.d. Web. 13 Feb.

2014.

Javasource. "Open Source Testing Tools in Java."

Open Source Testing Tools in Java. N.p., n.d.
Web. 13 Feb. 2014.

"Junit." Wikipedia. Wikimedia Foundation, n.d. Web.

13 Feb. 2014.

Tutorialspoint. "Tutorials Point - Simply Easy
Learning." JUnit Overview. N.p., n.d. Web. 13 Feb.
2014.

Jack borden jb471909_junit1

  • 1.
  • 2.
         In the mid-90’s,Kent Beck developed the first xUnit test tool for Smalltalk. Beck and Gamma created JUnit on an airplane. Junit has become the standard tool for TestDriven development in Java. Junit is now a part of many java IDEs including: Eclipse Xunit tools have been developed for other language paradigms
  • 3.
       Cactus: Test frameworkfor unit testing serverside java code. Cactus lowers the cost of writing tests for server-side code. (uses Junit) Abbot: Java GUI unit testing and functional testing. Provides methods to reproduce user actions and examine the state of GUI componnents JunitPref: Collection of Junit test decorators used to measure the performance and scalability of functionality contained within existing Junit Tests
  • 4.
        DbUnit: Extension ofJunit, targeted for database-driven projects that put your database into a known state between test runs. XMLunit: Extension of Junit for xml StrutsTestCase: Extension of JunitTestcase class that allows testing of individual action objects with or without a running servlet engine. Ect…
  • 5.
     Junit is avery reliable unit testing framework.  Over 30% of all GitHub projects use Junit.    Using Junit will help to optimize software components. Junit is free to use. Junit framework is quite handy and will help to make your projects run smoother and faster.
  • 6.
      Because Junit isa free testing framework software, there is no downside to using it. Junit will only help to make your projects better, there really is no downside to using it besides having to code test scases.
  • 7.
     Junit is anopen source framework  Provides annotation to identify test methods  Provides assertions for testing expected results  Provides test runners for running tests  Junit tests allow you to write code faster, increasing quality
  • 8.
        Junit is simple. Junittests can be run automatically, which allows for immediate feedback. Junit tests can be organized into test suites containing test cases. Junit shows test progress, green if pass & red for fail.
  • 9.
      Unit Test Casetests another part of code and sees if it works as expected Two outcomes: One pass, One fail, must be declared.
  • 10.
  • 11.
     Updating eclipse drivers,or checking regularly at Junit.org will ensure the latest drivers are updated for Junit
  • 12.
      Eclipse is offeredon a wide variety of operating systems. With Junit already included in Eclipse software, anyone is able to access this great tool.
  • 13.
     Create a filewith functions to test: The picture below describes a simple calculator.
  • 14.
       Create a newJunit class: When creating, Eclipse will automatically add the new class to your projects build path Create a Test Suite file to test each junit function: Provide values for each testing function: ◦ assertEquals(“result”,120, tester. sum(48,72)); ◦ 120 = the value to test against 48 + 72
  • 15.
     Create a mainclass to implement the Junit test suite.
  • 16.
     Simply click debugas Junit, and if your test suite passes all test cases, you will see a green bar indicating that your functions are working properly
  • 19.
    GitHub. "JUnit." JUnit.GitHub, n.d. Web. 13 Feb. 2014. Javasource. "Open Source Testing Tools in Java." Open Source Testing Tools in Java. N.p., n.d. Web. 13 Feb. 2014. "Junit." Wikipedia. Wikimedia Foundation, n.d. Web. 13 Feb. 2014. Tutorialspoint. "Tutorials Point - Simply Easy Learning." JUnit Overview. N.p., n.d. Web. 13 Feb. 2014.