33
Building Mobile Masterpiece with Distributed Agile Weerasak (Wee) Witthawaskul October 22, 2013

Building Mobile (app) Masterpiece with Distributed Agile

Embed Size (px)

Citation preview

Page 1: Building Mobile (app) Masterpiece with Distributed Agile

Building  Mobile  Masterpiece    with  Distributed  Agile  

Weerasak  (Wee)  Witthawaskul  

October  22,  2013  

Page 2: Building Mobile (app) Masterpiece with Distributed Agile

First,  thanks  to…  

!   @weera  for  making  the  meetup  possible  

!   Agile66  Facebook  page  

!   Geeky  Base  for  location  and  facility  

!   And  all  of  you,  curious  smart  minds  

Page 3: Building Mobile (app) Masterpiece with Distributed Agile

Who  am  I?  

Page 4: Building Mobile (app) Masterpiece with Distributed Agile

Who  am  I?  

Page 5: Building Mobile (app) Masterpiece with Distributed Agile

Why  should  you  listen  to  me?  

!   You  already  know  agile  and  want  to  know  

how  I  adopted  distributed  agile  

!   You  want  to  know  why  mobile  development  

has  more  challenges  than  web  development  

!   How  you  can  apply  agility  to  your  projects  

Page 6: Building Mobile (app) Masterpiece with Distributed Agile

Case  Study  

Page 7: Building Mobile (app) Masterpiece with Distributed Agile

Morningstar  for  iPad  

!   Portfolio  management  and  

financial  research  app  

!   Shipped  in  September  2013  

!   Top  10  in  Finance  free  app  in  

US  store  as  of  October  2013  

Page 8: Building Mobile (app) Masterpiece with Distributed Agile

Demo  time  

Page 9: Building Mobile (app) Masterpiece with Distributed Agile

Project  History  

!   Initiated  in  2011  as  an  incubator  project  to  experiment  and  

complement  morningstar.com's  user  experience  using  

tablets  

!   The  company  already  had  smartphone  apps  on  iPhone,  

Android,  Blackberry  from  a  China  team  

!   I  joined  the  company  in  April  2011  as  the  first  Chicago  

developer  

!   Zero  professional  experience  with  mobile,  how  to  start?  

Page 10: Building Mobile (app) Masterpiece with Distributed Agile

Initial  Observations  •  Management  buy-­‐in  to  use  Agile  methods  

•  Young,  energetic  team  

•  Lack  of  process  &  automation  

•  UI  Design  work  was  not  in  the  same  sprints  

•  Ambitious  cross  platform  architecture  

•  Lack  of  OO  Design  &  Clean  Code  discipline  

Page 11: Building Mobile (app) Masterpiece with Distributed Agile

Action  Items  

•  Communication,  communication,  communication  

•  Architectural  and  Process  Analysis  

•  Continuous  Integration  Setup  

•  Product,  Design  and  Development  Sprint  Alignment  

•  Agile  Practice  Training  &  TDD  

 

Page 12: Building Mobile (app) Masterpiece with Distributed Agile

Tools  

•  JIRAs  for  distributed  team  whiteboards  

•  Jenkins  for  automated  build  &  deployment  

•  TestFlight  for  iOS  app  internal  distribution  

Page 13: Building Mobile (app) Masterpiece with Distributed Agile

Build  Pipeline  –  iOS  Client  

Client  code  checkins  

Unit  Test  Build  

Main  Build   TestFlight  

UI  Automation  Build  

Automated  User  Acceptance  Tests  

Page 14: Building Mobile (app) Masterpiece with Distributed Agile

Build  Pipeline  –  Server  

Server  code  checkins  

Unit  Test  Build   Main  Build  

Sanity  Test  Builds  with  SoapUI  

Internal  Dev  Server  

Stable  Dev  Server  

Manual  deploy  

Auto  deploy  

Page 15: Building Mobile (app) Masterpiece with Distributed Agile

Continuous  Integration  

•  Morningstar  app  for  iPad  

– 7,300+  (client)  and  2,600+  (server)  commits  

– 4,000+  automated  iPad  builds  &  deployments  

– 1,000+  automated  server  builds  &  deployments  

– Code  checkins  à  Test  builds  à  Deploy  builds  

10/22/13 Mobile Solutions Development Team 15

Page 16: Building Mobile (app) Masterpiece with Distributed Agile

Past  Internal  Environments  

10/22/13  Mobile  Solutions  

Development  Team   16  

Build  &  Auto    Deploy  

Dev  Server  

iOS  Devices  

OK   OK  OK  

Build  &  Auto    Deploy  

Build  &  Auto    Deploy  

Manual  1-­‐click  Deploy  

Stable  Dev    Server  

Page 17: Building Mobile (app) Masterpiece with Distributed Agile

Current  Environments  Build  &  Auto    

Deploy  

Dev  Server  

iOS  Devices  

Build  &  Auto    Deploy  

Build  &  Auto    Deploy  

Manual  1-­‐click  Deploy  with  approval  Stable  Dev    Server  

QA  Server  

Staging    Server  Live  

Server  

Page 18: Building Mobile (app) Masterpiece with Distributed Agile

Test  Driven  Development  •  Client  –  400+  Classes,  72,000+  LOC,  160+  XIBs  

–  600+  Unit  Tests  

– GHUnit  for  testing,  OCMock  for  mocking  

– User  Acceptance  Testing  •  Behavior  Driven  Test  with  Frank  (retired)  

•  Apple  UIAutomation  (under  development)  

10/22/13 Mobile Solutions Development Team 18

Page 19: Building Mobile (app) Masterpiece with Distributed Agile

Test  Driven  Development  

•  Server  –  230+  classes,  20K+  LOC  

–  180+  test  classes,  20K+  LOC  

–  86%  line  coverage  

–  65%  conditionals  coverage  

–  JUnit  for  testing  

–  JMockIt  for  mocking  

10/22/13 Mobile Solutions Development Team 19

Page 20: Building Mobile (app) Masterpiece with Distributed Agile

Full  Stack  Mobile  Development  

•  Concurrent  client  (iPad)  and  server  (Java)  development  

•  Multi-­‐version  support  

•  Client  or  server  logic  

•  Skillsets  

Page 21: Building Mobile (app) Masterpiece with Distributed Agile

Evolving  Architectures  

Request/Response  

Async  Server-­‐side  Publish/Subscribe  

Client-­‐side  Publish/Subscribe  

Past   Present   Future  

Page 22: Building Mobile (app) Masterpiece with Distributed Agile

Gateway  Architecture  

Morningstar  iPad  app  

Login  

MorningstarMobile  Server  

Portfolio  API  

Others  

HTML  pages  

REST/JSON  over  HTTPS  

UIWebView  over  HTTPS  

Apple  iTunes    In  App  Purchase  

Page 23: Building Mobile (app) Masterpiece with Distributed Agile

Reusable  Components  

Popover  with  bottom  fade  

effect  

Securities  labels  with  ratings  

Security  Charts  

Page 24: Building Mobile (app) Masterpiece with Distributed Agile

Publish/Subscribe  Architecture  

Each  row  subscribes  to  its  security  object  

When  the  app  receives  updates  to  a  security  object,  all  subscribers  get  latest  data  and  

update  views  

User  taps  to  see  mini-­‐quote  

Based  on  Event  subscription/notification  from  NSNotificationCenter  

Page 25: Building Mobile (app) Masterpiece with Distributed Agile

Internal  Features  

•  Feature  Toggles  

•  Internal  Server  Connection  

•  “Shake”  Feedback  

•  Logging  &  Performance  Monitoring  

Page 26: Building Mobile (app) Masterpiece with Distributed Agile

Feature  Toggles  •  Allow  us  to  experiment  with  new  features  

•  Can  be  used  to  enable/disable  features  based  on  context  

10/22/13 Mobile Solutions Development Team

Page 27: Building Mobile (app) Masterpiece with Distributed Agile

RESTful  APIs  

•  Since  we  cannot  control  published  app  

customer  upgrades*,  we  have  to  make  sure  

the  server  supports  multiple  client  app  

versions,  different  locales,  multiple  products.  

– REST  with  JSON  over  HTTPS  

– Cacheability,  CDN  friendly  (Akamai/Varnish)  

Page 28: Building Mobile (app) Masterpiece with Distributed Agile

RESTful  API  Examples  •  HTTPS  GET/PUT/POST/DELETE/OPTIONS  

•  Endpoint  convention  

–  Format:  https://{dns}/{ServicePrefix}/{resources}  

–  ServicePrefix  

•  /service/1.0/locales/en-­‐US/products/RT/  

–  REST  resources  

•  /securities/USA:MORN/news  

•  /securities/USA:MORN/quotes  

•  /securities/USA:MORN/info  

•  Example    

–  GET  https://mobileservice.morningstar.com/service/1.0/locales/en-­‐US/products/

RT/securities/USA:MORN/news  

Page 29: Building Mobile (app) Masterpiece with Distributed Agile

Standard  Data  Formats  •  “Glue”  between  client/server  

•  Standard  formats  for  Security,  

Holding,  Portfolio,  News  etc.  

•  Reusable  parsers  

•  JSON  data  types  

•  DateTime  in  UTC  (ISO8601)  

•  Regardless  of  data  formats  from  

different  data  sources,  mobile  

server  and  app  share  one  

common  format  

Page 30: Building Mobile (app) Masterpiece with Distributed Agile

Async  I/O    Promise<HttpResponse>,  WS.getAsync  and  Promise.waitAll  

Server   Security  Data   Portfolio  API   CMS  

Async  calls  Chained  of    HTTP    

response    Promises  

 waitAll  

     

transform  &  serialize  results  

Thread  yield  

Page 31: Building Mobile (app) Masterpiece with Distributed Agile

Launch  Results  

•  Public  launched  on  Sep  16,  2013  

•  5,000  app  downloads  in  1  week  

•  1M  web  service  calls  in  1  week;  4M  calls  in  3  

weeks  

•  Average  web  service  response  time  is  ~712ms  

Page 32: Building Mobile (app) Masterpiece with Distributed Agile

Rome  was  not  built  in  a  day  •  Agile  is  more  a  guideline.  Mix  &  match  for  your  team  

•  Focus  on  working  software  

•  Iterate,  iterate  and  iterate  

•  Internal  feedback  is  good;  external  feedback  is  great  

•  Deadline  vs  Feature  dilemma  

•  Continual  improvements  and  releases  are  key  to  

improve  user  engagement  &  satisfaction  

Page 33: Building Mobile (app) Masterpiece with Distributed Agile

First  release  is  just  the  beginning  Creating  masterpiece  is  the  end  goal  

Thanks  &  Questions?  @_wee_