SlideShare uma empresa Scribd logo
1 de 12
Testing
Android
Enrique López Mañas
Unit Testing
 What   is unit testing?
Unit Testing with JUnit
   JUnit 4.x is a test framework which uses
    annotations to identify methods that are test
    methods. JUnit assumes that all test methods can
    be executed in an arbitrary order. Therefore tests
    should not depend on other tests.



http://en.wikipedia.org/wiki/JUnit
Using JUnit
Using JUnit
Running
Results
Annotations
Annotation           Description
@Test                Test method
@Before              Execute before each test
@After               Execute after each test
@BeforeClass         Execute once before all
                     tests
@AfterClass          Execute once after all tests
@Ignore              Ignore test
@Test (expected =    Fails if not exception
Exception.class)
@Test(timeout=100)   Fails if timeout
Assertions
Assertion                  Description
fail(string)               Fails with message
assertTrue([message],      Asserts if true
boolean condition)
assertsEquals([String      Asserts if equal
message], expected,
actual)
assertNull([message],      Asserts if object is null
object)
assertNotNull([message],   Asserts if object is not null
object)
Android Testing
 ActivityTesting
 Content Provider Testing
 Service Testing
Next…
 Testing
        tools
 Maven Continuous Integration
Links
 http://www.junit.org/


 http://www.neo-tech.es


 http://developer.android.com/tools/testin
 g/testing_android.html

Mais conteúdo relacionado

Mais procurados

TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
Denis Bazhin
 
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
Alex Su
 

Mais procurados (20)

TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
testng
testngtestng
testng
 
New Features Of Test Unit 2.x
New Features Of Test Unit 2.xNew Features Of Test Unit 2.x
New Features Of Test Unit 2.x
 
Test ng tutorial
Test ng tutorialTest ng tutorial
Test ng tutorial
 
TestNG Session presented in Xebia XKE
TestNG Session presented in Xebia XKETestNG Session presented in Xebia XKE
TestNG Session presented in Xebia XKE
 
TestNg_Overview_Config
TestNg_Overview_ConfigTestNg_Overview_Config
TestNg_Overview_Config
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
 
Test NG Framework Complete Walk Through
Test NG Framework Complete Walk ThroughTest NG Framework Complete Walk Through
Test NG Framework Complete Walk Through
 
JUnit 5 - The Next Generation of JUnit - Ted's Tool Time
JUnit 5 - The Next Generation of JUnit - Ted's Tool TimeJUnit 5 - The Next Generation of JUnit - Ted's Tool Time
JUnit 5 - The Next Generation of JUnit - Ted's Tool Time
 
TestNG vs. JUnit4
TestNG vs. JUnit4TestNG vs. JUnit4
TestNG vs. JUnit4
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
Junit
JunitJunit
Junit
 
Junit
JunitJunit
Junit
 
Test driven development - JUnit basics and best practices
Test driven development - JUnit basics and best practicesTest driven development - JUnit basics and best practices
Test driven development - JUnit basics and best practices
 
Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
 
What is JUnit? | Edureka
What is JUnit? | EdurekaWhat is JUnit? | Edureka
What is JUnit? | Edureka
 
Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1
 
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
 

Destaque

Unit testing in android
Unit testing in androidUnit testing in android
Unit testing in android
Li-Wei Cheng
 

Destaque (17)

Android Test Automation Workshop
Android Test Automation WorkshopAndroid Test Automation Workshop
Android Test Automation Workshop
 
Intentional Use of iPads by Teacher Educators
Intentional Use of iPads by Teacher EducatorsIntentional Use of iPads by Teacher Educators
Intentional Use of iPads by Teacher Educators
 
Test Driven Development and JUnit
Test Driven Development and JUnitTest Driven Development and JUnit
Test Driven Development and JUnit
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?
 
Android testing
Android testingAndroid testing
Android testing
 
Android testing
Android testingAndroid testing
Android testing
 
