TestingAndroidEnrique 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    me...
Using JUnit
Using JUnit
Running
Results
AnnotationsAnnotation           Description@Test                Test method@Before              Execute before each test@A...
AssertionsAssertion                  Descriptionfail(string)               Fails with messageassertTrue([message],      As...
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
Upcoming SlideShare
Loading in...5
×

Presentation android JUnit

742

Published on

Presentation on Android and JUnit

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
742
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Presentation android JUnit

  1. 1. TestingAndroidEnrique López Mañas
  2. 2. Unit Testing What is unit testing?
  3. 3. 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
  4. 4. Using JUnit
  5. 5. Using JUnit
  6. 6. Running
  7. 7. Results
  8. 8. AnnotationsAnnotation 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 exceptionException.class)@Test(timeout=100) Fails if timeout
  9. 9. AssertionsAssertion Descriptionfail(string) Fails with messageassertTrue([message], Asserts if trueboolean condition)assertsEquals([String Asserts if equalmessage], expected,actual)assertNull([message], Asserts if object is nullobject)assertNotNull([message], Asserts if object is not nullobject)
  10. 10. Android Testing ActivityTesting Content Provider Testing Service Testing
  11. 11. Next… Testing tools Maven Continuous Integration
  12. 12. Links http://www.junit.org/ http://www.neo-tech.es http://developer.android.com/tools/testin g/testing_android.html
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×