testing your app in the cloud
TRANSCRIPT
Intel Information Technology
Testando sua App na NuvemEduardo CarraraDeveloper Evangelist – Intel Developers Relations Division
Intel Information Technology 4
“Testers don’t break software, software is already broken”
– Amir Ghahrai
Intel Information Technology 5
Sprint 1
• 5 Stories
• 1 Test Plan per Story
• 1 Hour per Test Plan
• 5h of Testing
Sprint 2
• +5 Stories
• +1 Test Plan per Story
• 1 Hour per Test Plan
• 5h of testing + 5h of regression test
Sprint 3
• +5 Stories
• +1 Test Plan per Story
• 1 Hour per Test Plan
• 5h of testing + 10h of regression test
Intel Information Technology
“I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.”
- Bill Gates
7
Image by Karla Vidal @ http://www.flickr.com/photos/63721650@N00/3661526274Creative Commons cc-by-2.0
Intel Information Technology 9
public static String getFormattedMonthDay(String format, String dateString) {
String finalDateString = "";
SimpleDateFormat dbDateFormat = new SimpleDateFormat(Utility.DATE_FORMAT);
try {
Date inputDate = dbDateFormat.parse(dateString);
SimpleDateFormat requestedDateFormat = new SimpleDateFormat(format);
finalDateString = requestedDateFormat.format(inputDate);
} catch (ParseException e) {
e.printStackTrace();
} catch (NullPointerException npex) {
npex.printStackTrace();
}
return finalDateString;
}
Intel Information Technology 10
public void testGetFormattedMonthDayForBadInput() throws Exception {
String inputDateString = "";
final String expectedDateFormat = "yyyy, MMMM dd";
final String expectedResult = "";
String result = Utility.getFormattedMonthDay(expectedDateFormat,
inputDateString);
assertEquals("A wrong formatted input must return an empty String",
expectedResult, result);
}
public class UtilityTest extends TestCase {
…
…
}
Intel Information Technology 11
Image by Schlurcher @ http://en.wikipedia.org/wiki/Jigsaw_puzzle#/media/File:Puzzle_Krypt-2.jpgCreative Commons cc-by-sa-2.0
It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free.--Steve McConnell (from Code Complete)
Intel Information Technology
Android Testing Framework
13
• Special TestCases, Asserts e Mocks
• MoreAsserts
• ViewAsserts
• MockApplication
• MockContext
• MockContentProvider
• AndroidTestCase
• ActivityInstrumentationTestCase2
• ActivityUnitTestCase
• ApplicationTestCase
• InstrumentationTestCase
• ProviderTestCase
• ServiceTestCase
• SingleLaunchActivityTestCaseJUnit
Intel Information Technology
Instrumentation
14
• Android Components Context Access;
• Components Lifecycle Control;
• Component Loading Control;
• System Events (e.g.: Broadcasts)
• InstrumentationTestRunner
• AndroidJUnitRunner
• GoogleInstrumentationTestRunner
Intel Information Technology
Expresso
15
• Simplifies the UI Test Process within your App
• Methods for:
• View matching
• Checks
• UI Events
Intel Information Technology
Fragmentação
16
“If you don’t like testing your product, most likely your customers won’t like to test it either.” - Anonymous
Intel Information Technology
What is next?
22
• What about cross app testing? UIAutomator!
• Continuous Delivery and Integration of Android Apps
• Code Coverage
Intel Information Technology
Intel Developer Zone
23
https://software.intel.com/en-us/android/app-testing
Intel Information Technology
Thanks!
24
+EduardoCarraraDeAraujo
https://www.facebook.com/ducarrara
@DuCarrara
br.linkedin.com/in/eduardocarrara/
Intel Information Technology
References
25
• Android Testing: https://developer.android.com/tools/testing/testing_android.html
• Android Unit Testing Support: http://tools.android.com/tech-docs/unit-testing-support
• UI Testing: https://developer.android.com/training/testing/ui-testing/index.html
• Android Testing Support Library: https://developer.android.com/tools/testing-support-library
• Android Instrumentation: http://developer.android.com/tools/testing/testing_android.html#Instrumentation
• Junit: http://junit.org
• Testdroid: http://testdroid.com
• Intel App Testing Page: https://software.intel.com/en-us/android/app-testing