"Irreproducible bugs become highly reproducible right after delivery to the customer". This is something that happens "almost" everyday.
It is well known that testing offers significant advantages as a development practice and helps ensure higher quality code with fewer defects.
Unfortunately, testing Android apps can be challenging, so in this session we are gonna talk about available tools and practices that could help us accomplish our goals.
How ANDROID TESTING changed how we think about Death
1. How ANDROID TESTING
changed how we think
about death…
@fernando_cejas
Code samples:
https://github.com/android10/Inside_Android_Testing
https://github.com/android10/AndroidApplicationTestingSample
4. Why testing..WTF?
• Testing increases the level of confidence in
your code.
• Testing makes it possible to write
new code, and refactor existing
code, without worrying that
you’ve broken existing
functionality.
5. What is this mock thing?
Martin Fowler:
"...test-doubles ... preprogrammed with
expectation"
6. GIVE A WARM
WELCOME TO…
mockito
Mockito is a mocking framework that tastes
really good.
Mockito doesn't give you
hangover because the tests
are very readable and they
produce clean verification
errors.
28. FEST Android
• A library by square (FTW!)
• It gives a chainable (or “fluent”)
syntax for checking assertions.
• Makes tests easier to write (and
read!).
31. Dependency what?
Dependency injection is a software design
pattern that allows the removal of hard-coded
dependencies and makes it possible to change
them, whether at run-time or compile-time
42. Best practices and some advice…
•
•
•
•
•
Simplify your architecture
Have a robust testing strategy
Use continuous integration tools
Mock/stub functionality
Create your own test runner
WRITE TESTS!!!