I had a problem with my Access program where I had separated the database from the business logic in order to test the business logic.
My tests ran successfully on the business logic, but I had introduced an error on the db side creating the data in a live environment by building an array from a recordset.
What I did was forget to add a “.MoveNext” to my recordset variable with a check for EOF which never came.
It was an infinite loop and I made it live because I was trusting my tests without testing the actual live version. Thankfully, even though it was an infinite loop, the code could only execute once before erroring out because it was creating a structure with a unique key.
How could testing accomodate this?
I’ve been focusing mainly on unit testing which is testing small pieces of code.
I could also create what are usually called integration tests which try to operate the system as a whole. I could have written a test that would use the live database functions to make sure if I put the correct records in they are returned.
So, lesson learned, one always needs to be able to be confident in deploying their system by adding some kind of test coverage over the live components of the system (whether that just means testing something yourself, like adding a new order and then deleting it or automating it somehow).