撒拉嘿哟木头 2008-08-28 19:41 采纳率: 100%
浏览 161
已采纳

单元测试的最佳方法是什么?

What frameworks exist to unit test Objective-C code? I would like a framework that integrates nicely with Apple Xcode.

转载于:https://stackoverflow.com/questions/33207/what-is-the-best-way-to-unit-test-objective-c-code

  • 写回答

16条回答 默认 最新

  • lrony* 2008-08-28 19:52
    关注

    Xcode includes XCTest, which is similar to OCUnit, an Objective-C unit testing framework, and has full support for running XCTest-based unit tests as part of your project's build process. Xcode's unit testing support is described in the Xcode Overview: Using Unit Tests.

    Back in the Xcode 2 days, I wrote a series of weblog posts about how to perform some common tasks with Xcode unit testing:

    Despite using OCUnit rather than XCTest, the concepts are largely the same.

    Finally, I also wrote a few posts on how to write tests for Cocoa user interfaces; the way Cocoa is structured makes it relatively straightforward, because you don't have to spin an event loop or anything like that in most cases.

    This makes it possible to do test-driven development for not just your model-level code but also your controller-level and even view-level code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(15条)

报告相同问题?

悬赏问题

  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?