SlideShare uma empresa Scribd logo
1 de 17
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	
  

Mais conteúdo relacionado

Semelhante a iOS Testautomation bei mobile.de

Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
simmerl121
 
Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10
Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10
Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10
Ralf Sigmund
 
Rails und Scrum in großen Projekten
Rails und Scrum in großen ProjektenRails und Scrum in großen Projekten
Rails und Scrum in großen Projekten
Phillip Oertel
 

Semelhante a iOS Testautomation bei mobile.de (20)

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

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