I am struggling with the concept of BDD mixed in with TDD at the moment, particularly when tests overlap.
Such as let’s say I have a unit test verifying that when I add two numbers together it returns the sum. Next unit test says that when I multiply two numbers together, it returns the product.
The requirement from the customer is that they must be able to multiply and add numbers at the same time. Writing this Behavior test effectively overlaps the two unit tests, already testing those features. There’s a good chance that a behavior test like this could identify a problem with the requirement of being able to add and multiply at the same time... so I feel it is useful.
But I feel like some people may consider this test redundant, because like I said it is technically overlapping unit tests... is this normal and acceptable?
Also, what about behavior tests that are using mocks and not the real system? Looking online it appears there’s no harsh requirements on that, but I feel if the scenario is specific enough it’s perfectly fine to use mocks?
Aucun commentaire:
Enregistrer un commentaire