S
S
Sergey2017-12-23 15:33:26
Python
Sergey, 2017-12-23 15:33:26

How to properly test the code?

Good evening!
While reading the code and thinking about how to test it, I came across this:

import pandas as pd

start = # ... pd.Series
a = # ... pd.Series
b = # ... pd.Series
# ...
var min_div = a.min().div(b.min())
var avg_div = a.avg().div(b.avg())
# ...
return min_div, avg_div

Immediately the question is: how to correctly cover the calculation of min_div and avg_div with tests? Just cover input values ​​(equivalence classes, GI)? It's confusing that the min, avg, div methods are library (pandas) methods and should they be covered with tests? After all, if you need to test these functions as well, then (and there are a lot of variables like min_div, etc.), the number of tests will greatly increase. Perhaps there is some correct solution ...
Dear experts, help me test the code correctly :)
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2017-12-23
@dimonchik2013

you yourself determine what to cover
if the average and minimum are periodically calculated incorrectly for you (gee gee) - cover Panda
but before - cover the input data check

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question