lundi 25 avril 2016

How to unit-test third-party library wrappers?

Everyone tell Don't mock what you don't own. They recommend to make a wrapper for 3rd party library instead.

But how do I test this wrapper?

I mean, if I write unit tests for it and will mock those 3rd party interfaces to test my wrapper, nothing will change. If library maintainer will change its API I will face same problem - tests for mocked lib will go fine and software will fail in production environment. What is the advantage for reliability or testability here?

I know there is advantage for code quality because I could exchange this library whenever I want, but it is not subject of this question.

Thanks.

Aucun commentaire:

Enregistrer un commentaire