20150423 m3
-
Upload
kazuaki-matsuo -
Category
Software
-
view
86 -
download
0
Transcript of 20150423 m3
![Page 1: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/1.jpg)
![Page 2: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/2.jpg)
Name: Matsuo KazuakiTwitter: @Kazu_cocoa
Job:(Mobile)Test Engineer @Cookpad
![Page 3: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/3.jpg)
index
• Our philosophy
• Development - Web applications
• Development - Mobile applications
• Conclusion
![Page 4: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/4.jpg)
•
•
•
•
•
•
•
•
•
•
•
•
Our Manifesto
![Page 5: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/5.jpg)
User First
Our Philosophy
![Page 6: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/6.jpg)
Our Huge Rails Application
![Page 7: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/7.jpg)
Web Application(include API Server)
![Page 8: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/8.jpg)
Web Site
![Page 9: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/9.jpg)
% rake stats+----------------------+-------+-------+---------+---------+-----+-------+| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |+----------------------+-------+-------+---------+---------+-----+-------+| Controllers | 49708 | 40012 | 537 | 4054 | 7 | 7 || Helpers | 15122 | 12420 | 15 | 1432 | 95 | 6 || Models | 98535 | 77593 | 1786 | 8670 | 4 | 6 || Mailers | 2122 | 1698 | 41 | 198 | 4 | 6 || Workers | 639 | 540 | 20 | 31 | 1 | 15 || Chanko units | 12544 | 10354 | 6 | 255 | 42 | 38 || Libraries | 49927 | 41289 | 603 | 3724 | 6 | 9 || Feature specs | 45798 | 37707 | 0 | 208 | 0 | 179 || Request specs | 39112 | 33563 | 0 | 16 | 0 | 2095 || Routing specs | 664 | 536 | 0 | 0 | 0 | 0 || Controller specs | 60829 | 50293 | 7 | 127 | 18 | 394 || Helper specs | 79735 | 65835 | 5 | 73 | 14 | 899 || Model specs | 151719|125330 | 6 | 128 | 21 | 977 || Worker specs | 862 | 715 | 0 | 1 | 0 | 713 || Chanko unit specs | 10396 | 8379 | 0 | 9 | 0 | 929 || Library specs | 23528 | 19679 | 27 | 128 | 4 | 151 |+----------------------+-------+-------+---------+---------+-----+-------+| Total |641240 |525943 | 3053 | 19054 | 6 | 25 |+----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 183906 Test LOC: 342037 Code to Test Ratio: 1:1.9
![Page 10: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/10.jpg)
% bundle show | wc -l284
![Page 11: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/11.jpg)
Deployment PipelinePR
mer
ge
pull
tag
depl
oy
depl
oy
![Page 12: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/12.jpg)
• Frequent small release
• 10+ deploy per a day
• To decrease incident risk per deploy
• Minimise period of incidents
• Roll back with low risk
• Finish rollback within 1 min
Release cycle
![Page 13: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/13.jpg)
Development style
• Team exist in each departments
• Basically, they don’t have any test engineers.
• One monolithic application
• Challenging to Microservices…
• Each developers are in charge of their own implemented feature.
![Page 14: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/14.jpg)
![Page 15: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/15.jpg)
Must write test code
• All developers should implement test code before merge pr to master.
• Why…
• To keep development cycle
• We can’t estimate side-effect
![Page 16: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/16.jpg)
Automated Test
• Must implement specs when implement features
• RSpec based tests
• 20000+ RSpec examples
• It takes many hours finishing all test.
• Capybara
• with Headless browser
![Page 17: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/17.jpg)
Hand Test
• Checked on production test
• Before release
• Checked feature by developers
• Tests on development phase
• User test(Internal benchmark)
• Security Test
• and so on…
![Page 18: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/18.jpg)
Priority in test code
• Keep test quick
• We want to keep release cycle quick.
• Developed RRRSpec to keep speed
• Finish all spec test cases around 5 hour => Finish within 10 minutes
![Page 19: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/19.jpg)
Tools developed by Cookpad• Chanko
• protect incidents• RRRSpec
• Distributed Rspec framework• Switch_point
• change target DB• Database_rewinder
• fast database cleaner• Kage
• proxy to send copied real request to test environments.
![Page 20: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/20.jpg)
Challenge to Microservices
• Cookpad is a huge monolithic application
![Page 21: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/21.jpg)
Challenge to Microservices
• Many small web applications
• Keep release cycle quickly
• Stable and quick deploy
• ex. mamiya(our original tool)
![Page 22: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/22.jpg)
How to keep stable them?
• Dependency
• Distributed Computing…
It’s one of my task… 😢
![Page 23: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/23.jpg)
Mobile Application(iOS/Android)
![Page 24: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/24.jpg)
Release flow
![Page 25: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/25.jpg)
PipelinePR
mer
ge
pull
tag
publ
ish
to in
tern
al
![Page 26: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/26.jpg)
• Around 2 week release cycle
• Decide which feature implement in which cycle by each departments
• High release cycle lead unpleasant
• Optimize to Google Play / App Store
Release
![Page 27: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/27.jpg)
Development• mobile-infra
• iOS/Android engineers: 3
• Test Engineer: 1 <= ME!!✊
• Each departments
• Android / iOS engineers
• API engineers (also develop web site)
• Not one team develop our application.
![Page 28: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/28.jpg)
Test Level
• Unit Test
• Integration Test
• Feature Test
• Performance / GUI and so on.
• Make more efficient for tests
![Page 29: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/29.jpg)
Develop/Test Tools• Debug
• Stetho, PonyDebugger• Enhance Testability
• AndroidJUnit4 and Java libraries• XCTest, Mocks• Appium, Espresso, UIAutomation
• Reporting• Turnip / turnip_formatter• kobold
![Page 30: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/30.jpg)
Challenge to continuous stable release…
• Reduce review load• Dokumi• Comment the result of static analytics automatically.
• Enhance testability• DI into Android…• Establish hermetic environment
![Page 31: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/31.jpg)
Other tests
![Page 32: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/32.jpg)
• Performance
• Security
• Attractive
and so on…
![Page 33: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/33.jpg)
Conclusion
• We test to keep high speed development cycle.
• We challenge to Microservices.
• We challenge how to value mobile applications.
![Page 34: 20150423 m3](https://reader035.fdocuments.in/reader035/viewer/2022062903/58ce67831a28ab2f268b6e27/html5/thumbnails/34.jpg)
Thank you.