Groovy Khan (@GroovyKhanTips) profile picture
Sydney
Joined September 2017
Great Article: "Common Excuses Why Developers Don’t Test Their Software". So many excuses to learn! hackernoon.com/common-excuse…
4
6
100% code coverage only means that someone really thought about each bit of the code base. Who would do it?
Don't write tests. You know the code works! You know you are genius!
2
2
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
Is writing tests slow? Or fixing the bugs discovered by the new tests is slow?
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