Great Article: "Common Excuses Why Developers Don’t Test Their Software". So many excuses to learn!
hackernoon.com/common-excuse…
100% code coverage only means that someone really thought about each bit of the code base. Who would do it?
Finding true in @spockframework is difficult. Put following method as the very first one and you'll see:
void 'slooooow'() { expect: true }
1
Not sure if your code contains bugs? Rather wrap it in following condition so it gets *executed*
if (!stuff instanceof Something) { foo() }
1
It is Friday afternoon. Just annotate that failing @spockframework test with @PendingFeature. Your code coverage will still get increased!
Always use [item] if you never intend to add more items to the list. Collections.singletonList('item) is so chatty and optimal!
Always use [foo: 'bar'] if you never intend to add more items to the map. Collections.singletonMap('foo', 'bar') is so chatty and optimal!
Do you want to make your @spockframework tests run faster? Add @IgnoreRest to the fastest feature method and instant victory is yours!
1
