Home | History | Annotate | Download | only in activity-testing
      1 page.title=Testing Your Android Activity
      2 page.tags=testing
      3 
      4 trainingnavtop=true
      5 startpage=true
      6 
      7 @jd:body
      8 
      9 <div id="tb-wrapper">
     10 <div id="tb">
     11 
     12 <!-- Required platform, tools, add-ons, devices, knowledge, etc. -->
     13 <h2>Dependencies and prerequisites</h2>
     14 <ul>
     15   <li>Android 2.2 (API Level 8) or higher.</li>
     16 </ul>
     17 
     18 <h2>You Should Also Read</h2>
     19 <ul>
     20 <li><a href="{@docRoot}tools/testing/index.html">Testing
     21 (Developer's Guide)</a></li>
     22 </ul>
     23 
     24 </div>
     25 </div>
     26 
     27 <p>You should be writing and running tests as part of your Android application
     28 development cycle. Well-written tests can help you to catch bugs early in
     29 development and give you confidence in your code.</p>
     30 
     31 <p>A <em>test case</em> defines a set of objects and methods to run multiple
     32 tests independently from each other. Test cases can be organized into
     33 <em>test suites</em> and run programmatically, in a repeatable manner, with
     34 a <em>test runner</em> provided by a testing framework.</p>
     35 
     36 <p>The lessons in this class teaches you how to use the Android's custom
     37 testing framework that is based on the popular JUnit framework. You can
     38 write test cases to verify specific behavior in your application, and check for
     39 consistency across different Android devices. Your test cases also serve as a
     40 form of internal code documentation by describing the expected behavior of
     41 app components.</p>
     42 
     43 <h2>Lessons</h2>
     44 
     45 <!-- Create a list of the lessons in this class along with a short description
     46 of each lesson. These should be short and to the point. It should be clear from
     47 reading the summary whether someone will want to jump to a lesson or not.-->
     48 
     49 <dl>
     50   <dt><b><a href="preparing-activity-testing.html">Setting Up Your Test
     51 Environment</a></b></dt>
     52     <dd>Learn how to create your test project.</dd>
     53   <dt><b><a href="activity-basic-testing.html">Creating and Running a Test 
     54 Case</a></b></dt>
     55     <dd>Learn how to write test cases to verify the
     56 expected properties of your {@link android.app.Activity}, and run the test
     57 cases with the {@code Instrumentation} test runner provided by the Android
     58 framework.</dd>
     59   <dt><b><a href="activity-ui-testing.html">Testing UI Components</a></b></dt>
     60     <dd>Learn how to test the behavior of specific UI
     61 components in your {@link android.app.Activity}.</dd>
     62   <dt><b><a href="activity-unit-testing.html">Creating Unit Tests</a></b></dt>
     63     <dd>Learn how to how to perform unit testing to
     64 verify the behavior of an Activity in isolation.</dd>
     65   <dt><b><a href="activity-functional-testing.html">Creating Functional Tests</a></b></dt>
     66     <dd>Learn how to perform functional testing to
     67 verify the interaction of multiple Activities.</dd>
     68 
     69