SSW Foursquare

Code - Do you handle all possible scenarios?

Last updated by Brady Stroud [SSW] 6 months ago.See history

When developers build software, they naturally become experts in using the software. This is problematic because with this expertise, they will tend to focus on the happy path of the user. However, it is important to consider all possible scenarios that could occur. This includes edge cases, such as invalid inputs, unexpected user behavior, and system failures. By handling all possible scenarios, you can ensure that your code is robust and reliable.

Here are some tips to help you spot where you need to handle more scenarios:

  • Think of potential "unhappy paths"

    • Ask yourself "what could the user do wrong here?" (e.g. What if the user enters an invalid email address?)
    • Assume your users are doing something for the first time
  • Get a test please on all your code
  • Do some exploratory testing

bad no validaton
Figure: Bad example - Users can enter invalid emails

good validation fields
Figure: Good example - Code checks the email is valid

Brady Stroud
We open source.Loving SSW Rules? Star us on GitHub. Star
Stand by... we're migrating this site to TinaCMS