应用商店的单元测试 [英] Unit testing for the app store

查看:23
本文介绍了应用商店的单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始编写 iOS 应用程序,并且几乎完成了我的第一个游戏的编写.我已经在网上阅读了有关单元测试的内容,并明白我真的应该从一开始就考虑到这一点(呃,哦...).

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...).

我的应用大约有 4000 行代码,包括 8 个类和大约 50 个方法.

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

我应该关注单元测试吗?究竟是什么?提交到 App Store 之前我必须做吗??

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!

推荐答案

关于单元测试有很多不同的理念.单元测试在开发过程中更有用,因此如果您想进行更改,您可以进行更改而不必担心您的更改会破坏您所做的不相关的事情.基本上,它会编写其他方法,使用不同的参数调用您的内部游戏方法,并检查结果是否符合预期.

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.

这篇关于应用商店的单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