2. • Since 2012 Lead Engineer Android @
ebay Kleinanzeigen
• Before Team Lead Mobile Enterprise
Solutions @ Cortado
• C++ Developer @ PSI AG
• Started career as developer @ Alcatel
• articles in: android360, mobile Technology,
Java Magazin
• speaker: Blackberry Developer Conference SF,
DroidCons
Believe in mobile
who's that guy?
5. Raus aus der Garage!
Tidy garage by Bryn Pinzgauer CC 2.0
http://www."ickr.com/photos/12394349@N06/4492572621/in/photostream/
6. • Junit 4
(out for 6+ years!!)
• Use all your
utilities
(i.e. mocking)
• Use your coverage
framework
• Use CI tools
without Android
plugins (sonar)
Scyscrapers by elminium, CC 2.0 http://www."ickr.com/photos/lumen850/5461476268/in/
photostream/
8. Separate Java and Android Code?
• Android is not Java!
• Intent, Bundle,
SparseArray, Uri.. not
fancy device classes!
• Context everywhere
• Recreate the
System! (interface
UI {...} ?)
Great Wall of China (IV) by isawnyu. CC 2.0 http://
www."ickr.com/photos/isawnyu/7183821643/in/
photostream/
10. static Intent createIntent(Context context, String query,
String value) {
Intent i = new Intent(context, AdListActivity.class);
i.putExtra(AppConstants.QUERY, query);
i.putExtra(AppConstants.VALUE, queryString);
return i;
}
@Test
public void createIntentForQuery() {
Context c = new AdListActivity();
Intent intent =
MyActivity.createIntent(c, "key", "value");
assertNotNull(intent);
}
11. In practice (with programs of several thousand lines of
code), we haven't discovered any signi!cant di"erences
between the two VMs, and we would consider any
di"erence to be a bug in one or the other VM.“
https://sites.google.com/site/androiddevtesting/
Is this valid?
12. static Intent createIntent(Context context, String query,
String value) {
Intent i = new Intent(context, AdListActivity.class);
i.putExtra(AppConstants.QUERY, query);
i.putExtra(AppConstants.VALUE, queryString);
return i;
}
@Test
public void createIntentForQuery() {
Context c = mock(Context.class);
Intent intent =
MyActivity.createIntent(c, "key", "value");
assertNotNull(intent);
}
13. what's this mock thing?
Martin Fowler:
„test-doubles ... pre-programmed with
expectations “
21. 2.0
@Test @Values(qualifiers = "fr-land")
public void
shouldShowBucolicFrenchLandscape() throws
Exception {
// ...
}
• less shadows, more real code
(goal is to remove 99% of shadows)
• since alpha2: support package complete shadow free
• aims for sherlock supported, library support
• performance boost
• Value quali$ers: