my own preferred testing tools - paris jug 2011

25
My own preferred testing techniques Paris Java User Group

Upload: david-gageot

Post on 11-Nov-2014

1.250 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: My own preferred testing tools - Paris JUG 2011

My own preferred testing techniques

Paris Java User Group

Page 2: My own preferred testing tools - Paris JUG 2011

www.parisjug.orgCopyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique

Page 3: My own preferred testing tools - Paris JUG 2011

Frameworks

My own preferred testing techniques

JUnit 4+

More expressive testsMore robust

Faster

Plugins

Page 4: My own preferred testing tools - Paris JUG 2011

Personal taste only

Page 5: My own preferred testing tools - Paris JUG 2011

Plugins

Page 6: My own preferred testing tools - Paris JUG 2011

MoreUnit, a unit test friendly Eclipse

http://moreunit.sourceforge.net/

See what’s tested

Page 7: My own preferred testing tools - Paris JUG 2011

MoreUnit

http://moreunit.sourceforge.net/

Jump to Test

Page 8: My own preferred testing tools - Paris JUG 2011

MoreUnit

http://moreunit.sourceforge.net/

Run current test

Refactoring friendly(move, rename, delete)

http://moreunit.sourceforge.net/

Demo

Page 9: My own preferred testing tools - Paris JUG 2011

Continuous testing

Runs all impacted tests after each code change

Eclipse and Intellij

OpenSource, Free

http://infinitest.org

Page 10: My own preferred testing tools - Paris JUG 2011

Demo

Page 11: My own preferred testing tools - Paris JUG 2011

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/

Page 12: My own preferred testing tools - Paris JUG 2011

Frameworks

Page 13: My own preferred testing tools - Paris JUG 2011

HamcrestMore readable assertions

Page 14: My own preferred testing tools - Paris JUG 2011

HamcrestMore samples

+ easy to write custom matchers

Page 15: My own preferred testing tools - Paris JUG 2011

So

Page 16: My own preferred testing tools - Paris JUG 2011

FEST-AssertMore readable assertions

Demo

Page 17: My own preferred testing tools - Paris JUG 2011

FEST-AssertMore readable assertions

OpenSource

http://fest.easytesting.org/

Page 18: My own preferred testing tools - Paris JUG 2011

JUnit 4.8.2

Worst logo ever!

Page 19: My own preferred testing tools - Paris JUG 2011

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

Page 20: My own preferred testing tools - Paris JUG 2011

@Categories and @SuiteClasses

JUnit 4.8.2

Page 21: My own preferred testing tools - Paris JUG 2011

@Categories and @SuiteClasses

JUnit 4.8.2

Page 22: My own preferred testing tools - Paris JUG 2011

@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? :-)

Page 23: My own preferred testing tools - Paris JUG 2011

@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

Page 24: My own preferred testing tools - Paris JUG 2011

Thank youQ/A

Page 25: My own preferred testing tools - Paris JUG 2011

www.parisjug.orgCopyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique