Skip to content

jbhembise/tests-auto-in-java-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests auto in Java world

alt text

Overview of tests auto concepts and solutions in Java ecosystem.

The purpose of this project is to bootstrap and experiment a couple of libraries / frameworks concerning automatic testing.

Criteria of selection :

  • Modern / Up to date
  • Popular
  • Opensource projects
  • Free
  • Out of Spring ecosystem

Solutions out of the scope of this study (regarding above criteria) :

  • JTest (not free)
  • Spring Test / Spring MockMvc (Spring ecosystem)
  • JDave (latest release in January 2011)
  • Jameleon (latest release in April 2013)
  • Jester (latest release in April 2005)
  • µJava (latest release in June 2013)
  • Bacterio (not existing anymore ?)
  • Jumble (latest release in May 2015)
  • Judy (latest release in February 2014)
  • Jakarta Cactus (latest release in July 2005)
  • Unitils (latest release in December 2011)
  • JWebUnit (latest release in October 2015)
  • The Grinder (latest release in April 2015)
  • JCrawler (latest release in April 2013)
  • Jetif (latest release in May 2006)

Unit and Integration frameworks

JUnit

The most famous testing framework in Java world.

TestNG

A serious competitor of Junit, inspiring it and inspired from it.

  • Current version : V6.14.3
  • Latest release : September 2018
  • First release : September 2004
  • Github URL : https://github.com/cbeust/testng
  • Gradle task : ./gradlew clean testNG

Mocking frameworks

Mockito

The most famous mocking framework. It respects well the AAA pattern, allowing expectations after the call of the method to test.

  • Current version : V2.23.2
  • Latest release : October 2018
  • First release : March 2008
  • Github URL : https://github.com/mockito/mockito
  • Gradle task : ./gradlew clean testMockito

EasyMock

A modern mocking framework.

PowerMock

Easymock and Mockito extension to mock with more powerful capabilities (static and final methods for example).

JMockit

A mocking framework that have by default more capabilities than classic ones, like mocking private, static or final methods.

JMock

Another alternative, old-fashioned.

Server mocking librairies

Greenmail

A useful library to simulate a mail server.

Wiremock

A usefull library mock a SOAP / REST remote API.

Specifications / BDD frameworks

Cucumber JVM

The so famous BDD framework, adapted to JVM, based on Gherkin specifications files.

Gauge

An recent alternative using Markdown syntax for specifications files.

  • Current version : V1.0.3
  • Latest release : October 2018
  • First release : June 2018
  • Github URL : https://github.com/getgauge/gauge
  • Gradle task : ./gradlew clean testGauge

Concordion

An alternative using HTML syntax for specifications files.

JNario

An executable specifications framework for Java, mixing Cucumber syntax and Java for Acceptance tests, and another light DSL for Unit tests.

Serenity BDD

A BDD framework on top of JUnit4, Cucumber or JBehave, allowing coding Unit and Acceptance tests using BDD style.

JGiven

A developer-friendly framework using plain Java syntax for writing BDD-style tests.

To have nice HTML report, execute ./gradlew clean test and have a look at build/reports/jgiven/test/html/index.html

  • Current version : V0.16.1
  • Latest release : September 2018
  • First release : April 2014
  • Github URL : https://github.com/TNG/JGiven
  • Gradle task : ./gradlew clean testJGiven

Specsy framework

A BDD framework for Scala.

SPOCK framework

A popular BDD framework written in Groovy.

SPEK framework

A BDD framework written in Kotlin.

Assertions librairies

Hamcrest (Java)

An old and popular assertions library, existing in many languages, using nested matchers.

AssertJ (Java)

A modern and powerful assertions library.

Google Truth (Java)

A nice competitor of AssertJ, simple and powerful.

  • Current version : V0.42
  • Latest release : July 2018
  • First release : May 2017
  • Github URL : https://github.com/google/truth
  • Gradle task : ./gradlew clean testAssertions

HamKrest (Kotlin)

TODO

ExpecKt (Kotlin)

TODO

Kluent (Kotlin)

TODO

Property Based Testing

Jqwik

A PBT framework, based on annotations for classic cases or generators for more complex properties.

  • Current version : V0.9.2
  • Latest release : November 2018
  • First release : March 2018
  • Github URL : https://github.com/jlink/jqwik
  • Gradle task : ./gradlew clean testJqwik

JUnit-quickcheck

A PBT framework, similar to Jqwik.

QuickTheories

A PBT framework, using fluent Java API to produce random inputs.

Code coverage

JaCoCo

Popular Java code coverage library.

  • Current version : V0.8.2
  • Latest release : August 2018
  • First release : 2013
  • Github URL : https://github.com/jacoco/jacoco
  • Gradle task : ./gradlew clean jacocoTestReport

Cobertura

Another well-known coverage library for Java.

Atlassian Clover

TODO

EMMA

TODO

Mutation testing

PIT

A modern Mutation testing tool that integrates well with Continuous Integration.

  • Current version : V1.4.3
  • Latest release : Sept. 2018
  • First release : May 2014
  • Github URL : https://github.com/hcoles/pitest
  • Gradle task : ./gradlew clean pitest

Javalanche

An old fashioned Mutation testing tool.

Disadvantages :

  • No release yet (use git clone)
  • launching using Ant ant -f javalanche.xml mutationTest
  • Requires Javalanche JAR compiled to be launched
  • Source code must be compiled toward Java 6, otherwise errors like Expected stackmap frame at this location. would occur.

Major

Another Mutation testing tool, using ant and javac.

  • Current version : V1.3.2
  • Latest release : May 2017

API testing

Karate DSL

TODO

REST-assured

TODO

Database / JPA testing

DbSetup

Utility to insert test samples into tests implying a database. Use Fluent Java API.

DbUnit

Utility to insert test samples into tests implying a database. Use XML configuration file.

AssertJ-DB

Assertions to test values in tests implying a database.

JPA Unit

JUnit extension to test javax.persistence entities.

About

Benchmarking des tests auto dans l'univers Java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published