20150423 m3

34

Upload: kazuaki-matsuo

Post on 12-Apr-2017

94 views

Category:

Software


0 download

TRANSCRIPT

Page 1: 20150423 m3
Page 2: 20150423 m3

Name: Matsuo KazuakiTwitter: @Kazu_cocoa

Job:(Mobile)Test Engineer @Cookpad

Page 3: 20150423 m3

index

• Our philosophy

• Development - Web applications

• Development - Mobile applications

• Conclusion

Page 4: 20150423 m3

Our Manifesto

Page 5: 20150423 m3

User First

Our Philosophy

Page 6: 20150423 m3

Our Huge Rails Application

Page 7: 20150423 m3

Web Application(include API Server)

Page 8: 20150423 m3

Web Site

Page 9: 20150423 m3

% 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

% bundle show | wc -l284

Page 11: 20150423 m3

Deployment PipelinePR

mer

ge

pull

tag

depl

oy

depl

oy

Page 12: 20150423 m3

• 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

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
Page 15: 20150423 m3

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

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

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

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

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

Challenge to Microservices

• Cookpad is a huge monolithic application

Page 21: 20150423 m3

Challenge to Microservices

• Many small web applications

• Keep release cycle quickly

• Stable and quick deploy

• ex. mamiya(our original tool)

Page 22: 20150423 m3

How to keep stable them?

• Dependency

• Distributed Computing…

It’s one of my task… 😢

Page 23: 20150423 m3

Mobile Application(iOS/Android)

Page 24: 20150423 m3

Release flow

Page 25: 20150423 m3

PipelinePR

mer

ge

pull

tag

publ

ish

to in

tern

al

Page 26: 20150423 m3

• 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

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

Test Level

• Unit Test

• Integration Test

• Feature Test

• Performance / GUI and so on.

• Make more efficient for tests

Page 29: 20150423 m3

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

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

Other tests

Page 32: 20150423 m3

• Performance

• Security

• Attractive

and so on…

Page 33: 20150423 m3

Conclusion

• We test to keep high speed development cycle.

• We challenge to Microservices.

• We challenge how to value mobile applications.

Page 34: 20150423 m3

Thank you.