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

Unit tests are useful if you write them alongside new code, but then become not useful since if you never change the code, they never break, and so are wasteful.

It's better to have tests more sensitive to failure, like integration or regression tests.




They’re still valid even if you aren’t changing code.

The key there is caching your results. Don’t run unit tests for code that hasn’t changed.

They still serve the important purpose of checking validity of the code under test though, so if they do get modified downstream at some point and they fail you then know the changes aren’t conforming to expectations of the system.

This of course assumes people aren’t writing highly coupled tests and that is more rare than I wish it to be




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: