SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Who am I 32 years old happy software developer Mobile addicted Android enthusiastic Free software fan 
  and Tiramisu' lover rainbowbreeze
Overview Setup the environment Test with Junit 3 Test with special Android mocks Android monkey and monkeyrunner External libraries: Robotium TDD with Robolectric Example of advanced scenario
Setup the environment http://developer.android.com/guide/topics/testing/testing_android.html
Test with Junit 3 ,[object Object],[object Object]
Run it! http://developer.android.com/resources/tutorials/testing/helloandroid_test.html
Test with special Android Mock AndroidTestCase (mock context, MoreAsserts) http://developer.android.com/reference/android/test/AndroidTestCase.html http://developer.android.com/reference/android/test/MoreAsserts.html  http://developer.android.com/reference/android/test/IsolatedContext.html
Test with special Android Mock ApplicationTestCase (mock context) http://developer.android.com/reference/android/test/ApplicationTestCase.html
Test with special Android Mock ActivityInstrumentationTestCase2 (mock intent) ActivityUnitTestCase (mock context and application) SingleLaunchActivityTestCase (single environment thru tests) ViewAsserts (extended asserts) http://developer.android.com/guide/topics/testing/activity_testing.html  http://developer.android.com/resources/tutorials/testing/activity_test.html http://developer.android.com/reference/android/test/ViewAsserts.html
Test with special Android Mock ProviderTestCase2 (mock ontext and application, MockContentResolver) http://developer.android.com/guide/topics/testing/contentprovider_testing.html
Test with special Android Mock ServiceTestCase (mock context and application) test the service lifecycle, not the logic (detached) http://developer.android.com/guide/topics/testing/service_testing.html
Test with special Android Mock MockApplication, MockContext, MockContentProvider (API8), MockCursor (API8), MockDialogInterface, MockPackageManager, MockResources MockContentResolver, IsolatedContext
Android monkey adb shell monkey -p your.package.name -v 500 http://developer.android.com/guide/developing/tools/monkey.html http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
Android monkeyrunner monkeyrunner writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
Robotium Automatic black-box test cases for Android applications Your applications or black-box apk http://code.google.com/p/robotium/
TDD with Robolectric Robolectric is a unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app. TDD also for Android (yuppi)! Shadow objects (stock and custom) Integrable with RoboGuice for IoC/DI http://pivotal.github.com/robolectric/
Example of advanced scenario Created a framework for test automation Now QA write XML files corresponding to specific test cases Drastic time redution: from days to 30 minutes Free software! Link to website
Example of advanced scenario Complex and boring test cases to verify upon each release of the product / user stories Android / Blackberry / iPhone tests Junit for logic, but for server integration / different OSes capabilites?

Weitere Àhnliche Inhalte

Was ist angesagt?

Was ist angesagt? (12)

Visual Studio 2015 Diagnostic and Debugging Tools
Visual Studio 2015 Diagnostic and Debugging ToolsVisual Studio 2015 Diagnostic and Debugging Tools
Visual Studio 2015 Diagnostic and Debugging Tools
 
Ant Unit Your Functional Test
Ant Unit Your Functional TestAnt Unit Your Functional Test
Ant Unit Your Functional Test
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answers
 
Chennai.rb testing workshop mar 5, 2016
Chennai.rb testing workshop mar 5, 2016Chennai.rb testing workshop mar 5, 2016
Chennai.rb testing workshop mar 5, 2016
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Robot Framework :: Demo login application
Robot Framework :: Demo login applicationRobot Framework :: Demo login application
Robot Framework :: Demo login application
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
Robot Framework with Python | Edureka
Robot Framework with Python | EdurekaRobot Framework with Python | Edureka
Robot Framework with Python | Edureka
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questions
 
TDD for joomla extensions
TDD for joomla extensionsTDD for joomla extensions
TDD for joomla extensions
 
REST API level TDD with NodeJS
REST API level TDD with NodeJSREST API level TDD with NodeJS
REST API level TDD with NodeJS
 
Holy "Test Pyramid" , how it ruins your life
Holy "Test Pyramid" , how it ruins your lifeHoly "Test Pyramid" , how it ruins your life
Holy "Test Pyramid" , how it ruins your life
 

Andere mochten auch

Andere mochten auch (6)

BlueSecurity: quando il dente fa male!
BlueSecurity: quando il dente fa male!BlueSecurity: quando il dente fa male!
BlueSecurity: quando il dente fa male!
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
Android TV: Building apps with Google’s Leanback Library
Android TV: Building apps with  Google’s Leanback LibraryAndroid TV: Building apps with  Google’s Leanback Library
Android TV: Building apps with Google’s Leanback Library
 
Android Wear Presentation
Android Wear PresentationAndroid Wear Presentation
Android Wear Presentation
 
Android Protips: Advanced Topics for Expert Android App Developers
Android Protips: Advanced Topics for Expert Android App DevelopersAndroid Protips: Advanced Topics for Expert Android App Developers
Android Protips: Advanced Topics for Expert Android App Developers
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 

Ähnlich wie Testing in Android: automatici, di integrazione, TDD e scenari avanzati

Android crash course
Android crash courseAndroid crash course
Android crash course
Showmax Engineering
 
androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.ppt
BijayKc16
 
Android developer's toolbox
Android developer's toolboxAndroid developer's toolbox
Android developer's toolbox
Alex Verdyan
 

Ähnlich wie Testing in Android: automatici, di integrazione, TDD e scenari avanzati (20)

