Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my experience writing tests is generally an outstanding method to determine code quality.

If a test is complicated or coverage is hard to achieve, it's likely your tested code needs improvement.



Testability of code is indeed a good benchmark for code quality. The things that make it hard to test code are also the things that are associated with low quality code.

Something with low coupling, high cohesion, and low complexity should be easy to unit tests.


Competitive programming code is extremely easy to test, but many would argue it isn't high quality.




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

Search: