fspyckerelle (11) [Avatar] Offline
#1
Dear Kostis
These are the things I noted whilst reading your –very promising- Java Testing with Spock MEAP V01
These are some typo’s or English expressions which I tried to correct (I am NOT an English native speaker…)

But First, Some General Observations.
- One addition I would certainly suggest: for all those who never dealt with Groovy before, you should explain (at least once) the term
“duck typing
”. Personnaly I would do it twice: a short ‘definition’ the first time, and then in chapter 3, again but this time with an example.
- Very nice example of the simple fire-alarm to the more complex nuclear plant. Very nice indeed!
- The explanation on expandos is still, wel lets say ‘flaky’-; I do not really have a proposal to make it more clear for now.

location 299-300
The process of making programming code testable enforces several constraints on encapsulation and extensibility that can be easily neglected if the code is created with not tests in mind.
if the code is not created with not tests in mind.
==========
location 630-631
This is the main reason that I got interested in Spock in the first place is the fact that it comes full batteries included as mocking and stubbing are supported out of the box.

either like:
This is tThe main reason (that) I got interested in Spock in the first place is the fact that it comes "full batteries included" as mocking and stubbing are supported out of the box.
This is the main reason that I got interested in Spock in the first place; is the fact that it comes "full batteries included". as mMocking and stubbing are supported out of the box.

==========
location 1126-1126
If there is one feature of Groovy that I really adore is object creation.
If there is one feature of Groovy that I really adore, then that is object creation.
If there is The one feature of Groovy that I really adore is object creation.

==========
location 1168-1169

This the Groovy way of initializing a Map.
This is the Groovy way of initializing a Map.

==========
location 1278-1279
Similar to other scripting languages Groovy allows you split a big string with newlines:
Similar to other scripting languages(,) Groovy allows you to split a big string with newlines:

==========
location 1403-1403
Explaining all things Groovy in a single chapter is impossible.
Explaining all things Groovy can do in a single chapter is impossible.

==========
location 1407-1408
They have their use at times, but you should always make sure that you unit tests are not over-engineered.
They have their use at times, but you should always make sure that your unit tests are not over-engineered.

==========
location 1459-1460
Most times it is a collection of objects, a tree-structure, a graph or any other
Most of the times it is a collection of objects, a tree-structure, a graph or any other

==========
location 1827-1828
def "If one sensor is active the alarm should sound as a precaution"() { given: "that only fire sensor is active"
def "If one sensor is active the alarm should sound as a precaution"() { given: "that only one fire sensor is active"

==========
location 1837-1838
def "If more than one sensors are active then we have a fire"() { given: "that two fire sensors is active"
def "If more than one sensors are is active then we have a fire"() { given: "that two fire sensors is are active"

==========
?
Filiep
Kostis Kapelonis (63) [Avatar] Offline
#2
Hello Filiep

Thank you for purchasing the MEAP and for taking the time to note down these mistakes. I am not a native speaker as well, and your post has perfect timing, because I am now collecting several typo mistakes that have been brought to my attention.

I was thinking about explaining more about duck typing, but I didn't want to confuse Java readers with a Groovy feature that is not really essential for Spock testing.
But you are right, at least some minimal explanation is needed.

The nuclear example took indeed some thought. It was my second attempt. My first attempt was with a fighter plane but because this might offend some readers
I changed it to the reactor smilie

Regarding Expandos, I may remove them in the end, since Spock mocking is enough for most cases. They also need some more explanation but chapter 2
was already very big. (There is a hard limit for chapters to be 30-35 pages).

I will correct everything you mention!

Kostis