I'm reading The Art of Unit Testing by Roy Osherove. I'm at section 7.2 Writing maintainable tests where the author has this note about code smell:
NOTE: When you refactor internal state to be visible to an outside test, could it be considered a code smell (a sign that something might be wrong in the code's design or logic)? It's not a code smell when you're refactoring to expose collaborators. It's a code smell if you're refactoring and there are no collaborators (so you don't need to stub or mock anything).
EDIT: What the author means by "collaborators" is dependencies. Some of his examples for dependencies are classes that access a database or that access the OS's file system. Here is where he defines stub and begins to use the word collaborator:
A stub is a controllable replacement for an existing dependency (or collaborator) in the system.
The author doesn't have an example of this code smell and I'm having trouble understanding/picturing what this would look like. Can someone explain this a little more and perhaps provide a concrete example?