SlideShare ist ein Scribd-Unternehmen logo
1 von 84
Downloaden Sie, um offline zu lesen
仕事で使え
                             る!

iPhone
 アプリ開発でも
 継続的インテグレーション
                  #CLRH78
              Tsuyoshi Maehana
                 @sandinist
13年1月20日日曜日
Self Intro

              • Tsuyoshi Maehana
              • @sandinist
              • Objective-C, Ruby, C#, VB.net
              • ♥Ruby
              • ♥Agile


13年1月20日日曜日
@jcoplien



              @sandinist




13年1月20日日曜日
侍
              Samurai
              Episode

13年1月20日日曜日
Ruby
13年1月20日日曜日
              Sapporo
Agile
              Sapporo




13年1月20日日曜日
Soup
13年1月20日日曜日
              Curry♥
仕事で使え
                             る!

iPhone
 アプリ開発でも
 継続的インテグレーション
                  #CLRH78
              Tsuyoshi Maehana
                 @sandinist
13年1月20日日曜日
チームに感謝を




13年1月20日日曜日
Table of Contents


              • Unit Tests
              • Acceptance Tests
              • Continuous Integration

13年1月20日日曜日
                             in iOS
iOS Development
                                   N ote
              • XCode
              • iOS Developer Program
              • Objective-C

13年1月20日日曜日
!   Use Version Control?


              • Git
              • Mercurial
              • Bazaar
              • ...etc

13年1月20日日曜日
Three Pillar




              Version
                            Testing    Automation
              Control




13年1月20日日曜日
Use Version Control.

                        XCode Standard
              • Git
              • Mercurial
              • Bazaar
              • ...etc

13年1月20日日曜日
Table of Contents


              • Unit Tests
              • Acceptance Tests
              • Continuous Integration

13年1月20日日曜日
                             in iOS
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux    CI Mac

                             git
              git          (bare)        Jenkins




                            ircd          XCode &
              irc
                                        Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux    CI Mac
                    push
                             git
              git          (bare)        Jenkins




                            ircd          XCode &
              irc
                                        Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux       CI Mac
                                    hook
                             git
              git          (bare)           Jenkins




                            ircd             XCode &
              irc
                                           Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux      CI Mac

                             git
              git          (bare)          Jenkins


                                   Run Tests

                            ircd            XCode &
              irc
                                          Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux     CI Mac

                             git
              git          (bare)         Jenkins



                                        Notify
                            ircd           XCode &
              irc
                                         Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux    CI Mac

                               git
              git            (bare)      Jenkins



                    Notify
                              ircd        XCode &
              irc
                                        Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux    CI Mac

                             git
              git          (bare)        Jenkins




                            ircd          XCode &
              irc
                                        Instruments


13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux          CI Mac
                    push              hook
                               git
              git            (bare)            Jenkins


                                      Notify
                    Notify
                              ircd             XCode &
              irc
                                             Instruments

                                           Run Tests
13年1月20日日曜日
Table of Contents


              • Unit Tests
              • Acceptance Tests
              • Continuous Integration

13年1月20日日曜日
                             in iOS
Three Pillar




              Version
                            Testing    Automation
              Control




13年1月20日日曜日
what’s kinds of?

              • Unit
              • Integration
              • Functional
              • Join
              • Acceptance
13年1月20日日曜日
what’s kinds of?

     • Unit
     • Integration
                   For Developer
     • Functional
     • Join
     • Acceptance
13年1月20日日曜日
what’s kinds of?

     • Unit
     • Integration
     • Functional
     • Join
     • Acceptance For Customer
13年1月20日日曜日
what’s kinds of?

     • Unit
     • Integration
     • Functional
     • Join
     • Acceptance
     • NonFunctional For QA
13年1月20日日曜日
To Do in the UnitTests


        • Models
        • Own Libraries
        • Communications

13年1月20日日曜日
Not Do the UnitTests


        • Views
        • ViewControllers
        • External Libraries
        • Built-in Libraries
13年1月20日日曜日
Table of Contents


              • Unit Tests
              • Acceptance Tests
              • Continuous Integration

13年1月20日日曜日
                             in iOS
Unit Tests Frameworks.


              • SenTestingKit
              • GHUnit
              • Cedar
              • Kiwi
13年1月20日日曜日
Unit Tests Frameworks.


              • SenTestingKit
              • GHUnit
              • Cedar
              • Kiwi
13年1月20日日曜日
We use.


 2010          2011        2012   2013

          GHUnit
                    Kiwi
       Is troublesome..
                             SenTesting

