Unit testing for the app store

别等时光非礼了梦想. 提交于 2019-12-13 16:23:37

问题


Im new at writing iOS apps, and have nearly finished writing my first game. Ive read online about unit testing and understand that I really should have been coding with this in mind from the beginning (uh oh...).

My app is about 4000 lines of code, and includes 8 classes and about 50 methods.

Should I be concerned about unit testing? What is it exactly? and Do I have to do it before I submit to the App Store??

any answers or links to helpful resources would be greatly appreciated. Thanks!


回答1:


There are lots of different philosophies on unit testing. Unit testing is more of use during development, so that if you want to make changes you can make them without worrying as much your change will break something you do are not thinking is related. Basically it would be writing other methods that call your internal game methods with different parameters and check to see if the results are as expected.

You do not need to unit test for the app store - chances are you have been testing the game all along as you have developed, and that user testing is a lot more important for getting something released (as it means it probably will not crash) and also of course that makes for a better game!

One final note, if you are thinking about unit testing in the future there is a downside. It can also mean more work when re-writing code as you not only have to change your original code, but also related tests and make sure the results they are looking for make sense. For a single person that overhead may not make sense; it is more helpful when many people will be changing the same code.



来源:https://stackoverflow.com/questions/8621617/unit-testing-for-the-app-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!