An intuitive interaction-testing implementation #2189
Replies: 1 comment 1 reply
-
I agree that getting the interactions right is often not the most intuitive thing, but I don't think there can too much be done without dropping significant functionality and breaking most tests using interactions out there. The limitations are because of how it is implemented, yes, but changing this would most probably be a huuuuge refactoring of the implementation logic. Feel free to try implementing something that makes it feel more natural to you, but I think it will be a very non-trivial change and most probably not something you will finish for 2.4 from what my gut feeling tells, if Leonard at all will accept it to the codebase in the end. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
The first time I knew about Spock, it took me 5 minutes to fall in love with it and decide it was the testing framework I would use from that moment on. And I haven't used anything else since then.
One of the most valuable features of Spock is its intuitive way of expressing specifications. It's so easy to read and understand them that they also serve as documentation.
And then you try interaction testing.
I am aware of the technical reasons behind it, but the behaviour of interaction testing is (at least to me) counterintuitive. And this is IMO the opposite of what Spock tries to provide.
I'd say the reasons roughly boil down to two:
I have been thinking about it, and IMO, these limitations come from the way it's been implemented, not from any functional design decision or testing formalism. I also think it wouldn't be that difficult to implement an intuitive behaviour, so let me summarise my take on an intuitive way to implement it:
There must be many things I'm missing, but this proposal feels sound and relatively easy to implement, to the point that I could even consider contributing to it, if my limited time allows.
More importantly, now that you are about to release Spock 2.4 it's precisely the right time for a bigger change like this.
Sorry if this topic has been raised too many times before, but to me, this is the most important improvement to make Spock the Most Intuitive Way to specify behaviour and testing in the market.
Thank you very much for your fantastic work.
Beta Was this translation helpful? Give feedback.
All reactions