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

have to disagree here...

not writing unit tests means architecture change will break your integration tests. hence, you don't have coverage left during an architecture change.

typing information on a unit (class or function) is nice, except it doesn't find all bugs. If it were to find all bugs about a unit, it would be a complete type checker ( which usually comes in a system like https://en.wikipedia.org/wiki/Isabelle_(proof_assistant), etc, which is a pain to use... )

thus the only "efficient way" to cover the gap between type information and a full blown type checking system are unit-tests.

integration test run slower, hence, you are also wasting more time.

integration test are more difficult to understand by other people, especially if they break.

integration test are generally less stable than unit-test because they involve more units.

integration tests usually don't cover all (error) scenerios of the involved particular units. you do that in unit-test to get the branch coverage to 100%.

his issue regarding mocking potentially can be solved differently. change your interfaces and code architecture such that you minimize mocking and make unit-testing easy. i.e. experiment moving the boundary between units.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: