lkorczowski / Tinnitus-n-Sleep

Detecting events in sleeping tinnitus patients
MIT License
1 stars 0 forks source link

Good Pratice: pytest each parameters #59

Open lkorczowski opened 4 years ago

lkorczowski commented 4 years ago

For each function, we should design a guideline of pytest to do (avoiding future issue like #58 )

Pytest should consist of (example for the function f(a,b,c=1)= (a+b)/c

PYTEST CHECKLIST

Note that with this simple function, we already have 5 different pytests but it growth quickly.

The important catch here is doing pytest while coding the function is done quite fast. However coming back to the function after takes one order of magnitude more time to do it. Actually, according to Scrum of Jeff Sutherland, around 24 times more time, e.g. 1 hour of pytest while coding takes 3 working days to make it right the second time. And that, without counting all the possible unseen mistakes+re-catching the code.

I need to add that somewhere in the guideline of CONTRIBUTING.md

Meanwhile this issue will stay open.

Now, we should consider while reviewing PR to check that ALL of the mentioned tests are included.

EDIT:

PYTEST SANITY CHECK

we shouldn't test results again results that are validated by another function's pytests. example: