Saturday, March 29, 2014

Are Spock and others dead?

I've been looking for a good alternative to writing unit tests, maybe in a more BDD-like form, or just to get some fresh perspective on how one could do unit tests. I think it's because me getting old and the middle-life crisis hitting on me :) And so I examined a few of the usual suspects in the Java space...

Spock

Some time ago I was extremely inspired by Spock. It was The Way to do unit tests. The introduction of a table-like construct to do multiple data-driven tests, labels for given/when/then template - that was awesome! I was hoping Peter Niederwieser would keep working on it forever but since he joined Gradelware his talent seems to be occupied elsewhere and Spock seems to be discontinued.

Fest Assert

I remember the time when Szczepan showed us fest-assert framework in action. Szczepan was well known for his passion for fluentization of all possible interfaces - which I strongly admire - but this, this was the real deal, the perfect combination of why and how to do things. I fell in love with this library, even started to create a .NET port of it and I'm still a fan. But it's been discontinued too. Luckily it's been picked up by Joel Costigliola and is being developed further as AssertJ. I sure hope this will keep being maintained!

TestNG

Now that's a fresh start I'm going to try to pursue. New annotations, a bit dangerous in what it tries to accomplish with the dependency on tests (I always hated that) but I'll try to give it a shot. And it's still maintained which is makes it stand out among other frameworks.

Geb

Now that's a good example of something one should never had created - a DSL to tackle a DSL. Wrr... I thought it couldn't get any worse but then I found...

Fluentlenium

Well,... It seems like someone tried to kind of repeat the success of fest-assert and got it wrong. I tried it and it is just... wrong.

Conclusion

From what I've been able to figure out in a few hours it seems like only TestNG is the only actively developed alternative to JUnit and one of the very few frameworks in the testing space that actually makes any advancements. But hey - I might very well be wrong. If you can share a link to something revolutionary in the testing space drop me an email ad padcom (at) gmail (dot) com or leave a comment below.

Happy testing!


1 comment:

Unknown said...

Just saw Peter Niederwieser a few weeks ago at SpringOne in Dallas. Spock is very alive and well. It's been integrated into core Grails now so that when you create a Domain or Controller class it by default generates a Spock Spec class for you. So, now that Pivotal (owners of Spring/Grails) now have vested interest in Spock, I'd venture to say it will just get better verses die out.