Are you keeping your code safe by unit testing with tools like JUnit, TestNg and Mockito? Unit tests let developers internally control the functionality and compatibility of their applications when they made changes to features, code or the environment.
You can think of it this way: Each time you enter your car and start it up, you take a look at the instrument panel/dashboard, almost automatically. Even older cars are equipped with warning lights, some less serious (like that you need to fill gas), some more serious (like the battery status) and some highly critical (like the engine-is-gonna-explode warning light).
So if you see something wrong, like the “check engine” light is flashing an angry red warning, it probably wouldn’t be wise to start driving away. In a similar manner unit tests act as warning signals that something does not work as expected. it wouldn’t be wise to deploy code into production when all your unit tests are failing. But unit tests are just that, early warnings and internal checks that your code does what is expected.
In this latest report from Rebel Labs entitled Go Away, Bugs! Keeping Your Code Safe with JUnit, TestNG and Mockito, we build on previous research and years of experience to deliver you over 30 pages of code, examples, suggestions and tips. Here’s a basic outline:
- Introduction – Keeping Your Code Safe with Unit Testing
- Part I – JUnit and TestNG for Advanced Guru-types
- Part II – Figuring Out What to Test…
- Part III – Setting Up Mock Alternate Realities
- Part IV – Mockito for Advanced Users (woohoo!)
- Too Long, Didn’t Read (TL;DR) – Summary, Conclusion, Farewell and a Comic
Download the full report at Rebel Labs, ZeroTurnaround's content & research division: http://zeroturnaround.com/rebellabs