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.

Required fields*

1
  • You certainly can (and will more often than not) add new behaviour without changing the interface. I think what you mean is add new behaviour without changing the return value for a given input, implying an impure function - they can only be tested by asserting on their side effects. Then you're left with either or both of test doubles (so you can assert on the interactions with collaborators) or real behaviour - the latter leaves you freer to refactor, but comes at a cost of test complexity and speed. Commented Dec 30, 2022 at 14:50