|No such thing as a small change
Re^2: Testing: To Mock or Not to Mock?by agianni (Hermit)
|on Nov 09, 2007 at 14:17 UTC
I agree that exhaustive testing along those lines would be ideal, but it's not usually a reasonable option. My current project includes over 40k lines of Perl code and nearly that many lines of tests and I can't imagine how much more time it would take to implement full-stack integration testing.
I'm curious, though, about the value of integration testing to full depth. For example, if I have some code where sub A calls sub B, which in turn calls sub C, why do I need to test the full integration of these? Rather, why can't I just test the integration between A and B and the integration between B and C and suggest that I have testing the integration between A and C transitively? Might there really be situations where that would not suffice?
That said, backing up your mocking at least one level for the sake of integration does make a lot of sense, and I hadn't thought of it in such an specific manner before. Thanks for your input!