Let’s say you work on a micro service/lambda. You start with TDD and slowly work your way up to higher level tests and application.
As you navigate higher do you end up with all the unit tests you have written throughout or at some point some become obsolete due to integration tests?
My example I have written previously is:
let’s say an endpoint needs to fetch data from other service
I write a test and function that will make http request and give data back
I write test for endpoint that modifies that data from that function above
I write implementation
Depending on how I write the test in step 3, I either mock function from step 1, or HTTP layer again same as in unit test for data function. With latter the unit tests feel like it is obsolete. Yes you probably are losing more granular feedback but then test is better? Plus if I change the function/module in step 1 but data remains same - I don’t have to change tests anymore.
I am still trying to narrow down my exact hypothesis 😀
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have a hypothetical question:
Let’s say you work on a micro service/lambda. You start with TDD and slowly work your way up to higher level tests and application.
As you navigate higher do you end up with all the unit tests you have written throughout or at some point some become obsolete due to integration tests?
My example I have written previously is:
Depending on how I write the test in step 3, I either mock function from step 1, or HTTP layer again same as in unit test for data function. With latter the unit tests feel like it is obsolete. Yes you probably are losing more granular feedback but then test is better? Plus if I change the function/module in step 1 but data remains same - I don’t have to change tests anymore.
I am still trying to narrow down my exact hypothesis 😀