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

Right. And that's what I, and most other people who unit test, do. The unit test says nothing about how the object is implemented though - that's your job. As far as the unit test is concerned, the function is a black box. The unit test isn't concerned with the details of the implementation.

For testing side effects (like the function's effect on a database) you sometimes work outside the function's parameters and return values. But the point remains - you are looking at what behavior the function exhibits from outside it.



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

Search: