Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 2
    Not sure why this answer has been downvoted. It is short, to the point and 100% spot-on in its advice. Commented Nov 17, 2017 at 17:12
  • This is a very clear answer, thank you. I think the issue (credit to @Samuel for mentioning it fist) is the issue of weather or not the public interface has changed. Commented Nov 17, 2017 at 22:44
  • Downvote because this is not complete. Even if the new functions were not part of a public API, writing tests can be very helpful. Say a test for do_everything() fails: where is the error? If you have tests for all three sub-functions it will be way easier to find. That's a benefit of writing the tests and it should be mentioned here. Commented Nov 18, 2017 at 13:25
  • 1
    @marstato: It is generally considered a bad idea to unittest private methods, since it couples the tests to implementation details. Commented Nov 18, 2017 at 15:14
  • @JaxquesB That's not generally a bad thing. You could say that anything more precise than a usual integration test is tied to implementation detail. But you write those tests anyways because they help you track bugs, not because they help you prove correct functionality. The access modifier is always subjective. A private keyword in a programming language is just one of many ways of restricting access to a piece of code. Commented Nov 19, 2017 at 1:41