- 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
Wednesday, May 30, 2018
Junit best practice
Subscribe to:
Post Comments (Atom)
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...
-
“Snagit is the most useful tool you will find to combine pictures, words, and other objects into a meaningful illustration…”
-
Sometimes just to get a quick success build you might need to disable/ignore/skip some of the munit test cases. you can do you by double ...
-
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...
No comments:
Post a Comment