I´ve read here that black-box-testing (testing just the API without implementation-details) is prefered in most situations. However if I write only black-box-tests where I do not care for the actual implementation from where do I know how to handle any dependencies of the method to test? Imagine we make a database-call in our method to test. Usually I would fake that call in a way that allways returns some fake data in order to test if my own method handles that data accordingly. Within my test I don´t care from where the data actually comes so I fake it.
On a black-box I do not know what to fake and how to do it, whereas on a white-box I know the internals and therefor which calls to fake.
So my question is: is dependency-handling any relevant to black-box-tests at all?
Aucun commentaire:
Enregistrer un commentaire