About testing private methods

I’ve loved the next sentence, read here:

The more tests the more attention they need. We can reduce the time we spend on nurturing by writing test only against public method. Public methods are contract. If we specify some contract we will rather not change it as often as private methods. If you feel that you have to test private method it is a sign of a bad design (it’s called “code smell”). Probably functionality of this method belongs elsewhere.

3 thoughts on “About testing private methods

  1. Lavina

    I see a lot of interesting articles on your website.

    You have to spend a lot of time writing, i know how to save you a lot of time,
    there is a tool that creates high quality, SEO friendly articles in couple
    of seconds, just type in google – k2 unlimited
    content

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>