How do you learn to write good unit tests? Asking for a me. (Integration tests too)
-
-
Replying to @badnetworker
IMO A big part of it *requires* working in teams. Writing unit tests for your solo project is good practice that yields good code, but unless you put down then revisit whatever it is you were testing months later, you never get good feedback.
1 reply 0 retweets 0 likes -
Replying to @generativist @badnetworker
However, if your working on a team project; someone's change breaks code without violating a test; you get good feedback (a new test, complaint, or blame). Or, if every little change fails a test but doesn't violate semantics, you get good feedback.
2 replies 0 retweets 0 likes -
Replying to @generativist
Yeah, this was prompted by working on Mesa, where a PR passed the tests but broke most of the example models, which is a sign that the tests are.... not great.
1 reply 0 retweets 2 likes -
Replying to @badnetworker
Ah, yea. I hate that experience. Do you run all the models in your travis? (It reports failure for any executed scripts bad exit code! Really useful for a few of my CLI packages' tests.)
1 reply 0 retweets 0 likes -
Replying to @generativist
No, just the tests at the moment. But that's probably the way to go.
1 reply 0 retweets 1 like
Ah. I have a few integration tests in some of my simulations for that. @pytestdotorg is really nice for it too. I have either markers or subdirs as
/unit
/integration
/model_verifications <- [expectations from analytical sessions, codified]
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.