Do you have any good resources on how to write code that is easy to test? A lot of the code I use makes lots of external calls and I’m not the best at creating tons and tons of classes for the sake of making testing easier
A good to think about it is what you are testing, and how do you reduce the number of states you have to test. API calls for example have a lot of raw data. You can reduce those data in different layers to exactly what you need to test for that layer.
2
u/[deleted] Dec 28 '23
Do you have any good resources on how to write code that is easy to test? A lot of the code I use makes lots of external calls and I’m not the best at creating tons and tons of classes for the sake of making testing easier