Showing posts with label unit testing. Show all posts
Showing posts with label unit testing. Show all posts

Wednesday, October 25, 2017

Java Testing with SpockJava Testing with Spock by Konstantinos Kapelonis
My rating: 4 of 5 stars

Spock is a very good testing library. This book can be considered to be a Bible for Spock testing.

This book will not only introduce one to Spock, but will also help get started writing sufficiently complex test cases with Spock.


View all my reviews

Tuesday, April 17, 2012

Mocking intricate dependencies

How to use mock to simplify unit testing?

Not easy to test code dependent on other pieces like database.

Unit test only the smallest piece of code that does something useful should be unit tested.

Types of unit tests
1. Positive test
2. Negative test
3. Exception test
4. Performance test

Create multiple mocks instead of complex mock objects for different test cases.