my own preferred testing tools - paris jug 2011
DESCRIPTION
TRANSCRIPT
My own preferred testing techniques
Paris Java User Group
www.parisjug.orgCopyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique
Frameworks
My own preferred testing techniques
JUnit 4+
More expressive testsMore robust
Faster
Plugins
Personal taste only
Plugins
MoreUnit, a unit test friendly Eclipse
http://moreunit.sourceforge.net/
See what’s tested
MoreUnit
http://moreunit.sourceforge.net/
Jump to Test
MoreUnit
http://moreunit.sourceforge.net/
Run current test
Refactoring friendly(move, rename, delete)
http://moreunit.sourceforge.net/
Demo
Continuous testing
Runs all impacted tests after each code change
Eclipse and Intellij
OpenSource, Free
http://infinitest.org
Demo
Continuous testing
JUnit Max
Runs all impacted tests after each code change
Try to run tests failing most often, first
Eclipse and Intellij
OpenSource, Free
Developed by Kent Beck
http://www.junitmax.com/
Frameworks
HamcrestMore readable assertions
HamcrestMore samples
+ easy to write custom matchers
So
FEST-AssertMore readable assertions
Demo
FEST-AssertMore readable assertions
OpenSource
http://fest.easytesting.org/
JUnit 4.8.2
Worst logo ever!
Do you known/use all the features?
@Test@Before, @After, @BeforeClass, @AfterClass
@RunWith@Theory, @DataPoint(s)
@Rule@SuiteClasses
@Category (beta)
JUnit 4.8.2
Demo
@Categories and @SuiteClasses
JUnit 4.8.2
@Categories and @SuiteClasses
JUnit 4.8.2
@Categories and @SuiteClasses
JUnit 4.8.2
Cumbersome
Need not forget to add each test manually in all suites
Who doesn’t run all the tests every build? :-)
@Rule
Take a look at the code of MethodRule, ExternalResource, TestWatchman, Verifier...
Write your own rules if they make the tests easier to read.
JUnit 4.8.2
Thank youQ/A
www.parisjug.orgCopyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique