[plot_missing_vals] Write unit tests and function body
JohnShiuMK opened this issue · comments
plot_missing_vals
: Plot tick chart to display missing values for all numeric features in the dataset.
- (if needed) revisit your function specifications from last week and revise them
As you do this, think critically about what function inputs you expect from the user and what your function is supposed to do (e.g., return). The function should be written defensively. That is, it should handle incorrect input and errors detected during execution via throwing exceptions with useful error messages.
- Create
tests/test_plot_missing_vals.py
- Write unit tests
test_xxxx
: include in total 3-5 edge for the function
The unit tests should test at least 3 to 5 edge of the most important cases to ensure that the function returns what is expected to the user. It should also test for expected errors. When writing your tests, build them around your function specifications and requirements.
- Write the internal code for the function
Write function code and tests in close temporal proximity with each other. The process of writing function code and test cases will be iterative; there will be several rounds of writing tests --> function improvement --> writing more tests --> function improvement --> writing more tests --> function improvement, etc. Make sure that the tests cover all code branches (e.g., if your function has an if statement, you should have tests where the if statement is true, and where the if statement is false.
- Document your test functions.
- Check whether the code passes the unit tests you have written using the
poetry run pytest
As you develop your code and test cases, update your code documentation so that it makes sense with any of the changes you have made. Do not forget to also document your test functions. Check whether the code passes the unit tests you have written using the pytest package for Python packages.
Done, thanks @jbarns14
Closing issue now