Junit tutorial
Junit tutorialJunit tutorial
Junit tutorial
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
Unit testing in android
Unit testing in androidUnit testing in android
Unit testing in android
 
How to setup unit testing in Android Studio
How to setup unit testing in Android StudioHow to setup unit testing in Android Studio
How to setup unit testing in Android Studio
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Introduction to android testing
Introduction to android testingIntroduction to android testing
Introduction to android testing
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 

Semelhante a Presentation android JUnit

J unit presentation
J unit presentationJ unit presentation
J unit presentation
Priya Sharma
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
Tricode (part of Dept)
 
JUnit is a Regression Testing Framework used by developers to implem.pdf
JUnit is a Regression Testing Framework used by developers to implem.pdfJUnit is a Regression Testing Framework used by developers to implem.pdf
JUnit is a Regression Testing Framework used by developers to implem.pdf
aplolomedicalstoremr
 

Semelhante a Presentation android JUnit (20)

Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Unit testing and junit
Unit testing and junitUnit testing and junit
Unit testing and junit
 
Junit
JunitJunit
Junit
 
8-testing.pptx
8-testing.pptx8-testing.pptx
8-testing.pptx
 
Testing with Junit4
Testing with Junit4Testing with Junit4
Testing with Junit4
 
Junit
JunitJunit
Junit
 
05 junit
05 junit05 junit
05 junit
 
Unit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptxUnit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptx
 
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
 
Junit4&testng presentation
Junit4&testng presentationJunit4&testng presentation
Junit4&testng presentation
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Unit test
Unit testUnit test
Unit test
 
Junit Interview Questions-ppt
Junit Interview Questions-pptJunit Interview Questions-ppt
Junit Interview Questions-ppt
 
Unit Testing - Nakov's Talk @ VarnaConf 2013
Unit Testing - Nakov's Talk @ VarnaConf 2013Unit Testing - Nakov's Talk @ VarnaConf 2013
Unit Testing - Nakov's Talk @ VarnaConf 2013
 
Unit testing by Svetlin Nakov
Unit testing by Svetlin NakovUnit testing by Svetlin Nakov
Unit testing by Svetlin Nakov
 
J unit presentation
J unit presentationJ unit presentation
J unit presentation
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
 
Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1
 
JUnit is a Regression Testing Framework used by developers to implem.pdf
JUnit is a Regression Testing Framework used by developers to implem.pdfJUnit is a Regression Testing Framework used by developers to implem.pdf
JUnit is a Regression Testing Framework used by developers to implem.pdf
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 

Mais de Enrique López Mañas

Mais de Enrique López Mañas (12)

Droidcon IT 2015
Droidcon IT 2015Droidcon IT 2015
Droidcon IT 2015
 
Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversing
 
AnDevCon: Android Reverse Engineering
AnDevCon: Android Reverse EngineeringAnDevCon: Android Reverse Engineering
AnDevCon: Android Reverse Engineering
 
Android studio
Android studioAndroid studio
Android studio
 
Debugging Android - GDG Munich
Debugging Android - GDG MunichDebugging Android - GDG Munich
Debugging Android - GDG Munich
 
Introducción a la Programación
Introducción a la ProgramaciónIntroducción a la Programación
Introducción a la Programación
 
Android: Dialogs
Android: DialogsAndroid: Dialogs
Android: Dialogs
 
Android: Almacenamiento de Datos
Android: Almacenamiento de DatosAndroid: Almacenamiento de Datos
Android: Almacenamiento de Datos
 
Android: Interfaz de Usuario
Android: Interfaz de UsuarioAndroid: Interfaz de Usuario
Android: Interfaz de Usuario
 
Android: Componentes (II)
Android: Componentes (II)Android: Componentes (II)
Android: Componentes (II)
 
Android: Componentes
Android: ComponentesAndroid: Componentes
Android: Componentes
 
Android: introducción
Android: introducciónAndroid: introducción
Android: introducción
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
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...
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Presentation android JUnit