13年1月20日日曜日
SenTestingKit

        • XCode Standard
        • Poor Matcher?
        • Can’t Mocking?
        • Async Difficult?
        • Fixture there?
13年1月20日日曜日
Poor Matcher?

        • OCHamcrest 
              • https://github.com/hamcrest/OCHamcrest
  allOf
  equalTo
  sameInstance
  hasItem
  closeTo
  lessThan
  endsWith
  ...
13年1月20日日曜日
Can’t Mocking?

        • OCMock
              • https://github.com/erikdoe/ocmock




13年1月20日日曜日
OCMock Attention



        • Can’t Partial Mocking toll-
          free bridge Classes.
        • Use mockForClass


13年1月20日日曜日
OCMock Attention


• Double Pointer Argument
• Use OCMOCK_ANYPTR Macro.
• ex)
   • error:OCMOCK_ANYPTR(NSError *)

13年1月20日日曜日
OCMock Attention



• union Argument is Can’t Stub.



13年1月20日日曜日
Async Difficult?

        • SenAsyncTestCase 
              • https://github.com/akisute/SenAsyncTestCase




13年1月20日日曜日
Fixture there?




        Tell me!



13年1月20日日曜日
Fixture there?

        Make It!




13年1月20日日曜日
Other Topic


        • Method Swizzling
         • ex) NSDate date
        • Use JRSwizzle
              • https://github.com/rentzsch/jrswizzle



13年1月20日日曜日
Our Rule

              • 1 to 1 test class to class
              • No Device Access (In Mock All)
              • No Really Communicate (In Mock All)
              • To Succeed xcodebuild
              • Wait during asynchronous test as short as
                possible
              • Do not write tests of getter / setter


13年1月20日日曜日
13年1月20日日曜日
13年1月20日日曜日
Take a Break..


13年1月20日日曜日
13年1月20日日曜日
_人人人人人人_
        > 突然の縄 <
         ̄Y^Y^Y^Y^Y ̄

13年1月20日日曜日
13年1月20日日曜日
Table of Contents


              • Unit Tests
              • Acceptance Tests
              • Continuous Integration

13年1月20日日曜日
                             in iOS
To Do in the
              Acceptance Tests


        • User Action
        • Running the Scenario


13年1月20日日曜日
Acceptance Tests Framework

        • UIAutomation
        • Kif
        • Frank
        • FoneMonkey
        • Zucchini
13年1月20日日曜日
Acceptance Tests Framework

        • UIAutomation +tuneup.js
        • Kif
        • Frank
        • FoneMonkey
        • Zucchini
13年1月20日日曜日
Instruments




13年1月20日日曜日
UIAutomation + tuneup.js




13年1月20日日曜日
UIAutomation + tuneup.js




13年1月20日日曜日
Acceptance Tests Framework

        • UIAutomation +tuneup.js
        • Kif
        • Frank
        • FoneMonkey
        • Zucchini
13年1月20日日曜日
KIF


     • KIF iOS Integration Testing
         Framework
     • https://github.com/square/KIF



13年1月20日日曜日
Three Pillar




              Version
                            Testing    Automation
              Control




13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux    CI Mac
                    push
                             git
              git          (bare)




      XCode &
    Instruments

  Run Tests
13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux          CI Mac
                    push              hook
                               git
              git            (bare)            Jenkins


                                      Notify
                    Notify
                              ircd             XCode &
              irc
                                             Instruments

                                           Run Tests
13年1月20日日曜日
Automation

     • Jenkins
     • TeamCity
     • CruiseControl.rb
     • zapp
     • buildbot
13年1月20日日曜日
Jenkins




13年1月20日日曜日
Jenkins

        • Building/testing software
              projects continuously
        • Work with version controls
        • Many Plug-in
        • Easy to Install & Configure
        • Run Any Scripts
13年1月20日日曜日
Jenkins Plug-ins



        • Jenkins Git Plugin
        • Jenkins IRC Plugin
        • Parameterized Job Plugin

13年1月20日日曜日
!   Proxy Setting

        • Manage Jenkins
         • System Setting
           • Global Properties
           • Environment Variable ON
        • set http_proxy etc
13年1月20日日曜日
Run Test from
              the Command Line


        • xcodebuild
        • instruments
        • xcrun

13年1月20日日曜日
Run Unit Tests



xcodebuild -scheme CLRHTest -sdk iphonesimulator
 TEST_AFTER_BUILD=YES -configuration Release
                   clean build




