JUnit test resources and best practices?

Hey all,

I’ve come to the point in my progression as a developer where my code is massive and incredibly hard to make stable. After listening to several hundred hours of podcasts I’ve determined that I really should adopt test driven development as a way to overcome these hurdles.

However, It seems there are hundreds of tutorials and frameworks on the googles, and each are slightly different from the other. Given that I have no practical experience writing unit tests and my current build environment is:

  • Java 8
  • dependencies are handled and project is built using gradle
  • IDE is Eclipse
  • Many of my class methods are mathematical in nature

Do you have any specific suggestions which might lessen the learning curve a bit?
thanks!
-el_min

Test stuff in-game. Its too painful to write decent tests for something build on sponge platform

I have done a bit of work on a private Sponge-based testing framework. It can simulate pretty much everything, except players. I’ll see if I can get it published some time this week.

3 Likes

Seems like an extremely useful tool, and potentially relevant to the worldgen stuff I’m doing.

@NeumimTo I suppose I meant more at how to use JUnit and all the deluge of annotations, assertions, mock objects etc;. The problem I’m trying to debug is with a procedural gen framework that is 100% independent of sponge and MC itself, I’ve just never had to write a unit test before.