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日日曜日
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日日曜日
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日日曜日
67. Jenkins
• Building/testing software
projects continuously
• Work with version controls
• Many Plug-in
• Easy to Install & Configure
• Run Any Scripts
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日日曜日