Testing multiple conditions
So far, we have covered how to structure and write tests. However, developers need to know what aspects of their code to test, as well as how to test them. Remember that the lower we go on the testing pyramid, the cheaper and faster the tests are to run. Therefore, it is important for developers to know how to exercise their code as low in their stack as possible. In this chapter, we’ll focus on covering edge cases as part of our developer testing strategy.
As discussed in Chapter 1, Getting to Grips with Test-Driven Development, automated tests should be based on the system requirements we implement. In general, system requirements will focus on the specification of the success scenarios and system functionality additions. Designing your testing strategy around these requirements serves the primary purpose of ensuring that your system satisfies its functional requirements.
A secondary purpose of your testing strategy should be to verify the...