tag:blogger.com,1999:blog-25456655.post4246447549585830941..comments2024-03-23T07:01:55.848-04:00Comments on Diego Torres Milano's blog: LinuxCon 2011 North America: Introduction to Android TestingDiego Torres Milanohttp://www.blogger.com/profile/12030778501784140349noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-25456655.post-42188363173372051552019-05-16T10:19:17.355-04:002019-05-16T10:19:17.355-04:00Hello
I was looking a long time (5 days) for a way...Hello<br />I was looking a long time (5 days) for a way to get runtime code coverage for Android apps without writing a test case or Junit test. so I read the Android Application Testing Guide Ebook although useful but don't found any answer. I found a solution in your post http://dtmilano.blogspot.com/2011/11/obtaining-code-coverage-of-running.html. <br />I want to calculate the runtime coverage code (coverage.ec file). structure my project is: src>com.example>Instrumentation>EmmaInstrumentation src>com.example.calculator>Sources Java and gradle file doesn't add anyone. and give an error:<br /><br />INSTRUMENTATION_STATUS: id=ActivityManagerService<br />INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.example.calculator/com.example.instrumentation.EmmaInstrumentation}<br />INSTRUMENTATION_STATUS_CODE: -1<br />android.util.AndroidException: INSTRUMENTATION_FAILED: com.example.calculator/com.example.instrumentation.EmmaInstrumentation<br /> at com.android.commands.am.Am.runInstrument(Am.java:951)<br /> at com.android.commands.am.Am.onRun(Am.java:316)<br /> at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)<br /> at com.android.commands.am.Am.main(Am.java:99)<br /> at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)<br /> at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)<br /><br />Tanks alotASNhttps://www.blogger.com/profile/03667540129108029244noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-36814737721785691242012-10-24T12:23:16.637-04:002012-10-24T12:23:16.637-04:00@EffantTerrible,
Nice to hear you solved your prob...@EffantTerrible,<br />Nice to hear you solved your problems.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-30453563131178342102012-10-24T04:39:37.200-04:002012-10-24T04:39:37.200-04:00I saw that BUILD SUCCESS.
The problem is that &qu...I saw that BUILD SUCCESS.<br /><br />The problem is that "android update test-project -main ../ -path ./ "<br /><br />Actually,<br />First time..I typed that "android update project --path ./ --name AndroidTest --target android-10 --subprojects"<br /><br />"--subprojects" is very important thing! Thank you! I checked your recommended ppt.<br /><br />and next ! I typed that "android update test-project --main ../ --path ./<br /><br />But! this is the problem! <br /><br />I have to make test project!<br /><br />So, I make test folder. and I typed like that " android create test-project --main ../"This part original android project location" --path ./<br />then, I typed that "ant emma debug install test"<br /><br />Then, It works!<br /><br />key point is that "Separate the project and test project".<br /><br />Anyway, Thanks a lot !!<br /><br />I really appreciate your help! <br />(you know, I already have your book) <br /><br />haha..<br /><br />Have a good day ! :)EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-68312245609628446722012-10-24T04:34:40.885-04:002012-10-24T04:34:40.885-04:00This comment has been removed by the author.EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-11033161389544818522012-10-24T04:21:42.834-04:002012-10-24T04:21:42.834-04:00This comment has been removed by the author.EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-61378534817553662312012-10-24T00:33:17.680-04:002012-10-24T00:33:17.680-04:00You should use http://dtmilano.blogspot.ca/2012/08...You should use <a href="http://dtmilano.blogspot.ca/2012/08/introduction-to-android-testing-oscon.html" rel="nofollow">http://dtmilano.blogspot.ca/2012/08/introduction-to-android-testing-oscon.html</a> which is from my presentation at OSCON 2012 and include a lot of updates.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-89279839501017089312012-10-23T21:24:24.221-04:002012-10-23T21:24:24.221-04:00Thank you very much!
I solved that problem.
I ty...Thank you very much!<br /><br />I solved that problem.<br /><br />I typed "emma" instead of "coverage" then, I can see BUILD SUCCESS.<br /><br />But, you know ... after that.. <br /><br />How can I get the coverage.ec files?<br /><br />I used "adb" command..as you stated. But, the message is that "that file does not exist"...<br /><br />Do I have to use real-device? <br /><br />If so, <br />1. step : compile the build.xml using ant<br />2. step : run in the real-device.<br />3. step : then, can I pull the coverage.ec data?<br /><br />I executed that steps...but,, I also, could not find that file...<br /><br />Could you explain more detail...<br /><br />Thanks in advance..<br /><br /><br />EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-60783166949058040392012-10-22T11:54:39.592-04:002012-10-22T11:54:39.592-04:00@EffantTerrible,
The problem is that a some point ...@EffantTerrible,<br />The problem is that a some point (I think Android Tools rev 14 or 15) the ant target names changes.<br />Use<br /><br /><b>ant help</b><br /><br />to see the targets available. Probably <b>emma</b> instead of <b>coverage</b>.<br /><br />I would appreciate very much if you can post your comments to Google+ (http://dtmilano.blogspot.com/2012/10/androidviewclient-google-pages.html) which are easier to follow up.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-37542524960354183922012-10-22T02:37:32.609-04:002012-10-22T02:37:32.609-04:00Thanks a lot for posting about test !
I have som...Thanks a lot for posting about test ! <br /><br />I have some questions about the code coverage.<br /><br />I built the build.xml using ant Build<br /><br />and, in 154 page..... I typed "coverage"<br /><br />but after that I saw error message which is that "BUILD FAILED Target "coverage" does not exist in the project "This is my project package name" " like that..<br /><br />and I removed the "coverage" then, build success!<br /><br />But, you know I need a coverage.ec files<br /><br />I can not pull that file in my smart phone.<br /><br />...!<br /><br />thanks!EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-69578924903710242842012-10-19T09:36:53.044-04:002012-10-19T09:36:53.044-04:00Diego, how can I test XML Attributes that you can ...Diego, how can I test XML Attributes that you can set but can't get?<br /><br />i.e.<br />android:scrollHorizontally<br />android:textAppearance<br />android:ems<br />android:src<br /><br /><br /><br />Dr. Brad Dennishttps://www.blogger.com/profile/17150420515581182456noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-11679540483542430422012-09-25T02:01:16.471-04:002012-09-25T02:01:16.471-04:00@Marek,
Thanks for posting this info.
I have to co...@Marek,<br />Thanks for posting this info.<br />I have to confess that I'm also a fan of some of the Atlassian tools ;-)<br />Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-12494786081411741302012-09-21T07:07:15.223-04:002012-09-21T07:07:15.223-04:00Hi Diego,
I see that you're fan of Android pl...Hi Diego,<br /><br />I see that you're fan of Android platform and unit testing. You might be interested in a new code coverage tool for Android - Atlassian Clover. Read the https://confluence.atlassian.com/display/CLOVER/Clover-for-Android page. <br /><br />Cheers<br />Marek, AtlassianMarekhttps://www.blogger.com/profile/08624668220729678236noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-8766090656864757712012-09-18T21:19:29.721-04:002012-09-18T21:19:29.721-04:00Very insightful, thank you Diego!Very insightful, thank you Diego!Dr. Brad Dennishttps://www.blogger.com/profile/17150420515581182456noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-6249709557830232982012-09-18T18:43:41.998-04:002012-09-18T18:43:41.998-04:00@admin,
Sometimes you have to translate UI design ...@admin,<br />Sometimes you have to translate UI design documents into specs and testing for these mundane properties helps verifying them and also when the UI docs change you can go to a single place, change the values and then be sure the UI will satisfy the new requirements. Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-28802802883036341362012-09-18T10:02:58.955-04:002012-09-18T10:02:58.955-04:00This comment has been removed by the author.Dr. Brad Dennishttps://www.blogger.com/profile/17150420515581182456noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-62545206639487438482012-09-18T10:01:20.936-04:002012-09-18T10:01:20.936-04:00Hi Diego,
I'm following through your tutorial...Hi Diego,<br /><br />I'm following through your tutorial, but I have a question. What's the rationale behind writing tests for the mundane, static, gui properties such as alignments or default texts?Dr. Brad Dennishttps://www.blogger.com/profile/17150420515581182456noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-66579087684752220412011-11-30T23:16:08.451-05:002011-11-30T23:16:08.451-05:00In the latest release of Android SDK and tools thi...In the latest release of Android SDK and tools things changed a little.<br />Use 'ant help' to see the options for your specific version but it would probably be:<br /><br><br /> [echo] test: Runs the tests. Project must be a test project and<br /> [echo] must have been built. Typical usage would be:<br /> [echo] ant [emma] debug installt test<br /><br><br /><br />So<br><br />$ ant emma debug installt test<br /><br />would do the trick.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-25048311111776319412011-11-30T22:39:03.477-05:002011-11-30T22:39:03.477-05:00I met a problem, could you give some advice?
Targe...I met a problem, could you give some advice?<br />Target "coverage" does not exist in the project "TemperatureConverterActivityTes<br />t".Canvashttps://www.blogger.com/profile/10969110531665166029noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-26480889706683872932011-08-31T19:18:30.780-04:002011-08-31T19:18:30.780-04:00Hi Adolfo,
Thanks for your comments about the book...Hi Adolfo,<br />Thanks for your comments about the book. I'm glad to hear you found it useful.<br /><br />1. No, it's not needed in many cases. See page 284: The undocumented Ant coverage target.<br /><br />2. Good point, it's EclEmma, I should have include it in a slide, though the screenshots belong to EclEmma as you may have noticed.<br /><br /><br /><br />If you search this blog for "maven" you'll find some posts.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-34510355488464094452011-08-31T18:54:54.922-04:002011-08-31T18:54:54.922-04:00Thanks a lot for posting the slides Diego. I have ...Thanks a lot for posting the slides Diego. I have a couple of questions regarding the code coverage section of your presentation.<br /><br />* Is it still required to build Android from source code in order to enable EMMA, as you mention in <a href="http://www.packtpub.com/android-application-testing-guide/book" rel="nofollow">your book</a>?<br /><br />* Did you use <a href="http://www.eclemma.org/" rel="nofollow">EclEmma</a> to integrate the code coverage to Eclipse?<br /><br />I did not attend LinuxCon, so the questions come from what I read in your post.<br /><br />By the way, I've found your book very useful. The only thing I have had to figure out so far is how to put things together with <a href="http://maven.apache.org/" rel="nofollow">Maven</a>.Adolfohttps://www.blogger.com/profile/00178040193797649444noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-5363397897200114942011-08-31T12:37:39.053-04:002011-08-31T12:37:39.053-04:00This comment has been removed by the author.Adolfohttps://www.blogger.com/profile/00178040193797649444noreply@blogger.com