DSGT-DLP / Deep-Learning-Playground

Web Application where people new to Deep Learning can input a dataset and toy around with basic Pytorch modules without writing any code
MIT License
26 stars 8 forks source link

Adding Unit Tests for dl_eval.py #854

Closed codingwithsurya closed 1 year ago

codingwithsurya commented 1 year ago

This pull request introduces unit tests for the compute_correct and compute_accuracy functions. These tests utilize the pytest framework and incorporate "dummy tensors" to simulate various input conditions.

Adding Unit Tests for compute_correct and compute_accuracy Functions in dl_eval.py

What user problem are we solving?

The current lack of unit tests for the compute_correct and compute_accuracy functions in dl_eval.py presents a potential risk of undetected bugs or errors. By addressing this issue, we aim to ensure the accuracy and reliability of these functions, leading to improved overall code quality and performance.

What solution does this PR provide?

This pull request introduces unit tests for the compute_correct and compute_accuracy functions. These tests utilize the pytest framework and incorporate "dummy tensors" to simulate various input conditions. By evaluating different scenarios and edge cases, we can confidently assert the correctness of the functions and identify any potential issues.

Testing Methodology How did you test your changes and verify that existing functionality is not broken

During the testing process, I executed the unit tests from the command line interface and verified that all test cases passed without any failures or errors. This confirms the correctness of the compute_correct and compute_accuracy functions in dl_eval.py.

Any other considerations N/A

codingwithsurya commented 1 year ago

parametrized testing please

@karkir0003 just commited new changes implementing this. Lmk if its good.