Hacker News new | past | comments | ask | show | jobs | submit login

Tests written for pure functions are great. Tests written for everything else may be helpful but might not be.



You need tests for all part of the functionality you care about. I write tests for making sure that what is persisted is what we get back. Just the other day I found a bug due to our database didn't care about the timezone offset for our timestamps.


Not suggesting that testing other things isn't useful but not as straightforward and not as obviously beneficial as pure function testing. It is easy to just dogmatically pile on tests but they may not be helpful.


I’d say, as beneficial. But as you say, not as straightforward. One if the reasons functional programming is popular is because it makes it easier to test, but it’s not that other code needs less testing.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: