Where should I draw the line between unit tests and integration tests? Should they be separate?
Posted
by
Earlz
on Programmers
See other posts from Programmers
or by Earlz
Published on 2012-10-29T04:03:37Z
Indexed on
2012/10/29
5:20 UTC
Read the original article
Hit count: 390
I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for it(yes, I know I should've been doing that all along, but it's API was super unstable up until now)
Anyway, my plan is to make it extremely easy to test, including integration tests. An example integration test would go something along these lines:
Fake HTTP request object -> MVC framework -> HTTP response object -> check the response is correct
Because this is all doable without any state or special tools(browser automation etc), I could actually do this with ease with regular unit test frameworks(I use NUnit).
Now the big question. Where exactly should I draw the line between unit tests and integration tests? Should I only test one class at a time(as much as possible) with unit tests? Also, should integration tests be placed in the same testing project as my unit testing project?
© Programmers or respective owner