Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop Mocking Everything! #64

Open
bbengfort opened this issue Jun 30, 2016 · 2 comments
Open

Stop Mocking Everything! #64

bbengfort opened this issue Jun 30, 2016 · 2 comments

Comments

@bbengfort
Copy link
Owner

The mocks are causing more trouble than they're worth in testing; only mock exactly what needs to be mocked, e.g. anything that will do anything destructive. (Probably just the environment?)

@keleher
Copy link
Collaborator

keleher commented Jun 30, 2016

huh?

On Thu, Jun 30, 2016 at 11:18 AM, Benjamin Bengfort <
notifications@github.com> wrote:

The mocks are causing more trouble than they're worth in testing; only
mock exactly what needs to be mocked, e.g. anything that will do anything
destructive. (Probably just the environment?)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#64, or mute the thread
https://github.com/notifications/unsubscribe/ABA4WBQ8KhVstC7JySRRt9dExcJzsm_Qks5qQ95VgaJpZM4JCReM
.

@bbengfort
Copy link
Owner Author

@keleher in my testing package I use mock objects to eliminate side effects like writing log messages or overwriting files or databases.

When I first started writing the tests I thought it would be easier to mock things at the high level (e.g. a replica, the simulation, the results, the logger, etc.) -- however, I keep breaking tests as the complexity of the simulation increases because the mock objects need to do more work for tests to pass.

I'd rather be working on research than fixing my tests, so going to do less mocking and more integration style testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants