Check, check, check and then check again
In a recent post I talked about the issues that had been picked up when we got a professional tester to test ORB. They found several edge-cases when setting up users, resources and facilities or making bookings that testing hadn’t previously picked up.
This really highlighted for us the need to validate the input not just once, but potentially three times and then to ensure that when we save the information that process itself has been successful. Let me explain:
Firstly, we’ve added limits (using the HTML INPUT tag’s maxlength attribute) to every field that accepts a text input. This should, at a browser level, prevent anyone from typing more text than the corresponding database field can hold.
You’d think that having the browser ensure that there are no problems with the data entered in these fields being too long to fit in the corresponding database fields would be enough, but it’s actually not.
So, our second addition is a check when you click on the button to save a booking or add resource, facility or user information. We validate the lengths of these fields, amongst other things, before we submit the information to the server.
But wait, there’s more! To ensure that there’s no risk of the data being tampered with between the browser and the server and so ending up too large to fit in the database fields, and just in case we’re dealing with a user who has javascript disabled (so all our validation attempts to this point won’t have run), we also validate the lengths of all data that the user has entered on the server as well. Only then do we send the data to the database.
Even now though, we’re not done. Despite taking every precaution to ensure that the data we send to the database is valid, we also check what the database tells us, to ensure that the data has been saved successfully.
This may sound like overkill, but it’s part of the process of ensuring that ORB is robust and reliable, to provide a great service to our clients.