user1046037
user1046037

Reputation: 17715

ios - static data validation done at runtime or through test cases

I have an iOS project which has static data (around 500 entries)

This static data is added while developing and this static data will NOT change at run time. From time to time I tend to add more static data (hardcode it)

I would like to perform some validations (such as checking duplicate entries and other sanity checks).

Should I do this validation checks during the execution of the program or should I do these checks as part of the test cases.

Note - I am using XCode.

Upvotes: 1

Views: 211

Answers (1)

Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726809

Assuming that the data does not change after deployment, and that you run your unit tests before shipping your application (after all, why would you need unit tests if you didn't run them before shipping the app, right?) there is no reason to repeatedly testing your static data in an installed app. Checking the data in your unit tests is entirely sufficient: the only reason the data would change after installation is if your application is tampered with, and iOS prevents that already.

Upvotes: 1

Related Questions