<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Functional testing &#8211; Wiebe Elsinga</title>
	<atom:link href="http://wiebe-elsinga.com/blog/tag/functional-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://wiebe-elsinga.com/blog</link>
	<description>Blog</description>
	<lastBuildDate>Mon, 16 Feb 2015 10:35:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.1</generator>
	<item>
		<title>Android Testing Support Library announced</title>
		<link>http://wiebe-elsinga.com/blog/android-testing-support-library-announced/</link>
					<comments>http://wiebe-elsinga.com/blog/android-testing-support-library-announced/#comments</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Mon, 03 Nov 2014 03:39:42 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Functional testing]]></category>
		<category><![CDATA[Support library]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=1608</guid>

					<description><![CDATA[During the Droidcon UK 2014, Stephan Linzner of Google announced the upcoming Android Testing Support Library. This means Google is (finally) taking testing Android apps seriously. The library is a unbundled static testing library for Android that containers all Android testing frameworks by Google. It will become a available through the Android Support repository and as open source in AOSP. So what does it contain? AndroidJUnitRunner This Runner, based on android.test.InstrumentationTestRunner, runs JUnit3 and JUnit4 tests against an Android package (application). Let me give an example: @RunWith &#40;JUnit4.class&#41; public class MyJUnit4Test &#123; &#123; &#160; Droidcon mDroidconUK; &#160; &#160; @Before &#160; public void setUp&#40;&#41; &#123; &#160; &#160; mDroidconUK = new Droidcons.get&#40;Droidcon.UK&#41;; &#160; &#160; mDroidconUK.open&#40;&#41;; &#160; &#125; &#160; @Test &#160; public void checkPreconditions&#40;&#41; &#123; &#160; &#160; assertNotNull&#40;&#34;mDroidconUK cannot be null&#34;, mDroidconUK&#41;; &#160; &#125; &#160; @After &#160; public void tearDown&#40;&#41; &#123; &#160; &#160; mDroidconUK.close&#40;&#41;; &#160; &#125; &#125; Espresso Introduced at the GTAC in 2013, Espresso makes it possible to write concise, beautiful, and reliable Android UI tests quickly. Lets look at some examples: // Find view using a Matcher and type text using a ViewAction onView&#40;withId&#40;R.id.message_edit_text&#41;&#41;.perform&#40;typeText&#40;TEXT_MESSAGE&#41;, closeSoftKeyboard&#40;&#41;&#41;; // Perform a click ViewAction onView&#40;withId&#40;R.id.send_button&#41;&#41;.perform&#40;click&#40;&#41;&#41;; // Verify using a ViewAssertion onView&#40;withId&#40;R.id.received_message_text_view&#41;&#41;.check&#40;matches&#40;withText&#40;&#40;TEXT_MESSAGE&#41;&#41;&#41;&#41;; Intento Intento is like Mockito but for Intents. Basically a mock framework that allows you to create and configure mock objects. Let me give you an example: public void testDailerInput_typeNumberAndCall&#40;&#41; &#123; &#160; &#160; //Type phonenumber in dialer &#160; onView&#40;withId&#40;R.id.send_data_to_call_edit_text&#41;&#41;.perform&#40;scrollTo&#40;&#41;, typeText&#40;&#34;123-345-6789&#34;&#41;, closeSoftKeyboard&#40;&#41;&#41;; &#160; &#160; // Click the call button &#160; onView&#40;withId&#40;R.id.send_to_call_button&#41;&#41;.perform&#40;scrollTo&#40;&#41;, click&#40;&#41;&#41;; &#160; &#160; //Validate Intent has been send &#160; intended&#40;allOf&#40; &#160; &#160; &#160; hasAction&#40;Intent.ACTION_CALL&#41;, &#160; &#160; &#160; toPackage&#40;&#34;com.android.phone&#34;&#41;, &#160; &#160; &#160; hasData&#40;allOf&#40;hasSchemaSpecificPart&#40;&#34;tel&#34;, &#34;123-345-6789&#34;&#41;&#41;&#41;&#41;, &#160; &#160; &#160; times&#40;1&#41;&#41;; &#125; In conclusion: Testing with Android is finally becoming a more prominent part of Android Development cycle with the introduction of the Android Testing Support Library]]></description>
										<content:encoded><![CDATA[<p>During the <a href="http://uk.droidcon.com/2014/" title="Droidcon UK 2014" target="_blank">Droidcon UK 2014</a>, <a href="https://plus.google.com/+StephanLinzner" title="StephanLinzner G+ Profile" target="_blank">Stephan Linzner</a> of Google announced the upcoming Android Testing Support Library. This means Google is (finally) taking testing Android apps seriously. </p>
<p>The library is a unbundled static testing library for Android that containers all Android testing frameworks by Google. It will become a available through the Android Support repository and as open source in AOSP.</p>
<p>So what does it contain?</p>
<ul>
<li><em><strong>AndroidJUnitRunner</strong></em><br />
This Runner, based on <em>android.test.InstrumentationTestRunner</em>, runs <em>JUnit3</em> and <em>JUnit4</em> tests against an Android package (application). Let me give an example:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">@RunWith <span style="color: #009900;">&#40;</span>JUnit4.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyJUnit4Test <span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; Droidcon mDroidconUK<span style="color: #339933;">;</span><br />
&nbsp;<br />
&nbsp; @Before <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setUp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; mDroidconUK <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Droidcons.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>Droidcon.<span style="color: #006633;">UK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; mDroidconUK.<span style="color: #006633;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @Test <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> checkPreconditions<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; assertNotNull<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mDroidconUK cannot be null&quot;</span>, mDroidconUK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @After <br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> tearDown<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; mDroidconUK.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>
</li>
<li><em><strong>Espresso</strong></em><br />
Introduced at the GTAC in 2013, Espresso makes it possible to write concise, beautiful, and reliable Android UI tests quickly. Lets look at some examples:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #666666; font-style: italic;">// Find view using a Matcher and type text using a ViewAction</span><br />
onView<span style="color: #009900;">&#40;</span>withId<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">message_edit_text</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">perform</span><span style="color: #009900;">&#40;</span>typeText<span style="color: #009900;">&#40;</span>TEXT_MESSAGE<span style="color: #009900;">&#41;</span>, closeSoftKeyboard<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Perform a click ViewAction</span><br />
onView<span style="color: #009900;">&#40;</span>withId<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">send_button</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">perform</span><span style="color: #009900;">&#40;</span>click<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Verify using a ViewAssertion</span><br />
onView<span style="color: #009900;">&#40;</span>withId<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">received_message_text_view</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">check</span><span style="color: #009900;">&#40;</span>matches<span style="color: #009900;">&#40;</span>withText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>TEXT_MESSAGE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>
</li>
<li><em><strong>Intento</strong></em><br />
Intento is like Mockito but for Intents. Basically a mock framework that allows you to create and configure mock objects. Let me give you an example:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testDailerInput_typeNumberAndCall<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">//Type phonenumber in dialer</span><br />
&nbsp; onView<span style="color: #009900;">&#40;</span>withId<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">send_data_to_call_edit_text</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">perform</span><span style="color: #009900;">&#40;</span>scrollTo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, typeText<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;123-345-6789&quot;</span><span style="color: #009900;">&#41;</span>, closeSoftKeyboard<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">// Click the call button</span><br />
&nbsp; onView<span style="color: #009900;">&#40;</span>withId<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">send_to_call_button</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">perform</span><span style="color: #009900;">&#40;</span>scrollTo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, click<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #666666; font-style: italic;">//Validate Intent has been send</span><br />
&nbsp; intended<span style="color: #009900;">&#40;</span>allOf<span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; hasAction<span style="color: #009900;">&#40;</span>Intent.<span style="color: #006633;">ACTION_CALL</span><span style="color: #009900;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; toPackage<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.android.phone&quot;</span><span style="color: #009900;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; hasData<span style="color: #009900;">&#40;</span>allOf<span style="color: #009900;">&#40;</span>hasSchemaSpecificPart<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;tel&quot;</span>, <span style="color: #0000ff;">&quot;123-345-6789&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; times<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
</li>
</ul>
<p>
<strong>In conclusion</strong>: Testing with Android is finally becoming a more prominent part of Android Development cycle with the introduction of the Android Testing Support Library</p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/android-testing-support-library-announced/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Functional testing for Android</title>
		<link>http://wiebe-elsinga.com/blog/functional-testing-for-android/</link>
					<comments>http://wiebe-elsinga.com/blog/functional-testing-for-android/#comments</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Tue, 26 Nov 2013 02:18:52 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Functional testing]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=1480</guid>

					<description><![CDATA[Applying functional testing is not a new technique during the development of Java software. Writing functional tests gives you a good understanding about the stability of an application or system, during code modifications or if new features are added. But what about using functional testing when developing an Android application, it is also easy to achieve? &#8220;And, is the application still works?&#8221; or &#8220;Is the application broken?&#8221;, these are questions that developers should be able to answer if a code change has been made or an improvement has been added. This is no different when developing an Android application. Also, the use of TDD (Test Driven Development), in which first the test is written, after which the code follows, is good practice. Automated functional testing has become part of software development. Using Selenium and Fitnesse for testing Java application, combined with Jenkins has become avery day pratice to most Java developers. So you would expect that this would differ during the development of Android app. Unfortunately this is not (yet) the case. Because of the relatively rapid growth of Android, these testing methods aren&#8217;t yet mature enough. Lets look at four testing framework that can be used during Android app development: How to install the specific framework is not part of this article. With the use of code examples pros and cons will be explained for the specific framework. &#160; The Android application that is being tested is a simple calculator. The common test scenario we will be implementing is testing if ‘1’ + ‘3’ gives a result of ‘4’. UIAutomator The Google test framework UIAutomator makes it possible to write simple Java (and JUnit) functional tests. The framework is not tied to the application that needs to be tested, but also has access to the Android platform itself. This makes it possible to adjust your Android emulator or physical phone settings while running your test(s). This means that you can test the behavior of the test application if, for example, the internet connection is being switched off. UiObject allAppsButton = new UiObject&#40;new UiSelector&#40;&#41;.description&#40;&#34;Apps&#34;&#41;&#41;; allAppsButton.clickAndWaitForNewWindow&#40;&#41;; UiObject appsTab = new UiObject&#40;new UiSelector&#40;&#41;.text&#40;&#34;Apps&#34;&#41;&#41;; appsTab.click&#40;&#41;; UiScrollable appViews = new UiScrollable&#40;new UiSelector&#40;&#41;.scrollable&#40;true&#41;&#41;; appViews.setAsHorizontalList&#40;&#41;; UiObject calculatorApp = appViews.getChildByText&#40;new UiSelector&#40;&#41;.className&#40;android.widget.TextView.class.getName&#40;&#41;&#41;, &#34;Calculator app&#34;&#41;; calculatorApp.clickAndWaitForNewWindow&#40;&#41;; UiObject oneButton = new UiObject&#40;new UiSelector&#40;&#41;.text&#40;&#34;1&#34;&#41;&#41;; oneButton.click&#40;&#41;; UiObject plusButton = new UiObject&#40;new UiSelector&#40;&#41;.text&#40;&#34;+&#34;&#41;&#41;; plusButton.click&#40;&#41;; UiObject threeButton = new UiObject&#40;new UiSelector&#40;&#41;.text&#40;&#34;3&#34;&#41;&#41;; threeButton.click&#40;&#41;; UiObject eqButton = new UiObject&#40;new UiSelector&#40;&#41;.text&#40;&#34;=&#34;&#41;&#41;; eqButton.click&#40;&#41;; UiObject text = new UiObject&#40;new UiSelector&#40;&#41;.className&#40;&#34;android.widget.EditText&#34;&#41;.text&#40;&#34;4&#34;&#41;&#41;; assertTrue&#40;text.exists&#40;&#41;&#41;; Unfortunately there is little documentation available. Also the framework only supports Android 4.1 or higher. In short: Fully control device Code written in Java Extends JUnit framework Easy to read Only for Android 4.1 and higher Little documentation available &#160; Robolectric The Java-based testing framework Robolectric is the best of the tested frameworks in terms of performance. This is because it is not running on a device or on the Android emulator, but uses his own visual UI simulator. As a result, the delaying factor of starting an emulator or installing the app on a device has no influence on running the test(s). This makes Robolectric a good choice for TDD. @RunWith&#40;RobolectricTestRunner.class&#41; public class MainActivityTest &#123; private MainActivity _activity; @Before public void setUp&#40;&#41; throws Exception &#123; _activity = Robolectric.buildActivity&#40;MainActivity.class&#41;.create&#40;&#41;.get&#40;&#41;; &#125; @Test public void testAdding&#40;&#41; throws Exception &#123; Button btnOne = &#40;Button&#41; _activity.findViewById&#40;R.id.num_1&#41;; Button btnAdd = &#40;Button&#41; _activity.findViewById&#40;R.id.op_add&#41;; Button btnThree = &#40;Button&#41; _activity.findViewById&#40;R.id.num_3&#41;; Button btnEquals = &#40;Button&#41; _activity.findViewById&#40;R.id.op_equ&#41;; btnOne.performClick&#40;&#41;; btnAdd.performClick&#40;&#41;; btnThree.performClick&#40;&#41;; btnEquals.performClick&#40;&#41;; EditText resultText = &#40;EditText&#41; _activity.findViewById&#40;R.id.editText1&#41;; assertEquals&#40;&#34;4&#34;, resultText.getText&#40;&#41;.toString&#40;&#41;&#41;; &#125; &#125; Because Robolectric uses a non-visual UI simulator its not possible to test a problem which only occurs on say a Samsung device. In short: Does not require emulator or device Code written in Java Extends JUnit framework Fastest in terms of performance Does not run on actual device &#160; Robotium The idea behind Robotium is that a functional test should description what the user sees and can do. This framework is a good choice if you are just &#8220;black box&#8221; testing your application. Besides extensive documentation, there are some well described examples available and the API is easy to use. public class MainActivityTest extends ActivityInstrumentationTestCase2 &#123; private Solo _solo; public MainActivityTest&#40;&#41; &#123; super&#40;MainActivity.class&#41;; &#125; @Override protected void setUp&#40;&#41; throws Exception &#123; super.setUp&#40;&#41;; _solo = new Solo&#40;getInstrumentation&#40;&#41;, getActivity&#40;&#41;&#41;; &#125; public void testAdding&#40;&#41; &#123; _solo.assertCurrentActivity&#40;&#34;Is app started&#34;, MainActivity.class&#41;; _solo.clickOnButton&#40;&#34;CLR&#34;&#41;; _solo.clickOnButton&#40;&#34;1&#34;&#41;; _solo.clickOnButton&#40;&#34;+&#34;&#41;; _solo.clickOnButton&#40;&#34;3&#34;&#41;; _solo.clickOnButton&#40;&#34;=&#34;&#41;; EditText editText = &#40;EditText&#41; getActivity&#40;&#41;.findViewById&#40;com.elsinga.calculator.R.id.editText1&#41;; assertEquals&#40;&#34;4&#34;, editText.getText&#40;&#41;.toString&#40;&#41;&#41;; &#125; &#125; In short: APIs are easy to use Tests are text-based Good for &#8220;black box&#8221; testing &#160; Calabash-Android Like Robotium, the functional tests described in Calabash Android is written as &#8220;What you see you test&#8221;. The only difference is that the tests are not written in Java, but in Cucumber (a text-based structure). This makes it possible that tests can be written/used by non developers. A drawback, because test(s) aren&#8217;t written in Java, is that &#8220;debugging&#8221; a failing test is not possible. Feature: Adding Scenario: add I should see &#34;1&#34; Then I press &#34;1&#34; And I press &#34;+&#34; And I press &#34;3&#34; And I press &#34;=&#34; Then I see &#34;4&#34; In short: Well documented Test(s) can be writen/used bij non developers What you see, you test ‘Debuggen’ of tests isn&#8217;t possible &#160; Conclusion Functional testing of Android applications is possible. Which test framework you want to use, dependents on the what you want to do with it. To choice with one fits best, ask yourself who is going to make the tests, what needs to be tested and/or on which device the tests are running on.In any cast, there is enough choice to start writing functional tests. Source code can be found here]]></description>
										<content:encoded><![CDATA[<p>Applying functional testing is not a new technique during the development of Java software. Writing functional tests gives you a good understanding about the stability of an application or system, during code modifications or if new features are added. But what about using functional testing when developing an Android application, it is also easy to achieve?</p>
<p>&#8220;And, is the application still works?&#8221; or &#8220;Is the application broken?&#8221;, these are questions that developers should be able to answer if a code change has been made or an improvement has been added. This is no different when developing an Android application. Also, the use of TDD (Test Driven Development), in which first the test is written, after which the code follows, is good practice. Automated functional testing has become part of software development. Using Selenium and Fitnesse for testing Java application, combined with Jenkins has become avery day pratice to most Java developers. So you would expect that this would differ during the development of Android app. Unfortunately this is not (yet) the case. Because of the relatively rapid growth of Android, these testing methods aren&#8217;t yet mature enough.</p>
<p>Lets look at four testing framework that can be used during Android app development:</p>
<div style="background: lightgray; padding: 12pt;">How to install the specific framework is not part of this article. With the use of code examples pros and cons will be explained for the specific framework.</div>
<p>&nbsp;<br />
The <a href="https://github.com/welsinga/sample_testsing" target="_blank">Android application</a> that is being tested is a simple calculator. The common test scenario we will be implementing is testing if ‘1’ + ‘3’ gives a result of ‘4’.</p>
<h2>UIAutomator</h2>
<p>The Google test framework <a href="http://developer.android.com/tools/help/uiautomator/index.html">UIAutomator</a> makes it possible to write simple Java (and JUnit) functional tests. The framework is not tied to the application that needs to be tested, but also has access to the Android platform itself.<br />
This makes it possible to adjust your Android emulator or physical phone settings while running your test(s). This means that you can test the behavior of the test application if, for example, the internet connection is being switched off.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">UiObject allAppsButton <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">description</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Apps&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
allAppsButton.<span style="color: #006633;">clickAndWaitForNewWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject appsTab <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Apps&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
appsTab.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiScrollable appViews <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiScrollable<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">scrollable</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
appViews.<span style="color: #006633;">setAsHorizontalList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject calculatorApp <span style="color: #339933;">=</span> appViews.<span style="color: #006633;">getChildByText</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">className</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">TextView</span>.<span style="color: #000000; font-weight: bold;">class</span>.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;Calculator app&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
calculatorApp.<span style="color: #006633;">clickAndWaitForNewWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject oneButton <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
oneButton.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject plusButton <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
plusButton.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject threeButton <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
threeButton.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject eqButton <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
eqButton.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
UiObject text <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> UiObject<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UiSelector<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">className</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;android.widget.EditText&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
assertTrue<span style="color: #009900;">&#40;</span>text.<span style="color: #006633;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Unfortunately there is little documentation available. Also the framework only supports Android 4.1 or higher.<br />
In short:</p>
<ul>
<li><span style="color: #339966;">Fully control device</span></li>
<li><span style="color: #339966;">Code written in Java</span></li>
<li><span style="color: #339966;">Extends JUnit framework</span></li>
<li><span style="color: #339966;">Easy to read</span></li>
<li><span style="color: #ff0000;">Only for Android 4.1 and higher</span></li>
<li><span style="color: #ff0000;">Little documentation available</span></li>
</ul>
<p>&nbsp;</p>
<h2>Robolectric</h2>
<p>The Java-based testing framework <a href="http://pivotal.github.io/robolectric/index.html" target="_blank">Robolectric</a> is the best of the tested frameworks in terms of performance. This is because it is not running on a device or on the Android emulator, but uses his own visual UI simulator. As a result, the delaying factor of starting an emulator or installing the app on a device has no influence on running the test(s). This makes Robolectric a good choice for TDD.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">@RunWith<span style="color: #009900;">&#40;</span>RobolectricTestRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MainActivityTest<br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">private</span> MainActivity _activity<span style="color: #339933;">;</span><br />
<br />
@Before<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setUp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+exception"><span style="color: #003399;">Exception</span></a><br />
<span style="color: #009900;">&#123;</span><br />
_activity <span style="color: #339933;">=</span> Robolectric.<span style="color: #006633;">buildActivity</span><span style="color: #009900;">&#40;</span>MainActivity.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
@Test<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testAdding<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+exception"><span style="color: #003399;">Exception</span></a><br />
<span style="color: #009900;">&#123;</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a> btnOne <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a><span style="color: #009900;">&#41;</span> _activity.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">num_1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a> btnAdd <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a><span style="color: #009900;">&#41;</span> _activity.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">op_add</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a> btnThree <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a><span style="color: #009900;">&#41;</span> _activity.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">num_3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a> btnEquals <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+button"><span style="color: #003399;">Button</span></a><span style="color: #009900;">&#41;</span> _activity.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">op_equ</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
btnOne.<span style="color: #006633;">performClick</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btnAdd.<span style="color: #006633;">performClick</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btnThree.<span style="color: #006633;">performClick</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btnEquals.<span style="color: #006633;">performClick</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
EditText resultText <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EditText<span style="color: #009900;">&#41;</span> _activity.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">editText1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
assertEquals<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;4&quot;</span>, resultText.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Because Robolectric uses a non-visual UI simulator its not possible to test a problem which only occurs on say a Samsung device.<br />
In short:</p>
<ul>
<li><span style="color: #339966;">Does not require emulator or device</span></li>
<li><span style="color: #339966;">Code written in Java</span></li>
<li><span style="color: #339966;">Extends JUnit framework</span></li>
<li><span style="color: #339966;">Fastest in terms of performance</span></li>
<li><span style="color: #ff0000;">Does not run on actual device</span></li>
</ul>
<p>&nbsp;</p>
<h2>Robotium</h2>
<p>The idea behind <a href="https://code.google.com/p/robotium/" target="_blank">Robotium</a> is that a functional test should description what the user sees and can do. This framework is a good choice if you are just &#8220;black box&#8221; testing your application. Besides extensive documentation, there are some well described examples available and the API is easy to use.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MainActivityTest <span style="color: #000000; font-weight: bold;">extends</span> ActivityInstrumentationTestCase2<br />
<span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">private</span> Solo _solo<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> MainActivityTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>MainActivity.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
@Override<br />
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> setUp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+exception"><span style="color: #003399;">Exception</span></a><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">setUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_solo <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Solo<span style="color: #009900;">&#40;</span>getInstrumentation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, getActivity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testAdding<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
_solo.<span style="color: #006633;">assertCurrentActivity</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Is app started&quot;</span>, MainActivity.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_solo.<span style="color: #006633;">clickOnButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CLR&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_solo.<span style="color: #006633;">clickOnButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_solo.<span style="color: #006633;">clickOnButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_solo.<span style="color: #006633;">clickOnButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_solo.<span style="color: #006633;">clickOnButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
EditText editText <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EditText<span style="color: #009900;">&#41;</span> getActivity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>com.<span style="color: #006633;">elsinga</span>.<span style="color: #006633;">calculator</span>.<span style="color: #006633;">R</span>.<span style="color: #006633;">id</span>.<span style="color: #006633;">editText1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
assertEquals<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;4&quot;</span>, editText.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>In short:</p>
<ul>
<li><span style="color: #339966;">APIs are easy to use</span></li>
<li><span style="color: #339966;">Tests are text-based</span></li>
<li><span style="color: #339966;">Good for &#8220;black box&#8221; testing</span></li>
</ul>
<p>&nbsp;</p>
<h2>Calabash-Android</h2>
<p>Like Robotium, the functional tests described in <a href="https://github.com/calabash/calabash-android" target="_blank">Calabash Android</a> is written as &#8220;What you see you test&#8221;. The only difference is that the tests are not written in Java, but in <a href="http://cukes.info/" target="_blank">Cucumber</a> (a text-based structure). This makes it possible that tests can be written/used by non developers. A drawback, because test(s) aren&#8217;t written in Java, is that &#8220;debugging&#8221; a failing test is not possible.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">Feature: Adding<br />
<br />
Scenario: add<br />
I should see &quot;1&quot;<br />
Then I press &quot;1&quot;<br />
And I press &quot;+&quot;<br />
And I press &quot;3&quot;<br />
And I press &quot;=&quot;<br />
Then I see &quot;4&quot;</div></div>
<p>In short:</p>
<ul>
<li><span style="color: #339966;">Well documented</span></li>
<li><span style="color: #339966;">Test(s) can be writen/used bij non developers</span></li>
<li><span style="color: #339966;">What you see, you test</span></li>
<li><span style="color: #ff0000;">‘Debuggen’ of tests isn&#8217;t possible</span></li>
</ul>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>Functional testing of Android applications is possible. Which test framework you want to use, dependents on the what you want to do with it. To choice with one fits best, ask yourself who is going to make the tests, what needs to be tested and/or on which device the tests are running on.In any cast, there is enough choice to start writing functional tests.</p>
<p>Source code can be found <a href="https://github.com/welsinga/sample_testsing" target="_blank">here</a></p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/functional-testing-for-android/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
