Saturday, December 5, 2015

Don't test Private Methods

I would like to share with you guys an article that form me is pretty interesting. The sentence to remember is the following one:
Private methods are for hiding implementation and we don’t want to test implementation details when we do TDD, that’s better achieved as part of a QA effort, if needed.
You can read the complete article here.

Good unit tests are the backbone of successful TDD. Keep the following in mind as you write unit tests: ‚
  • Each unit test should be independent. ‚ 
  • Each unit test should test one aspect or behavior and document the expected behavior. ‚ 
  • Each unit test should not verify too much functionality. ‚ 
  • Each unit test should not be dependent on interface.

Have a nice day!

You can see the original article at java Dzone

No comments:

Post a Comment