Access JumpStart 2.0 | Blog

A Rapid Development Framework for Microsoft Access

As I think about and discuss an architecture for an Access application I was considering the data persistence layer again and thinking about why one might want to test it.

For example, what if your application is meant to track historic events throughout the history of time, or perhaps is tracking museum artifacts and you want to enter ancient dates calculating the years between dates, etc. You might want to include data persistence tests to make sure if you use a really old date, it will store it the way you expect and return a value that you expect. Once created, the test would be there for future data backend changes, like splitting the database, integrating odbc sources from other applications, or migrating to a SQL Server back end.

Another possible thought would be to make sure the database could store certain non-english characters if you use other languages like Spanish, Portuguese, Chinese, or Russian. You might also include emojis in these tests if you want to be able to save emojis in certain fields.

Also, if you are needing precision mathematical operations, say for a bank, you might want to make sure the fields that need the precision will store and retrieve the precision you need. (There are quite interesting articles out there concerning the differences between Single, Double, Decimal, Currency, and other number types. It’s not just ranges. Floating point numbers like Single and Double can have interesting undesirable effects in certain circumstances.

So that would cover data integrity tests. What else?

How about referential integrity? You could make sure it’s enabled and functioning as expected if it’s something your application will be depending on.

If you do need to put business logic into the data persistence layer for some reason, you would want to test it. Perhaps you just need to put something in a query because it’s much faster than running through the whole recordset and running the data through user defined functions.

So, although I have not focused yet on doing any testing on our persistence layer, it is not something that would be out of the question. Like everything else, it depends on the domain you’re working in. Tracking football scores does not need decimal accuracy like a banking application does.