User:Aleksandar.d75/sandbox

Spock is a Java testing framework capable of handling the full life cycle of a software application. It was initially created in 2008 by Peter Niederwieser, a software engineer with GradleWare. A second Spock committer is Luke Daley (also with Gradleware) who is also the creator of the popular Geb functional testing framework. Spock is a new entry in the test framework arena and currently challenges the undisputed king - JUnit - armed with it's fresh ideas against the legacy techniques of the past.

Main features
Main Features of Spock
 * Enterprise ready - Spock can be easily integrated with the popular build systems (Maven and Gradle), runs as part of a build process, and produces reports of automated test runs. Spock can be used to test backend code, web pages, http services, and more.
 * Comprehensive - It has built-in mocking and stubbing capabilities allowing you to decide on the breadth of the testing context. Spock can test a single class, a code module, or a whole application context with ease. It's possible to perform end-to-end testing with Spock or isolate one class/method for testing needs without any external libraries.
 * Familiar/Compatible - Spock runs on top of the JUnit runner which already enjoys mature support among tools and development environments. Spock tests are run in the same way as JUnit tests. You can even mix the two in the same project, and get reports on test failures, or code coverage in a similar way to JUnit. Run your tests in parallel or in a serial way, Spock does not care because it is fully compatible with existing JUnit tools.
 * Inspired - Spock is relatively new and does not carry any legacy burden. It is designed from scratch but takes the best features of existing testing libraries. For example Spock embraces the given-when-then structure of JBehave but also discards the cumbersome record/replay code of older Mocking frameworks.

Coding Features

 * Concise - Spock uses the Groovy syntax which is already concise on its own, and mixes its own simplified syntax on top.
 * Readable - Spock follows a close-to-English flow of statements which can be readable by non-technical people. Collaboration between analysis, development and testing people can be greatly simplified with Spock tests.
 * Meticulous - Spock gives as much details as possible on the inner workings of the code at the time of failure. In some cases this is more than enough for a developer to understand the problem without resorting to the time consuming debugging process.
 * Extensible - Spock allows developing custom extensions to cater specific needs. Several of its “core” features are actually extensions (or started as extensions).

Comparison with Junit
JUnit is a Spartan library that provides the absolutely necessary thing you need to test and leaves additional functionality (such as mocking and stubbing) to external libraries. Spock has a holistic approach, providing you a superset of the capabilities of JUnit, while at the same time reusing its mature integration with tools and developments environments. Spock can do everything that JUnit does and more, keeping backwards compatibility as far as test runners are concerned.