O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction

Well-tested code provides a peace of mind to the developer. If you get a feeling that writing a test for the new method you are developing is too much of an overhead, then you usually don't get it right the first time.. This is because you have to test your method anyway. Doing this in the context of the application only requires time to set things up (especially if you are trying to test all the possible input and conditions). Then, if the method changes, you need to redo the setup again. And you do it manually. You can avoid this by creating an automated test at the same time you were developing the new method (we assume not-too complex code, of course; setters and getters do not count). This would save you time in the long ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required