June 2018
Beginner
722 pages
18h 47m
English
This is always the question any programmer thinks about every time a new method is written or an old method is modified—How many unit tests are enough to make sure that the application is thoroughly tested, and what kind of tests should they be? Typically, it is not enough to have one test for each method of the application. There are usually many aspects of functionality that have to be tested. But each test method should test only one aspect, so it is easier to write it and to understand.
For example, for our simple multiplyByTwo() method, we could add another test (we would call it multiplyByTwoRandom()) that picks a random integer number as an input into the method and does it a hundred times. Or, we could ...
Read now
Unlock full access