In our existing app, we have many different version of xcdatamodel
:
+ TheApp.xcdatamodel
TheApp.1.0.xcdatamodel
TheApp.1.1.xcdatamodel
TheApp.2.0.xcdatamodel
...
We know that the traditional way of doing database migration testing is what have been proposed in this question: How to Test Core Data Migration With an App Already in the App Store? In short, it works like the following:
- install a old version of the app;
- create some data in the old version of the app;
- install the new version on top it;
- see if everything is migrated properly.
We have been using this migration testing method for all our previous version of the app. Our QA will perform the above steps judge by himself that whether migration is successful or not.
However, in the most recent upgrade, we have changed a lot in our data model. It doesn't sound like such a good idea to ask the QA to remember what have been created in the old version of the app and notice what have been missing. Therefore, we would like to see whether it is possible to write a Unit testing for the database migration by the developer ourself.
So one of the first step is how to generate test data. Notice that we can see all the previous version of the xcdatamodel
from within our Xcode project. In a nutshell, the question:
Is it possible to generating test data of previous version of xcdatamodel
programmatically from within our current version of the app.
Please let me know what you think. Suggestions are also acceptable.
P.S.: We don't mind we have to do the Unit Testing on simulator but not on device.
Aucun commentaire:
Enregistrer un commentaire