IOS單元測試

IOS單元測試

  • 單元測試開始
    - (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
    }
  • 單元測試結(jié)束
    - (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
    }
  • 單元測試測試方法 所有的測試內(nèi)容都在這個方法里面執(zhí)行。但是不一定是命名為testExample,也可以是textProgram
    - (void)testExample {}
  • 性能測試。耗時和性能消耗在這里測試
    - (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
    // Put the code you want to measure the time of here.
    }];
    }
  • 測試用例覆蓋測試的工具類里面所有的func
image.png
image.png

這個覆蓋率指的是代碼而不是函數(shù)。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 一 :前言 很多的開發(fā)者 都聽說過單元測試,但是不可否認 很多開發(fā)者 在實際開發(fā)中很少使用這個 單元測試。 大部分...
    LikeSomeBody閱讀 37,797評論 7 101
  • 前言:測試是一個好的App不可缺少的部分。每一個App都是由一個個小的功能組合到一起的。而這些小的功能又是由一個個...
    廖丹_18be閱讀 759評論 0 1
  • 覆蓋率報告 Xcode7開始,自帶覆蓋率 設(shè)置要點:-1)Scheme中開啟Gather Coverage dat...
    星空夢想閱讀 1,006評論 0 0
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,872評論 0 10
  • 2017年8月25日,雅安美祺經(jīng)營部、名山盛華商貿(mào)、滎經(jīng)熙益得力商貿(mào)、九襄唐君、石棉滎石經(jīng)營部和漢源曹立明六大經(jīng)銷...
    Nice_Lynn閱讀 330評論 0 0

友情鏈接更多精彩內(nèi)容