SlideShare uma empresa Scribd logo
1 de 38
Testing iOS Apps
                        Graham Lee / @secboffin




Monday, 25 March 13
Watch the video with slide
                         synchronization on InfoQ.com!
                      http://www.infoq.com/presentations
                                  /testing-iOS

       InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
  Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Presented at QCon London
                       www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
 - practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Penetration

                      Unit


                                  Integration


                                   Whole-app



                      A lot to cover
Monday, 25 March 13
Agenda




Monday, 25 March 13
Agenda
                      • High-level overview of testing options




Monday, 25 March 13
Agenda
                      • High-level overview of testing options
                      • Native iOS apps, with some browser
                        component




Monday, 25 March 13
Agenda
                      • High-level overview of testing options
                      • Native iOS apps, with some browser
                        component
                      • Unit tests



Monday, 25 March 13
Agenda
                      • High-level overview of testing options
                      • Native iOS apps, with some browser
                        component
                      • Unit tests
                      • Integration tests


Monday, 25 March 13
Agenda
                      • High-level overview of testing options
                      • Native iOS apps, with some browser
                        component
                      • Unit tests
                      • Integration tests
                      • Penetration tests
Monday, 25 March 13
Unit Tests

                      •   OCUnit built into
                          Xcode

                      •   Reasonable GUI
                          Integration as of v4

                      •   Baroque and outdated
                          syntax




Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
@implementation StackOverflowCommunicatorTests

   - (void)setUp {
       communicator = [[InspectableStackOverflowCommunicator alloc] init];
   }

   - (void)tearDown {
       [communicator cancelAndDiscardURLConnection];
   }

   - (void)testSearchingForQuestionsOnTopicCallsTopicAPI {
       [communicator searchForQuestionsWithTag: @"ios"];
       STAssertEqualObjects([[communicator URLToFetch] absoluteString], @"http://
   api.stackoverflow.com/1.1/search?tagged=ios&pagesize=20", @"Use the search API to find
   questions with a particular tag");
   }

   @end




Monday, 25 March 13
https://github.com/philSquared/Catch




       “CATCH stands for C++ Automated Test Cases in Headers
       and is a multi-paradigm automated test framework for C, C++
       and Objective-C. It is implemented entirely in a set of
       headers, but is packaged up as a single header for extra
       convenience.”




Monday, 25 March 13
TEST_CASE("parser/API", "Design the public interface for the parser")
             {
                FZASourceParser *parser = [FZASourceParser new];
                SECTION("acceptableIO", "Accept unparsed, generate parsed targets")
                 {
                     TestBuildTarget *target = [TestBuildTarget new];
                     id <FZABuildTarget> output = nil;
                     target.parsed = YES;
                     CHECK_THROWS(output = [parser parse: target]);
                     CHECK(output == nil);

                       target.parsed = NO;
                       CHECK_NOTHROW(output = [parser parse: target]);
                       CHECK([output conformsToProtocol: @protocol(FZABuildTarget)]);
                       CHECK([[output name] isEqualToString: [target name]]);
                       CHECK([output isParsed] == YES);
                       [target release];
                   }
                  [parser release];
             }

             TEST_CASE("parser/run", "Run through the test project and see what we find")
             {
                 FZASourceParser *parser = [FZASourceParser new];
                 FZAXcodeProject *project = [[FZAXcodeProject alloc] initWithProjectFolder:
             @"TestProject.xcodeproj"];
                 id <FZABuildTarget>parsedTarget = [parser parse: [project targetAtIndex: 0]];
                 REQUIRE(parsedTarget != nil);
                 CHECK([parsedTarget countOfFunctions] == 1);
                 [project release];
                 [parser release];
             }

Monday, 25 March 13
It’s not a “unit test”
                            framework…

                      • …it’s a framework for running tests
                      • …and for reporting test results
                      • Integration tests, whole-app tests


Monday, 25 March 13
Calabash

                      • https://github.com/calabash/calabash-ios
                      • http://calaba.sh
                      • BDD-style spec format for tests
                      • Automatic runner/reporter

Monday, 25 March 13
$ calabash-
       ios console
       > query("label")
       …
           [0] {
                      "rect" => {
                   "center_y" => 261.5,
                      "width" => 300,
                   "center_x" => 160,
                     "height" => 43,
                          "x" => 10,
                          "y" => 240
               },
                     "frame" => {
                    "width" => 300,
                   "height" => 43,
                        "x" => 10,
                        "y" => 0
               },
               "description" => "<UILabel: 0x72f0920;
       frame = (10 0; 300 43); text = 'iPhone';
       clipsToBounds = YES; userInteractionEnabled =
       NO; layer = <CALayer: 0x72f09b0>>",
                    "UIType" => "UIView",
                     "class" => "UILabel"
           },
       …


Monday, 25 March 13
$ calabash-
       ios console
       > touch(query("label
       marked:'iPhone'"))




Monday, 25 March 13
Given I am on the Welcome Screen
                      Then I choose the section iPhone
                      And take picture




Then "I choose the section $section" do |section|
      touch("view label text:'#{section}'")
end



Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
var target = UIATarget.localTarget();
               var app = target.frontMostApp();
               var window = app.mainWindow();
               target.logElementTree();




Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
var target = UIATarget.localTarget();
           var app = target.frontMostApp();
           var window = app.mainWindow();
           var tableView = window.tableViews()[0];
           var iPhoneCell = tableView.cells()
           ["iPhone"];
           iPhoneCell.tap();



             WWDC 2010 Session 306: Automating UI Testing
                        with Instruments
Monday, 25 March 13
Testing app-bundled JS
Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
Monday, 25 March 13
–[UIWebView
              stringByEvaluatingJavaScriptFromString:]




Monday, 25 March 13
Monday, 25 March 13
https://www.owasp.org/index.php/
                        IOS_Developer_Cheat_Sheet
Monday, 25 March 13
Testing iOS Apps
                        Graham Lee / @secboffin




Monday, 25 March 13

Mais conteúdo relacionado

Mais procurados

Créer et gérer une scratch org avec Visual Studio Code
Créer et gérer une scratch org avec Visual Studio CodeCréer et gérer une scratch org avec Visual Studio Code
Créer et gérer une scratch org avec Visual Studio CodeThierry TROUIN ☁
 
Comment utiliser Visual Studio Code pour travailler avec une scratch Org
Comment utiliser Visual Studio Code pour travailler avec une scratch OrgComment utiliser Visual Studio Code pour travailler avec une scratch Org
Comment utiliser Visual Studio Code pour travailler avec une scratch OrgThierry TROUIN ☁
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testingAdam Siton
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Iakiv Kramarenko
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Iakiv Kramarenko
 
Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybaraIakiv Kramarenko
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemAlexander Casall
 
Testing for Pragmatic People
Testing for Pragmatic PeopleTesting for Pragmatic People
Testing for Pragmatic Peopledavismr
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasyAnkit Goel
 
Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Lars Vogel
 

Mais procurados (12)

Créer et gérer une scratch org avec Visual Studio Code
Créer et gérer une scratch org avec Visual Studio CodeCréer et gérer une scratch org avec Visual Studio Code
Créer et gérer une scratch org avec Visual Studio Code
 
Comment utiliser Visual Studio Code pour travailler avec une scratch Org
Comment utiliser Visual Studio Code pour travailler avec une scratch OrgComment utiliser Visual Studio Code pour travailler avec une scratch Org
Comment utiliser Visual Studio Code pour travailler avec une scratch Org
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
 
Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybara
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and Ecosystem
 
Testing for Pragmatic People
Testing for Pragmatic PeopleTesting for Pragmatic People
Testing for Pragmatic People
 
Tdd
TddTdd
Tdd
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made Easy
 
Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010
 
SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 

Destaque

Automated UI testing for iOS apps using KIF framework and Swift
Automated UI testing for iOS apps using KIF framework and SwiftAutomated UI testing for iOS apps using KIF framework and Swift
Automated UI testing for iOS apps using KIF framework and SwiftJurgis Kirsakmens
 
Frank iOS Testing
Frank iOS TestingFrank iOS Testing
Frank iOS Testingsgleadow
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockRobot Media
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testingsgleadow
 
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIFAutomated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIFMichele Titolo
 

Destaque (8)

iOS testing
iOS testingiOS testing
iOS testing
 
iOS Testing
iOS TestingiOS Testing
iOS Testing
 
Automated UI testing for iOS apps using KIF framework and Swift
Automated UI testing for iOS apps using KIF framework and SwiftAutomated UI testing for iOS apps using KIF framework and Swift
Automated UI testing for iOS apps using KIF framework and Swift
 
iOS Testing
iOS TestingiOS Testing
iOS Testing
 
Frank iOS Testing
Frank iOS TestingFrank iOS Testing
Frank iOS Testing
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testing
 
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIFAutomated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
 

Semelhante a Testing iOS Apps

Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversingEnrique López Mañas
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesTriTAUG
 
Intro to JavaScript Testing
Intro to JavaScript TestingIntro to JavaScript Testing
Intro to JavaScript TestingRan Mizrahi
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
Mobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileMobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileKonstantin Loginov
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIwajrcs
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java ProjectVincent Massol
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testingpleeps
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!Ortus Solutions, Corp
 
Fostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessFostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessJosiah Renaudin
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 
Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projectsVincent Massol
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testingMats Bryntse
 
Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Buşra Deniz, CSM
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchMats Bryntse
 
利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試Jeremy Kao
 

Semelhante a Testing iOS Apps (20)

Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversing
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
 
Intro to JavaScript Testing
Intro to JavaScript TestingIntro to JavaScript Testing
Intro to JavaScript Testing
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
Mobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileMobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve Mobile
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java Project
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
 
Fostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessFostering Long-Term Test Automation Success
Fostering Long-Term Test Automation Success
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projects
 
Calabash for iPhone apps
Calabash for iPhone appsCalabash for iPhone apps
Calabash for iPhone apps
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
 
Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試
 

Mais de C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

Mais de C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Último

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Testing iOS Apps

  • 1. Testing iOS Apps Graham Lee / @secboffin Monday, 25 March 13
  • 2. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /testing-iOS InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month
  • 3. Presented at QCon London www.qconlondon.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Penetration Unit Integration Whole-app A lot to cover Monday, 25 March 13
  • 6. Agenda • High-level overview of testing options Monday, 25 March 13
  • 7. Agenda • High-level overview of testing options • Native iOS apps, with some browser component Monday, 25 March 13
  • 8. Agenda • High-level overview of testing options • Native iOS apps, with some browser component • Unit tests Monday, 25 March 13
  • 9. Agenda • High-level overview of testing options • Native iOS apps, with some browser component • Unit tests • Integration tests Monday, 25 March 13
  • 10. Agenda • High-level overview of testing options • Native iOS apps, with some browser component • Unit tests • Integration tests • Penetration tests Monday, 25 March 13
  • 11. Unit Tests • OCUnit built into Xcode • Reasonable GUI Integration as of v4 • Baroque and outdated syntax Monday, 25 March 13
  • 14. @implementation StackOverflowCommunicatorTests - (void)setUp { communicator = [[InspectableStackOverflowCommunicator alloc] init]; } - (void)tearDown { [communicator cancelAndDiscardURLConnection]; } - (void)testSearchingForQuestionsOnTopicCallsTopicAPI { [communicator searchForQuestionsWithTag: @"ios"]; STAssertEqualObjects([[communicator URLToFetch] absoluteString], @"http:// api.stackoverflow.com/1.1/search?tagged=ios&pagesize=20", @"Use the search API to find questions with a particular tag"); } @end Monday, 25 March 13
  • 15. https://github.com/philSquared/Catch “CATCH stands for C++ Automated Test Cases in Headers and is a multi-paradigm automated test framework for C, C++ and Objective-C. It is implemented entirely in a set of headers, but is packaged up as a single header for extra convenience.” Monday, 25 March 13
  • 16. TEST_CASE("parser/API", "Design the public interface for the parser") { FZASourceParser *parser = [FZASourceParser new]; SECTION("acceptableIO", "Accept unparsed, generate parsed targets") { TestBuildTarget *target = [TestBuildTarget new]; id <FZABuildTarget> output = nil; target.parsed = YES; CHECK_THROWS(output = [parser parse: target]); CHECK(output == nil); target.parsed = NO; CHECK_NOTHROW(output = [parser parse: target]); CHECK([output conformsToProtocol: @protocol(FZABuildTarget)]); CHECK([[output name] isEqualToString: [target name]]); CHECK([output isParsed] == YES); [target release]; } [parser release]; } TEST_CASE("parser/run", "Run through the test project and see what we find") { FZASourceParser *parser = [FZASourceParser new]; FZAXcodeProject *project = [[FZAXcodeProject alloc] initWithProjectFolder: @"TestProject.xcodeproj"]; id <FZABuildTarget>parsedTarget = [parser parse: [project targetAtIndex: 0]]; REQUIRE(parsedTarget != nil); CHECK([parsedTarget countOfFunctions] == 1); [project release]; [parser release]; } Monday, 25 March 13
  • 17. It’s not a “unit test” framework… • …it’s a framework for running tests • …and for reporting test results • Integration tests, whole-app tests Monday, 25 March 13
  • 18. Calabash • https://github.com/calabash/calabash-ios • http://calaba.sh • BDD-style spec format for tests • Automatic runner/reporter Monday, 25 March 13
  • 19. $ calabash- ios console > query("label") … [0] { "rect" => { "center_y" => 261.5, "width" => 300, "center_x" => 160, "height" => 43, "x" => 10, "y" => 240 }, "frame" => { "width" => 300, "height" => 43, "x" => 10, "y" => 0 }, "description" => "<UILabel: 0x72f0920; frame = (10 0; 300 43); text = 'iPhone'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x72f09b0>>", "UIType" => "UIView", "class" => "UILabel" }, … Monday, 25 March 13
  • 20. $ calabash- ios console > touch(query("label marked:'iPhone'")) Monday, 25 March 13
  • 21. Given I am on the Welcome Screen Then I choose the section iPhone And take picture Then "I choose the section $section" do |section| touch("view label text:'#{section}'") end Monday, 25 March 13
  • 24. var target = UIATarget.localTarget(); var app = target.frontMostApp(); var window = app.mainWindow(); target.logElementTree(); Monday, 25 March 13
  • 27. var target = UIATarget.localTarget(); var app = target.frontMostApp(); var window = app.mainWindow(); var tableView = window.tableViews()[0]; var iPhoneCell = tableView.cells() ["iPhone"]; iPhoneCell.tap(); WWDC 2010 Session 306: Automating UI Testing with Instruments Monday, 25 March 13
  • 35. –[UIWebView stringByEvaluatingJavaScriptFromString:] Monday, 25 March 13
  • 37. https://www.owasp.org/index.php/ IOS_Developer_Cheat_Sheet Monday, 25 March 13
  • 38. Testing iOS Apps Graham Lee / @secboffin Monday, 25 March 13