13年1月20日日曜日
Run Unit Tests



xcodebuild -scheme CLRHTest -sdk iphonesimulator
 TEST_AFTER_BUILD=YES -configuration Release
                   clean build


       Setting     Clean    Build       Test



13年1月20日日曜日
Run Acceptance Tests
APP="$(pwd)/build/Release-iphonesimulator/CLRH.app"

TEMPLATE=`instruments -s 2>&1 > /dev/null |sed -n 's/
*"([^",]*/Automation.tracetemplate)",*/1/p'`

SCRIPTS="$(pwd)/AcceptanceTest/*.js"

for SCRIPT in $SCRIPTS
do
 instruments -t $TEMPLATE $APP -e UIASCRIPT $SCRIPT
 if [ "$?" -ne 0 ]; then
   exit $?
 fi
done
13年1月20日日曜日
Run Acceptance Tests
APP="$(pwd)/build/Release-iphonesimulator/CLRH.app"
                  "/Applications/Xcode.app/Contents/Applications/
TEMPLATE=`instruments -s 2>&1 > /dev/null |sed -n
                         Instruments.app/Contents/PlugIns/          's/
                 AutomationInstrument.bundle/Contents/Resources/
*"([^",]*/Automation.tracetemplate)",*/1/p'`
                             Automation.tracetemplate"

SCRIPTS="$(pwd)/AcceptanceTest/*.js"

for SCRIPT in $SCRIPTS
do
 instruments -t $TEMPLATE $APP -e UIASCRIPT $SCRIPT
 if [ "$?" -ne 0 ]; then
   exit $?
 fi
done
13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux          CI Mac
                    push              hook
                               git
              git            (bare)            Jenkins


                                      Notify
                    Notify
                              ircd             XCode &
              irc
                                             Instruments

                                           Run Tests
13年1月20日日曜日
git hook




13年1月20日日曜日
Eco!
      #!/bin/bash
      wol '[MAC ADDRESS]'
      for i in {0..5} do
        ping -c1 host > /dev/null
        if [ $? == 0 ]; then
           break
        fi
           sleep 1
      done
      wget --no-proxy -q "http://host:8080/job/Start/build?
      token=[token]&delay=0"
      if [ "$?" -eq 0 ]; then
         echo "Jenkins build run."
      else
         echo "Jenkins build failed."
      fi
13年1月20日日曜日
Overview
               - Team Continuous Integration

       Dev Mac          VC& irc Linux          CI Mac
                    push              hook
                               git
              git            (bare)            Jenkins


                                      Notify
                    Notify
                              ircd             XCode &
              irc
                                             Instruments

                                           Run Tests
13年1月20日日曜日
xcrun?


   xcodebuild -project ./CLRH.xcodeproj clean build

 xcrun -sdk iphoneos PackageApplication -v ./build/
  Release-iphoneos/CLRH.app -o "`pwd`/CLRH.ipa"



                  Set Valid Distribution
                  Identifier for Release Build.
13年1月20日日曜日
Continuous Delivery


        • Use xcrun our case is all
              done manually.
        • In no constraint case, you
              can use Testflight.

13年1月20日日曜日
Overview
                - Release Continuous Delivery

     Dev Mac              VC Linux          CI Mac

                              git
              git           (bare)          Jenkins



  Destination             VC Linux

                                     git     XCode &
        web
                                           Instruments
      browser           Repository
                         browser
13年1月20日日曜日
Overview
                - Release Continuous Delivery

     Dev Mac               VC Linux                CI Mac
                    push                polling
                               git
              git            (bare)                Jenkins


                                            push
  Destination              VC Linux
                    DL                git        XCode &
        web
                                               Instruments
      browser            Repository
                          browser              Run Tests
13年1月20日日曜日
13年1月20日日曜日
Any
              Auestion?
                 ;-)



13年1月20日日曜日

Weitere ähnliche Inhalte

Mehr von Maehana Tsuyoshi

Improvement_process_for_providing_ongoing_value
Improvement_process_for_providing_ongoing_valueImprovement_process_for_providing_ongoing_value
Improvement_process_for_providing_ongoing_value
Maehana Tsuyoshi
 

Mehr von Maehana Tsuyoshi (16)

Stray sheep #ggjsap 2016 UE4 Team
Stray sheep #ggjsap 2016 UE4 TeamStray sheep #ggjsap 2016 UE4 Team
Stray sheep #ggjsap 2016 UE4 Team
 
