1. <legend id='ZXz7j'><style id='ZXz7j'><dir id='ZXz7j'><q id='ZXz7j'></q></dir></style></legend>

      <i id='ZXz7j'><tr id='ZXz7j'><dt id='ZXz7j'><q id='ZXz7j'><span id='ZXz7j'><b id='ZXz7j'><form id='ZXz7j'><ins id='ZXz7j'></ins><ul id='ZXz7j'></ul><sub id='ZXz7j'></sub></form><legend id='ZXz7j'></legend><bdo id='ZXz7j'><pre id='ZXz7j'><center id='ZXz7j'></center></pre></bdo></b><th id='ZXz7j'></th></span></q></dt></tr></i><div id='ZXz7j'><tfoot id='ZXz7j'></tfoot><dl id='ZXz7j'><fieldset id='ZXz7j'></fieldset></dl></div>

        <small id='ZXz7j'></small><noframes id='ZXz7j'>

          <bdo id='ZXz7j'></bdo><ul id='ZXz7j'></ul>
      1. <tfoot id='ZXz7j'></tfoot>
      2. Android 测试驱动开发

        时间:2023-05-18

            <tbody id='Litxy'></tbody>
            <bdo id='Litxy'></bdo><ul id='Litxy'></ul>

              <i id='Litxy'><tr id='Litxy'><dt id='Litxy'><q id='Litxy'><span id='Litxy'><b id='Litxy'><form id='Litxy'><ins id='Litxy'></ins><ul id='Litxy'></ul><sub id='Litxy'></sub></form><legend id='Litxy'></legend><bdo id='Litxy'><pre id='Litxy'><center id='Litxy'></center></pre></bdo></b><th id='Litxy'></th></span></q></dt></tr></i><div id='Litxy'><tfoot id='Litxy'></tfoot><dl id='Litxy'><fieldset id='Litxy'></fieldset></dl></div>
                <legend id='Litxy'><style id='Litxy'><dir id='Litxy'><q id='Litxy'></q></dir></style></legend>

                <small id='Litxy'></small><noframes id='Litxy'>

                1. <tfoot id='Litxy'></tfoot>
                  本文介绍了Android 测试驱动开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我在制作 Android 应用程序方面拥有丰富的经验.对于我的新项目,我们决定进行测试驱动开发 (TDD).我一直在使用 Robotium 进行用户场景测试,它运行良好,看起来也很简单.

                  I have considerable experience in making Android applications. For my new project, we have decided to do Test Driven Development (TDD). I have been getting my hands wet on Robotium for User Scenario Testing, and it works fine and looks easy too.

                  对于单元测试,我尝试使用 (MockContext Android Class) 模拟 Context,但我无法这样做.我浏览了这个博客 http://sites.google.com/site/androiddevtesting/ 和通过这个 http://sdudzin.blogspot.com/2011/01/easy-unit-testing-for-android.html ,这表明 Android 应用程序中的模拟仍然非常有限和困难,并建议使用 PowerMock、jMockit、JeasyTest 或 Roboelectric(结合Mockito 和 Maven)甚至 RoboGuice.

                  For unit testing, I tried to mock Context using (MockContext Android Class) but I am unable to do so. I went through this blog http://sites.google.com/site/androiddevtesting/ and through this http://sdudzin.blogspot.com/2011/01/easy-unit-testing-for-android.html , which suggests that mocking in Android apps is still very limited and hard, and have suggested to use PowerMock, jMockit, JeasyTest, or Roboelectric (in combination with Mockito and Maven) and even RoboGuice.

                  我想就您认为哪种单元测试框架最适合测试 Android 应用程序从你们那里得到任何建议.(特别是测试 Android 类,可能会提供模拟上下文和其他模拟功能,以便我可以使我的测试用例尽可能独立).任何建议或指示都会有所帮助.谢谢

                  I would like to get any suggestions from you guys on which unit testing framework in your opinion is the best for testing Android applications. (particularly testing Android classes, possibly giving mock Contexts and other mocking features so that I can make my test cases as independent as possible). Any suggestions or pointers would be helpful . Thanks

                  推荐答案

                  对于离线测试,请查看 Robolectric

                  For off-device testing, look at Robolectric

                  对于设备上的测试,请查看 波拉契奥

                  For on-device testing, look at Borachio

                  底线:要做好仍然非常非常困难.情况正在好转(今天的情况比 6 个月前要好得多),但 Android 无疑是我编写过的程序中对测试最不利的环境.

                  Bottom line: it's still very, very difficult to do well. Things are improving (the situation is dramatically better today than it was 6 months ago) but Android is comfortably the most test-hostile environment I've ever written programs for.

                  这篇关于Android 测试驱动开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:需要导入 UIKit 的新项目文件 下一篇:iPhone平台的开源框架/项目

                  相关文章

                2. <small id='tBkv9'></small><noframes id='tBkv9'>

                  <legend id='tBkv9'><style id='tBkv9'><dir id='tBkv9'><q id='tBkv9'></q></dir></style></legend>
                    <bdo id='tBkv9'></bdo><ul id='tBkv9'></ul>

                  1. <i id='tBkv9'><tr id='tBkv9'><dt id='tBkv9'><q id='tBkv9'><span id='tBkv9'><b id='tBkv9'><form id='tBkv9'><ins id='tBkv9'></ins><ul id='tBkv9'></ul><sub id='tBkv9'></sub></form><legend id='tBkv9'></legend><bdo id='tBkv9'><pre id='tBkv9'><center id='tBkv9'></center></pre></bdo></b><th id='tBkv9'></th></span></q></dt></tr></i><div id='tBkv9'><tfoot id='tBkv9'></tfoot><dl id='tBkv9'><fieldset id='tBkv9'></fieldset></dl></div>
                  2. <tfoot id='tBkv9'></tfoot>