[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
 
API Doc Smackdown
API Doc SmackdownAPI Doc Smackdown
API Doc Smackdown
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using Robotium
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Robotium
RobotiumRobotium
Robotium
 
Android crash course
Android crash courseAndroid crash course
Android crash course
 
androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.ppt
 
Android testing
Android testingAndroid testing
Android testing
 
Android developer's toolbox
Android developer's toolboxAndroid developer's toolbox
Android developer's toolbox
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
Top 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaTop 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | Edureka
 
Keep calm and write reusable code in Android
Keep calm and write reusable code in AndroidKeep calm and write reusable code in Android
Keep calm and write reusable code in Android
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2
 
Boquet manager
Boquet managerBoquet manager
Boquet manager
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
 
Uber Mobility Meetup: Mobile Testing
Uber Mobility Meetup:  Mobile TestingUber Mobility Meetup:  Mobile Testing
Uber Mobility Meetup: Mobile Testing
 

Mehr von Alfredo Morresi

Mehr von Alfredo Morresi (11)

Android Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAndroid Survival Guide - Two years of software development
Android Survival Guide - Two years of software development
 
Advanced Android Development
Advanced Android DevelopmentAdvanced Android Development
Advanced Android Development
 
Mobile platforms development overview
Mobile platforms development overviewMobile platforms development overview
Mobile platforms development overview
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Refactoring 2 The Max
Refactoring 2 The MaxRefactoring 2 The Max
Refactoring 2 The Max
 
Funambol Code Sniper - Avatargrabber
Funambol Code Sniper - AvatargrabberFunambol Code Sniper - Avatargrabber
Funambol Code Sniper - Avatargrabber
 
Mobile security & privacy - Paranoia in movimento
Mobile security & privacy - Paranoia in movimentoMobile security & privacy - Paranoia in movimento
Mobile security & privacy - Paranoia in movimento
 
Tesi cartoni animati e modelli culturali
Tesi cartoni animati e modelli culturaliTesi cartoni animati e modelli culturali
Tesi cartoni animati e modelli culturali
 
(in)Sicurezze delle reti wireless 802.11b
(in)Sicurezze delle reti wireless 802.11b(in)Sicurezze delle reti wireless 802.11b
(in)Sicurezze delle reti wireless 802.11b
 
2(.0) passi nel mondo mobile - Alfredo Morresi
2(.0) passi nel mondo mobile - Alfredo Morresi2(.0) passi nel mondo mobile - Alfredo Morresi
2(.0) passi nel mondo mobile - Alfredo Morresi
 
QR code - Alfredo Morresi
QR code - Alfredo MorresiQR code - Alfredo Morresi
QR code - Alfredo Morresi
 

KĂŒrzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

KĂŒrzlich hochgeladen (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech 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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Testing in Android: automatici, di integrazione, TDD e scenari avanzati

  • 1. Who am I 32 years old happy software developer Mobile addicted Android enthusiastic Free software fan 
 and Tiramisu' lover rainbowbreeze
  • 2. Overview Setup the environment Test with Junit 3 Test with special Android mocks Android monkey and monkeyrunner External libraries: Robotium TDD with Robolectric Example of advanced scenario
  • 3. Setup the environment http://developer.android.com/guide/topics/testing/testing_android.html
  • 4.
  • 6. Test with special Android Mock AndroidTestCase (mock context, MoreAsserts) http://developer.android.com/reference/android/test/AndroidTestCase.html http://developer.android.com/reference/android/test/MoreAsserts.html http://developer.android.com/reference/android/test/IsolatedContext.html
  • 7. Test with special Android Mock ApplicationTestCase (mock context) http://developer.android.com/reference/android/test/ApplicationTestCase.html
  • 8. Test with special Android Mock ActivityInstrumentationTestCase2 (mock intent) ActivityUnitTestCase (mock context and application) SingleLaunchActivityTestCase (single environment thru tests) ViewAsserts (extended asserts) http://developer.android.com/guide/topics/testing/activity_testing.html http://developer.android.com/resources/tutorials/testing/activity_test.html http://developer.android.com/reference/android/test/ViewAsserts.html
  • 9. Test with special Android Mock ProviderTestCase2 (mock ontext and application, MockContentResolver) http://developer.android.com/guide/topics/testing/contentprovider_testing.html
  • 10. Test with special Android Mock ServiceTestCase (mock context and application) test the service lifecycle, not the logic (detached) http://developer.android.com/guide/topics/testing/service_testing.html
  • 11. Test with special Android Mock MockApplication, MockContext, MockContentProvider (API8), MockCursor (API8), MockDialogInterface, MockPackageManager, MockResources MockContentResolver, IsolatedContext
  • 12. Android monkey adb shell monkey -p your.package.name -v 500 http://developer.android.com/guide/developing/tools/monkey.html http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
  • 13. Android monkeyrunner monkeyrunner writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
  • 14. Robotium Automatic black-box test cases for Android applications Your applications or black-box apk http://code.google.com/p/robotium/
  • 15. TDD with Robolectric Robolectric is a unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app. TDD also for Android (yuppi)! Shadow objects (stock and custom) Integrable with RoboGuice for IoC/DI http://pivotal.github.com/robolectric/
  • 16. Example of advanced scenario Created a framework for test automation Now QA write XML files corresponding to specific test cases Drastic time redution: from days to 30 minutes Free software! Link to website
  • 17. Example of advanced scenario Complex and boring test cases to verify upon each release of the product / user stories Android / Blackberry / iPhone tests Junit for logic, but for server integration / different OSes capabilites?
  • 18. Example of advanced scenario Redefined InstrumentationTestRunner, the new one load xml files and all the tests resources Robot and CommandRunner Xml files define tests to execute It's code, so... Let's the fun begin! ;) https://android-client.forge.funambol.org/