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.

2
  • Changing the scope just for testing is vile, public or not. Commented Oct 19, 2014 at 16:39
  • 1
    No, unit tests in their pure form are supposed to determine whether a given unit viewed in isolation conforms to its specification. As private helpers can never be part of an API specification, there is no use in unit testing them, or mocking private helpers in a different unit's test. However, I take the position that it can still be useful to test private helpers to determine whether they conform to this unit's programmer's expectations, and because fine-grained tests make it easier to localize errors. Commented Oct 19, 2014 at 20:36