2 ms·
Re: trust issues...I'd argue this is the purpose of automated tests. I think tests are too often left out of architectural discussions as if they are some addit
by jreback 2y ago
Re: trust issues...I'd argue this is the purpose of automated tests. I think tests are too often left out of architectural discussions as if they are some additional artifact that gets created separately from the running software. The core / foundational / heavily reused parts of the architecture should have the most tests and ensure the consumers of those parts has no trust issues!
- K0nserv 2y agoTests are good but moving left by lifting invariants into the type system is better. Compare fn send_email(addr: &str, subject: &str, body: &str) -> Result<()> to fn send_email(add: &EmailAddr, subject: &str, body: &str) -> Result<()> In the second case, the edge cases of an empty or invalid email address don't need to be tested, they are statically impossible.
- galangalalgol 2y agoThanks for the small concrete example. I try to explain this a lot. It also makes coverage really easy to get with fewer tests.