Writing test cases
Now, it's time to write test cases. The first thing is how we decide what we should test. Should we start testing every endpoint and then every class?
The first thing to understand is that we should only test the code that is written by us. By us, I mean someone from our team. We don't intend to test the code that is third-party, framework code, or a package. Also, we don't want to test each and every class and every method. In an ideal case, we can test each and every minor function's details but it has its drawbacks. First of all in the real world, we don't have time for that. We intend to test most parts but not all parts. Another reason is that all the tests that we are writing are a liability as well. We also need ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access