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

Cleanup tests #188

Open
drahnr opened this issue Jun 18, 2017 · 4 comments
Open

Cleanup tests #188

drahnr opened this issue Jun 18, 2017 · 4 comments

Comments

@drahnr
Copy link
Owner

drahnr commented Jun 18, 2017

Tests should be atomic and optimally do no file IO.

@MBanucu
Copy link
Contributor

MBanucu commented Jun 18, 2017

Atomic

The problem is, that replacing private functions called in a public function can't be replaced. So if we define "atomic" as "call only one public function", then I agree. But if we define "atomic" as "only one function should be called without any further/deeper function calls" or "only 50 locs at once", then I disagree.

no file IO

If the out-interface of the function under test is only/includes file IO, then I would say that file IO is okay. In the case of ngspice-watcher we ware lucky, because the content of the file is also stored in the ngspice object (in RAM) and we can use that data to assert function equality. BUT I would also like to test the file IO-interface of ngspice-watcher so in the end we have to think about how to handle file IO in test cases.

@drahnr
Copy link
Owner Author

drahnr commented Jun 18, 2017

Atomic

Only one public function was what I meant.

IO

Then file IO is still supposedly separate, unless it is really vital to the test itself.

@MBanucu
Copy link
Contributor

MBanucu commented Jun 25, 2017

The modified tests of pull request #193 are atomic and file IO is used at a minimum. The tests need file IO because the input and output of the tested function includes file IO. The paths to the files are constructed to work on any build or test system.

@MBanucu
Copy link
Contributor

MBanucu commented Jun 25, 2017

If someone has further suggestions which tests can be created or how the assertion parts should look like, tell it to me.

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

No branches or pull requests

2 participants