Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
dan-pud8236yMicroservices or other architecture should have no bearing on whether you write unit tests or not. All code written should be unit tested. Even better if TDD. -
joas18506yIf you have full coverage with integration tests then I don't think you need unit tests. But usually that's not how integration tests work, right? -
asgs109216yWhy does writing unit tests have to involve copying a method?
All that your unit tests should do is ensuring the contract is honoured -
LMagnus20316yIs it always necessary to wear a condom? Feel like I'm just putting one on every time. -
Depends on what the service does. If it runs a custom algorithm, test that. If there is SLA, test to make sure it's satisfied. Make sure you get errors where expected so as to avoid unexpected input.
Related Rants

Two unit tests, no integration tests.
He's got a valid point
Is it actually required to write unit tests in microservices?
every time i write them it feels like im just redundantly copying a method...
Dont get me wrong, im not against testing, I am using test environments, integration tests and mocks, but unit test seem kinda redundant to me.
question
unit testing