Wednesday, May 30, 2018

Junit best practice

  • Don’t aim at unit testing each method in the SUT. Unit test only the publicly available API.
  • When writing unit tests, mimic the behavior of the SUT’s clients.
  • Don’t test private methods. Either unit test them indirectly, using the public API, or extract them into separate classes and test those classes instead.
  • Don’t hesitate to unit test internal classes as long as you follow the guidelines above
  • Test data should  kept and read from a file instead of string variable


Unit Test Naving Conventions: 


No comments:

Post a Comment

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...