How can I test a Windows desktop app that has an option to use cache while sending database information? Any ideas
Most caches work as following:
- Data is requested, retrieved and stored in the cache
- Data is displayed
- Next time data is requested the cache is checked if it has data, its max lifetime is checked, if cache is still valid data is displayed from cache, else data is retrieved again.
Here some steps to check the above described cache is working
- Cached: Check data is cached
- Request data
- Change data in source database
- Request data and verify old data is still shown
- Lifetime: Check data cache is invalid after X time
- Wait for max lifetime and check changes are again retrieved on a request
- Database connection: Verify second request does not go to database, check database logs/profiler or network traffic with a monitoring tool
This would test that the cache is working, not in all situations like corrupt data, partial data loads due to network problems, etcs...come up with your own testcases from here on ;-) What else you need to test greatly depends on the implementation of the cache and what the goal of the cache is.