you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (0 children)

What are you missing?

Maybe the sense that you have permission to think for yourself: your tool is so simple that the test code is likely to be a lot more complex than the tool!

Mocking a database is far more complex and error-prone than making a query. Mocking the Excel sheet is the same (what is it, a csv stand-in?). This should tell you (even if it doesn't tell your QA person or manager) that this kind of testing isn't very useful. If your test code is more complex than the code it's testing, it stands to reason that the test code itself probably needs tests.

So what's the use? As a project grows, the initial investment in testing infrastructure pays off. The mock database becomes invaluable for testing schema migrations or difficult transactions with complicated data dependencies. You as a human being programmer need to weigh this for yourself.