views:

19

answers:

1

Sometimes integration tests are rather complex to write or developers have no enough time to check output - does it make sense to write tests that make sure "no exceptions are thrown" only? Such tests provide some input parameters set(s) and doesn't check the result, but only make sure code not failed with exception?

May be such tests are not very useful but appropriate in situations when you have no time?

+1  A: 

An integration test is basically the same as a unit test albeit more complex more involving due to the significant extra components. Unit tests are all about providing some inputs and asserting some results be they values or exceptions etc. The same should be applied to your integration tests. At worst at least test that the actual outcome makes sense instead of just assuming no exceptions means its ok. Such an assumption is extremely poor practice and smells of laziness or perhaps lack of thought about the approach.

mP
I totally agree but wonder how to check output word documents for example. Shall it be binary comparison?
Andrew Florko
You could always read the doc back in and do some elementary scanning for text. Binary compares will fail because docs will no doubt include timestamps and other invariants.
mP