choderalab / software-development

A primer on software development best practices for computational chemistry
262 stars 78 forks source link

Mention Hypothesis in the advanced unittesting section #75

Open pckroon opened 4 years ago

pckroon commented 4 years ago

Hi all,

thanks for the clear and concise write-up. I suggest adding/mentioning hypothesis [1] in the advanced unittesting section. Hypothesis is a library designed to generate arbitrary non-random input for tests, and works well together with pytest. It greatly helps to find edge cases in your code, and helps you avoid cases where your code works for the tests and use-cases /you/ thought of, but not the uncommon cases you forgot (e.g. nan, inf, multibyte unicode, ...). It's helped me find dozens of sneaky bugs that I would've otherwise missed. Their sales pitch is better than mine though, and I suggest having a look at their documentation for better examples.

[1] https://github.com/HypothesisWorks/hypothesis

Related: #46