リモートチームとふりかえり改善フレームワーク
リモートチームとふりかえり改善フレームワークリモートチームとふりかえり改善フレームワーク
リモートチームとふりかえり改善フレームワーク
 
育てる!かんばん - bring up Kanban.
育てる!かんばん - bring up Kanban.育てる!かんばん - bring up Kanban.
育てる!かんばん - bring up Kanban.
 
Gadget study 1 at SapporoMIRAIstcafe
Gadget study 1 at SapporoMIRAIstcafeGadget study 1 at SapporoMIRAIstcafe
Gadget study 1 at SapporoMIRAIstcafe
 
KanbanとTHETAとDK2とわたし
KanbanとTHETAとDK2とわたしKanbanとTHETAとDK2とわたし
KanbanとTHETAとDK2とわたし
 
How to put out ideas
How to put out ideasHow to put out ideas
How to put out ideas
 
大きなチーム、大きな仕事 ~ 大規模アジャイル開発のいま
大きなチーム、大きな仕事 ~ 大規模アジャイル開発のいま大きなチーム、大きな仕事 ~ 大規模アジャイル開発のいま
大きなチーム、大きな仕事 ~ 大規模アジャイル開発のいま
 
Kaminend-Agile-WorkShop
Kaminend-Agile-WorkShopKaminend-Agile-WorkShop
Kaminend-Agile-WorkShop
 
Improvement_process_for_providing_ongoing_value
Improvement_process_for_providing_ongoing_valueImprovement_process_for_providing_ongoing_value
Improvement_process_for_providing_ongoing_value
 
Clrh66
Clrh66Clrh66
Clrh66
 
quanp for iPhone appbank japan tour 2nd in sapporo
quanp for iPhone appbank japan tour 2nd in sapporoquanp for iPhone appbank japan tour 2nd in sapporo
quanp for iPhone appbank japan tour 2nd in sapporo
 
step by step agile
step by step agilestep by step agile
step by step agile
 
clrh58
clrh58clrh58
clrh58
 
clrh56
clrh56clrh56
clrh56
 
Native Smartphone Development with Ruby
Native Smartphone Development with RubyNative Smartphone Development with Ruby
Native Smartphone Development with Ruby
 
できる!遺伝的アルゴリズム
できる!遺伝的アルゴリズムできる!遺伝的アルゴリズム
できる!遺伝的アルゴリズム
 

Kürzlich hochgeladen

Kürzlich hochgeladen (11)

新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 

