DEV Community

Discussion on: Leaky abstraction and clean architecture template

moesmp profile image
Mohsen Esmailpour Author • Edited

If you are developing a todo sample app, I completely agree with you but in a real-world application, with a complex business, you need to write unit tests and also unit tests can be replaced with integration but spending extra time for running integration tests and makes the ci/cd pipeline much slower. This sample is borrowed from clean architecture template Github repo and it's not a good use case for implementing a unit test to test business logic and I used it to show when you have such an abstraction and if you want to write a unit test, lot's of effort is need to mock the leaked data access. I would be glad if you provide a sample code that repository can cause leaky abstraction.

About NotFoundException, as I said I'm not the author of the code and you can refactor the code and send a pull request to make this clean architecture sample more robust.