coding-for-reproducible-research / CfRR_Courses

Home Repository for the CfRR website
https://coding-for-reproducible-research.github.io/CfRR_Courses/
5 stars 2 forks source link

Comprehensive Testing Scenarios and Best Practices #57

Open berrli opened 5 months ago

berrli commented 5 months ago

Motivation

Understanding how to write and implement tests is critical for ensuring code reliability and maintainability. However, beginners often struggle with writing effective tests and understanding best practices. Providing comprehensive testing scenarios along with best practices can help learners develop a solid foundation in testing.

Output

An expanded section on the "Python Testing" page that includes comprehensive testing scenarios and best practices. This section will provide detailed examples of various testing techniques, including unit tests, integration tests, and mock testing, along with guidelines for writing and organizing tests effectively.

Considerations / Notes

By integrating these comprehensive testing scenarios and best practices, learners can gain a deeper understanding of testing methodologies and how to apply them effectively. This approach will enhance their ability to write robust, reliable, and maintainable code.

amyheather commented 4 months ago

I've add some notes on pytest and an example of a test in commit 98371c5 - although this example I've included might be a bit complex?

thawes-rse commented 4 months ago

@berrli The topics you list could easily fill a whole course and some of them (e.g. mocking) are quite advanced. Maybe they would fit better into a course on testing?