CLR/H78 CI at iOS

  • 1. 仕事で使え る! iPhone アプリ開発でも 継続的インテグレーション #CLRH78 Tsuyoshi Maehana @sandinist 13年1月20日日曜日
  • 2. Self Intro • Tsuyoshi Maehana • @sandinist • Objective-C, Ruby, C#, VB.net • ♥Ruby • ♥Agile 13年1月20日日曜日
  • 3. @jcoplien @sandinist 13年1月20日日曜日
  • 4. Samurai Episode 13年1月20日日曜日
  • 6. Agile Sapporo 13年1月20日日曜日
  • 8. 仕事で使え る! iPhone アプリ開発でも 継続的インテグレーション #CLRH78 Tsuyoshi Maehana @sandinist 13年1月20日日曜日
  • 10. Table of Contents • Unit Tests • Acceptance Tests • Continuous Integration 13年1月20日日曜日 in iOS
  • 11. iOS Development N ote • XCode • iOS Developer Program • Objective-C 13年1月20日日曜日
  • 12. ! Use Version Control? • Git • Mercurial • Bazaar • ...etc 13年1月20日日曜日
  • 13. Three Pillar Version Testing Automation Control 13年1月20日日曜日
  • 14. Use Version Control. XCode Standard • Git • Mercurial • Bazaar • ...etc 13年1月20日日曜日
  • 15. Table of Contents • Unit Tests • Acceptance Tests • Continuous Integration 13年1月20日日曜日 in iOS
  • 16. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac git git (bare) Jenkins ircd XCode & irc Instruments 13年1月20日日曜日
  • 17. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac push git git (bare) Jenkins ircd XCode & irc Instruments 13年1月20日日曜日
  • 18. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac hook git git (bare) Jenkins ircd XCode & irc Instruments 13年1月20日日曜日
  • 19. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac git git (bare) Jenkins Run Tests ircd XCode & irc Instruments 13年1月20日日曜日
  • 20. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac git git (bare) Jenkins Notify ircd XCode & irc Instruments 13年1月20日日曜日
  • 21. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac git git (bare) Jenkins Notify ircd XCode & irc Instruments 13年1月20日日曜日
  • 22. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac git git (bare) Jenkins ircd XCode & irc Instruments 13年1月20日日曜日
  • 23. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac push hook git git (bare) Jenkins Notify Notify ircd XCode & irc Instruments Run Tests 13年1月20日日曜日
  • 24. Table of Contents • Unit Tests • Acceptance Tests • Continuous Integration 13年1月20日日曜日 in iOS
  • 25. Three Pillar Version Testing Automation Control 13年1月20日日曜日
  • 26. what’s kinds of? • Unit • Integration • Functional • Join • Acceptance 13年1月20日日曜日
  • 27. what’s kinds of? • Unit • Integration For Developer • Functional • Join • Acceptance 13年1月20日日曜日
  • 28. what’s kinds of? • Unit • Integration • Functional • Join • Acceptance For Customer 13年1月20日日曜日
  • 29. what’s kinds of? • Unit • Integration • Functional • Join • Acceptance • NonFunctional For QA 13年1月20日日曜日
  • 30. To Do in the UnitTests • Models • Own Libraries • Communications 13年1月20日日曜日
  • 31. Not Do the UnitTests • Views • ViewControllers • External Libraries • Built-in Libraries 13年1月20日日曜日
  • 32. Table of Contents • Unit Tests • Acceptance Tests • Continuous Integration 13年1月20日日曜日 in iOS
  • 33. Unit Tests Frameworks. • SenTestingKit • GHUnit • Cedar • Kiwi 13年1月20日日曜日
  • 34. Unit Tests Frameworks. • SenTestingKit • GHUnit • Cedar • Kiwi 13年1月20日日曜日
  • 35. We use. 2010 2011 2012 2013 GHUnit Kiwi Is troublesome.. SenTesting 13年1月20日日曜日
  • 36. SenTestingKit • XCode Standard • Poor Matcher? • Can’t Mocking? • Async Difficult? • Fixture there? 13年1月20日日曜日
  • 37. Poor Matcher? • OCHamcrest  • https://github.com/hamcrest/OCHamcrest allOf equalTo sameInstance hasItem closeTo lessThan endsWith ... 13年1月20日日曜日
  • 38. Can’t Mocking? • OCMock • https://github.com/erikdoe/ocmock 13年1月20日日曜日
  • 39. OCMock Attention • Can’t Partial Mocking toll- free bridge Classes. • Use mockForClass 13年1月20日日曜日
  • 40. OCMock Attention • Double Pointer Argument • Use OCMOCK_ANYPTR Macro. • ex) • error:OCMOCK_ANYPTR(NSError *) 13年1月20日日曜日
  • 41. OCMock Attention • union Argument is Can’t Stub. 13年1月20日日曜日
  • 42. Async Difficult? • SenAsyncTestCase  • https://github.com/akisute/SenAsyncTestCase 13年1月20日日曜日
  • 43. Fixture there? Tell me! 13年1月20日日曜日
  • 44. Fixture there? Make It! 13年1月20日日曜日
  • 45. Other Topic • Method Swizzling • ex) NSDate date • Use JRSwizzle • https://github.com/rentzsch/jrswizzle 13年1月20日日曜日
  • 46. Our Rule • 1 to 1 test class to class • No Device Access (In Mock All) • No Really Communicate (In Mock All) • To Succeed xcodebuild • Wait during asynchronous test as short as possible • Do not write tests of getter / setter 13年1月20日日曜日
  • 51. _人人人人人人_ > 突然の縄 <  ̄Y^Y^Y^Y^Y ̄ 13年1月20日日曜日
  • 53. Table of Contents • Unit Tests • Acceptance Tests • Continuous Integration 13年1月20日日曜日 in iOS
  • 54. To Do in the Acceptance Tests • User Action • Running the Scenario 13年1月20日日曜日
  • 55. Acceptance Tests Framework • UIAutomation • Kif • Frank • FoneMonkey • Zucchini 13年1月20日日曜日
  • 56. Acceptance Tests Framework • UIAutomation +tuneup.js • Kif • Frank • FoneMonkey • Zucchini 13年1月20日日曜日
  • 60. Acceptance Tests Framework • UIAutomation +tuneup.js • Kif • Frank • FoneMonkey • Zucchini 13年1月20日日曜日
  • 61. KIF • KIF iOS Integration Testing Framework • https://github.com/square/KIF 13年1月20日日曜日
  • 62. Three Pillar Version Testing Automation Control 13年1月20日日曜日
  • 63. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac push git git (bare) XCode & Instruments Run Tests 13年1月20日日曜日
  • 64. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac push hook git git (bare) Jenkins Notify Notify ircd XCode & irc Instruments Run Tests 13年1月20日日曜日
  • 65. Automation • Jenkins • TeamCity • CruiseControl.rb • zapp • buildbot 13年1月20日日曜日
  • 67. Jenkins • Building/testing software projects continuously • Work with version controls • Many Plug-in • Easy to Install & Configure • Run Any Scripts 13年1月20日日曜日
  • 68. Jenkins Plug-ins • Jenkins Git Plugin • Jenkins IRC Plugin • Parameterized Job Plugin 13年1月20日日曜日
  • 69. ! Proxy Setting • Manage Jenkins • System Setting • Global Properties • Environment Variable ON • set http_proxy etc 13年1月20日日曜日
  • 70. Run Test from the Command Line • xcodebuild • instruments • xcrun 13年1月20日日曜日
  • 71. Run Unit Tests xcodebuild -scheme CLRHTest -sdk iphonesimulator TEST_AFTER_BUILD=YES -configuration Release clean build 13年1月20日日曜日
  • 72. Run Unit Tests xcodebuild -scheme CLRHTest -sdk iphonesimulator TEST_AFTER_BUILD=YES -configuration Release clean build Setting Clean Build Test 13年1月20日日曜日
  • 73. Run Acceptance Tests APP="$(pwd)/build/Release-iphonesimulator/CLRH.app" TEMPLATE=`instruments -s 2>&1 > /dev/null |sed -n 's/ *"([^",]*/Automation.tracetemplate)",*/1/p'` SCRIPTS="$(pwd)/AcceptanceTest/*.js" for SCRIPT in $SCRIPTS do instruments -t $TEMPLATE $APP -e UIASCRIPT $SCRIPT if [ "$?" -ne 0 ]; then exit $? fi done 13年1月20日日曜日
  • 74. Run Acceptance Tests APP="$(pwd)/build/Release-iphonesimulator/CLRH.app" "/Applications/Xcode.app/Contents/Applications/ TEMPLATE=`instruments -s 2>&1 > /dev/null |sed -n Instruments.app/Contents/PlugIns/ 's/ AutomationInstrument.bundle/Contents/Resources/ *"([^",]*/Automation.tracetemplate)",*/1/p'` Automation.tracetemplate" SCRIPTS="$(pwd)/AcceptanceTest/*.js" for SCRIPT in $SCRIPTS do instruments -t $TEMPLATE $APP -e UIASCRIPT $SCRIPT if [ "$?" -ne 0 ]; then exit $? fi done 13年1月20日日曜日
  • 75. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac push hook git git (bare) Jenkins Notify Notify ircd XCode & irc Instruments Run Tests 13年1月20日日曜日
  • 77. Eco! #!/bin/bash wol '[MAC ADDRESS]' for i in {0..5} do ping -c1 host > /dev/null if [ $? == 0 ]; then break fi sleep 1 done wget --no-proxy -q "http://host:8080/job/Start/build? token=[token]&delay=0" if [ "$?" -eq 0 ]; then echo "Jenkins build run." else echo "Jenkins build failed." fi 13年1月20日日曜日
  • 78. Overview - Team Continuous Integration Dev Mac VC& irc Linux CI Mac push hook git git (bare) Jenkins Notify Notify ircd XCode & irc Instruments Run Tests 13年1月20日日曜日
  • 79. xcrun? xcodebuild -project ./CLRH.xcodeproj clean build xcrun -sdk iphoneos PackageApplication -v ./build/ Release-iphoneos/CLRH.app -o "`pwd`/CLRH.ipa" Set Valid Distribution Identifier for Release Build. 13年1月20日日曜日
  • 80. Continuous Delivery • Use xcrun our case is all done manually. • In no constraint case, you can use Testflight. 13年1月20日日曜日
  • 81. Overview - Release Continuous Delivery Dev Mac VC Linux CI Mac git git (bare) Jenkins Destination VC Linux git XCode & web Instruments browser Repository browser 13年1月20日日曜日
  • 82. Overview - Release Continuous Delivery Dev Mac VC Linux CI Mac push polling git git (bare) Jenkins push Destination VC Linux DL git XCode & web Instruments browser Repository browser Run Tests 13年1月20日日曜日
  • 84. Any Auestion? ;-) 13年1月20日日曜日