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

Typically this would be answered in a unit test like this:

This would be a really bad way to test all of "create a user, assign the user as an administrator, log off of the root admin, log in as the new user, create a product, delete a product, get the product list and verify the product isn't on the list".

You would be ignoring 80% of the flow.

The goal of unit testing is to test each piece in isolation and to provide confidence that when you have to assemble a lot of little pieces of code to form a larger piece of functionality, that each of those little pieces is working as it's contract says it should.

If your integration test containing 8 steps failed, would you know which piece of the puzzle caused the failure from the integration test report itself?

Of course, you could go the route of testing both small pieces of functionality and also testing large pieces (the integration tests), so that you can have overlapping levels of confidence.



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

Search: