SlideShare ist ein Scribd-Unternehmen logo
iOS Testautomatisierung
 und Continuous Integration
2. eBay Tech Talk - 22.11.2012




                                 1
Thomas Weese - Senior iOS Dev.
Holger Hammel - Team Lead; Java Dev.

mobile.de
•  Deutschlands größter Online-Fahrzeugmarkt
•  Teil des eBay-Konzerns
•  150 Leute, 60 Entwickler; Berlin
•  1,4 Mill. Fahrzeuge
•  ~ 1 Milliarde Page Impressions / Monat (7/2012)
•  rund 30% Traffic Share mobile devices


mobile.de Apps-Team
•  iOS, Android, mobile webapps;
•  13 Teammitglieder: Dev, Product, QA, Siteops
                                                     2
Apps werden komplexer


•  Inhaltliche Komplexität

•  iOS-Versionen und Gerätevielfalt

•  Sprach- und Länderversionen
   –  mobile.de, automobile.it, automobile.fr   iOS	
  6	
     68%	
  
                                                iOS	
  5	
     23%	
  
•  Lange Lebenszeit                             iOS	
  4	
      9%	
  


                                                                     3
Bugs sind sehr teuer


•  Apple Review => Mehrere Tage live

•  Kundenzufriedenheit sinkt

•  Schlechte Rezensionen

•  Marketingkampagnen verpuffen

•  Neue Funktionen müssen warten
                                       4
Automatisiert Testen? JA!


Zwar
•  Initial Aufwand nötig: Setup, Lernen, Pflege

Aber
•  Reduziert manuellen Testaufwand
•  Ermöglicht kurze Releasezyklen
•  Sichert Qualität
•  Spart Geld und Nerven
                                                  5
Effizient Testen - Erfahrungen

•    Risiken
•    Refactorings & Bugfixes
•    Kein Layout
•    Keine Trivial-Logik

•  Rote Tests = Stop-the-line
•  Keine Blinkertests
•  Externe Services
     –  Mock Server, Proxy       6
Testarten - Überblick


                                                      Unit Tests
                                                       OCUnit




                                            AkzeptanzTests
Given I touch the table cell           Cucumber -> Frank -> Simulator
When I enter the text "14532”




                                 Session Based Tests
                                Das Team & die Hardware

                                                                        7
Feature - Aufgabenstellung

A user can filter the result set by location and see his configuration on
the search form.




                                                                            8
UnitTest – Text Formatierung

   •  OCUnit (SenTestingKit)
   •  OCHamcrest

#pragma mark Tests!
!
// ...!
!
-(void) testFormatedLocationIsCorrectForDetailedLocation {!
    !
    // ...!
!
    QuickSearchViewController* vc =      !
        [[QuickSearchViewController alloc] initWithNibName: nil bundle: nil];!
    !
    NSString* formatedLabelText = !
        [vc formatedLocationLabelFromSearch: self.search];!
!
    assertThat(formatedLabelText,!
        is(equalTo(@"14532 Kleinmachnow, Deutschland, 100km")));!
}!
                                                                            9
Akzeptanztests: Cucumber

•  Behaviour Driven Development Tool
    –  ähnlich Concordion
•  für zB Java, .NET, via Frank mit Objective-C

•  Beschreibung von erwartetem Verhalten in
   natürlicher Sprache: english, deutsch, …
•  Pattern: Given – When – Then
•  Implementierung der Tests mit Ruby

http://cukes.info
                                                  10
Cucumber Szenario: Location Text

Scenario: A user can filter the result
set by a location and see his
configuration on the search form

!
Given I touch the table cell marked "PLZ, UmkreisCell”!
When I enter the text "14532" from keyboard to the !
      text field "Adresseneingabe”!
Then I should see "14532 Kleinmachnow, Deutschland" !
      in view "Adresseneingabe"!
!
When I touch "Zurück”!
Then I should see !
     "14532 Kleinmachnow, Deutschland, 100km” !
     in view "PLZ, UmkreisCell”

!                                                     11
Akzeptanztest Implementierung


Cucumber Akzeptanzkriterien

When I enter the text "14532" from keyboard to the
    !text field "Adresseneingabe”!

                              =>
Ruby Implementierung

When /^I enter the text "([^"]*)" from keyboard !
   to the text field "([^"]*)"$/ do !
  |text_to_type, text_field_mark|!
!
     selector = "view marked:'#{text_field_mark}' first”!
                                                        12
Frank

•  Cucumber Testszenarien auf
   iOS Simulator
                                    Given I touch the table cell

•  Steuerung des Simulators         When I enter the text "14532”
                                    Then I should see

   –  Touch, Swipe usw.


•  Selektieren und Inspektion von Elementen


http://testingwithfrank.com
                                                                    13
14
Fazit und Ausblick
•    Setup funktioniert
•    Tests finden Bugs
•    seit 2 Jahren praktisch keine Bugs in Produktion
•    4.5 Sterne Bewertung, 2 Millionen Downloads

•  Skalierbarkeit Frank/Cucumber ?
•  Ruby als Testimplementierungssprache

•  Testbasis vergrößern: Unit Tests, Test Driven Developement
•  Ständiges Evaluieren bekannter und neuer Frameworks
  •  UI Automation, kif, Selenium, …

                                                                15
Q&A
Holger Hammel
hhammel@team.mobile.de
twitter: @mobilep2

Thomas Weese
tweese@team.mobile.de


                              16
Links	
  

•  Cucumber:	
  h0p://cukes.info	
  	
  
•  Frank:	
  h0p://tes9ngwithfrank.com	
  
•  Hamcrest:	
  h0p://code.google.com/p/hamcrest/	
  

•  mobile.de	
  iOS-­‐App:	
  
   h0ps://itunes.apple.com/de/app/mobile.de-­‐
   mobile-­‐autoborse/id378563358	
  

Weitere ähnliche Inhalte

PDF
Wie mobile.de mobil wurde - Fast Feedback
DOCX
Bilangan pecahan
PDF
Four myths about peer code reviews - 7. ebay tech talk
DOCX
Bilangan pecahan
PPTX
Grupos ezequiel brito
PPTX
X 10 17-rani gusmayzarni
ODP
Presentació estat d' ànim de les persones
ODP
Power point informatica
Wie mobile.de mobil wurde - Fast Feedback
Bilangan pecahan
Four myths about peer code reviews - 7. ebay tech talk
Bilangan pecahan
Grupos ezequiel brito
X 10 17-rani gusmayzarni
Presentació estat d' ànim de les persones
Power point informatica

Ähnlich wie iOS Testautomation bei mobile.de (20)

PDF
Testing XAML-based Windows Store Apps mit VS 2013
PDF
DWX 2017 - Alternativen zu Visual-Studio-Testtools: Wann lohnt es sich auch m...
PDF
JavaScript und trotzdem Softwerker
PDF
Best Practices für TDD in JavaScript
KEY
Test-Driven-Development mit JUnit 4
PDF
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
PDF
JFS 2011 - Top 10 der Tools & Methoden - Baumgartner, Oehmichen
PDF
JFS 2011 - Top 10 Tools & Methoden - Baumgartner, Oehmichen
PDF
DWX 2014 - Coded UI in der Praxis: Von Lokalisierung bis Nachhaltigkeit
PDF
eCATT & OpenSource - Automatisierter Test in heterogenen Systemlandschaften
PPTX
Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10
ODP
Google Partners, Mobile Websites-Zertifizierung
PDF
Rails und Scrum in großen Projekten
PDF
UI Testautomation in der Praxis: Von Lokalisierung bis Nachhaltigkeit
PDF
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
PDF
Agile Softwareentwicklung mit Rails
PDF
Mobile Applikationen: Entwicklung, Rollout, Wartung - Tipps und Tricks für di...
PDF
Android Apps mit Xamarin entwickeln
PDF
BED-Con - Tools für den täglichen Kampf als Entwickler
PDF
Hightway to Hell - Responsive Webdesign Testen
Testing XAML-based Windows Store Apps mit VS 2013
DWX 2017 - Alternativen zu Visual-Studio-Testtools: Wann lohnt es sich auch m...
JavaScript und trotzdem Softwerker
Best Practices für TDD in JavaScript
Test-Driven-Development mit JUnit 4
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
JFS 2011 - Top 10 der Tools & Methoden - Baumgartner, Oehmichen
JFS 2011 - Top 10 Tools & Methoden - Baumgartner, Oehmichen
DWX 2014 - Coded UI in der Praxis: Von Lokalisierung bis Nachhaltigkeit
eCATT & OpenSource - Automatisierter Test in heterogenen Systemlandschaften
Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10
Google Partners, Mobile Websites-Zertifizierung
Rails und Scrum in großen Projekten
UI Testautomation in der Praxis: Von Lokalisierung bis Nachhaltigkeit
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
Agile Softwareentwicklung mit Rails
Mobile Applikationen: Entwicklung, Rollout, Wartung - Tipps und Tricks für di...
Android Apps mit Xamarin entwickeln
BED-Con - Tools für den täglichen Kampf als Entwickler
Hightway to Hell - Responsive Webdesign Testen
Anzeige

iOS Testautomation bei mobile.de

  • 1. iOS Testautomatisierung und Continuous Integration 2. eBay Tech Talk - 22.11.2012 1
  • 2. Thomas Weese - Senior iOS Dev. Holger Hammel - Team Lead; Java Dev. mobile.de •  Deutschlands größter Online-Fahrzeugmarkt •  Teil des eBay-Konzerns •  150 Leute, 60 Entwickler; Berlin •  1,4 Mill. Fahrzeuge •  ~ 1 Milliarde Page Impressions / Monat (7/2012) •  rund 30% Traffic Share mobile devices mobile.de Apps-Team •  iOS, Android, mobile webapps; •  13 Teammitglieder: Dev, Product, QA, Siteops 2
  • 3. Apps werden komplexer •  Inhaltliche Komplexität •  iOS-Versionen und Gerätevielfalt •  Sprach- und Länderversionen –  mobile.de, automobile.it, automobile.fr iOS  6   68%   iOS  5   23%   •  Lange Lebenszeit iOS  4   9%   3
  • 4. Bugs sind sehr teuer •  Apple Review => Mehrere Tage live •  Kundenzufriedenheit sinkt •  Schlechte Rezensionen •  Marketingkampagnen verpuffen •  Neue Funktionen müssen warten 4
  • 5. Automatisiert Testen? JA! Zwar •  Initial Aufwand nötig: Setup, Lernen, Pflege Aber •  Reduziert manuellen Testaufwand •  Ermöglicht kurze Releasezyklen •  Sichert Qualität •  Spart Geld und Nerven 5
  • 6. Effizient Testen - Erfahrungen •  Risiken •  Refactorings & Bugfixes •  Kein Layout •  Keine Trivial-Logik •  Rote Tests = Stop-the-line •  Keine Blinkertests •  Externe Services –  Mock Server, Proxy 6
  • 7. Testarten - Überblick Unit Tests OCUnit AkzeptanzTests Given I touch the table cell Cucumber -> Frank -> Simulator When I enter the text "14532” Session Based Tests Das Team & die Hardware 7
  • 8. Feature - Aufgabenstellung A user can filter the result set by location and see his configuration on the search form. 8
  • 9. UnitTest – Text Formatierung •  OCUnit (SenTestingKit) •  OCHamcrest #pragma mark Tests! ! // ...! ! -(void) testFormatedLocationIsCorrectForDetailedLocation {! ! // ...! ! QuickSearchViewController* vc = ! [[QuickSearchViewController alloc] initWithNibName: nil bundle: nil];! ! NSString* formatedLabelText = ! [vc formatedLocationLabelFromSearch: self.search];! ! assertThat(formatedLabelText,! is(equalTo(@"14532 Kleinmachnow, Deutschland, 100km")));! }! 9
  • 10. Akzeptanztests: Cucumber •  Behaviour Driven Development Tool –  ähnlich Concordion •  für zB Java, .NET, via Frank mit Objective-C •  Beschreibung von erwartetem Verhalten in natürlicher Sprache: english, deutsch, … •  Pattern: Given – When – Then •  Implementierung der Tests mit Ruby http://cukes.info 10
  • 11. Cucumber Szenario: Location Text Scenario: A user can filter the result set by a location and see his configuration on the search form ! Given I touch the table cell marked "PLZ, UmkreisCell”! When I enter the text "14532" from keyboard to the ! text field "Adresseneingabe”! Then I should see "14532 Kleinmachnow, Deutschland" ! in view "Adresseneingabe"! ! When I touch "Zurück”! Then I should see ! "14532 Kleinmachnow, Deutschland, 100km” ! in view "PLZ, UmkreisCell”
 ! 11
  • 12. Akzeptanztest Implementierung Cucumber Akzeptanzkriterien When I enter the text "14532" from keyboard to the !text field "Adresseneingabe”! => Ruby Implementierung When /^I enter the text "([^"]*)" from keyboard ! to the text field "([^"]*)"$/ do ! |text_to_type, text_field_mark|! ! selector = "view marked:'#{text_field_mark}' first”! 12
  • 13. Frank •  Cucumber Testszenarien auf iOS Simulator Given I touch the table cell •  Steuerung des Simulators When I enter the text "14532” Then I should see –  Touch, Swipe usw. •  Selektieren und Inspektion von Elementen http://testingwithfrank.com 13
  • 14. 14
  • 15. Fazit und Ausblick •  Setup funktioniert •  Tests finden Bugs •  seit 2 Jahren praktisch keine Bugs in Produktion •  4.5 Sterne Bewertung, 2 Millionen Downloads •  Skalierbarkeit Frank/Cucumber ? •  Ruby als Testimplementierungssprache •  Testbasis vergrößern: Unit Tests, Test Driven Developement •  Ständiges Evaluieren bekannter und neuer Frameworks •  UI Automation, kif, Selenium, … 15
  • 17. Links   •  Cucumber:  h0p://cukes.info     •  Frank:  h0p://tes9ngwithfrank.com   •  Hamcrest:  h0p://code.google.com/p/hamcrest/   •  mobile.de  iOS-­‐App:   h0ps://itunes.apple.com/de/app/mobile.de-­‐ mobile-­‐autoborse/id378563358