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

> breaks whenever a minor internal detail changes.

This is usually where I draw the line for what to test. I don't care how a unit does what it does, I only care about what it does.

In my opinion a unit should have minimum side effects, none if possible, and the results should depend on the inputs. Write the test to the contract of what the caller should provide and caller will get back (and then any side that had to happening, like checking logs.)



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

Search: