Use case – edge cases of the BookSwap application
This chapter has taught us two new testing techniques: fuzzed testing and property-based testing. We have learned how to apply these to a simple function that provided the functionality of returning the key-sorted values contained inside an input map. In this section, we will end our exploration with a discussion of how these techniques can be applied to the BookSwap
application we have built so far.
As previously discussed, robust code should test any variables that it does not generate itself. We named these inputs as being from untrusted sources. Figure 10.4 presents all the inputs that can be considered untrusted from the viewpoint of the processing service:
Figure 10.4 – Untrusted input in the BookSwap application
We identify two sources of untrusted input within the services of BookSwap
:
UserService
receives input from the user. As we have no control over what the user submits...