Skip to main content

Posts

OpenSTF + Jenkins = Scalable In-House Device Sharing

I first learned about OpenSTF from a tweet by Square's Jake Wharton . It's frickin' awesome. I believe I've posted about this before but seriously go check it out if you're an Android developer or tester who has a pool of shared test devices to work with. It's FOSS and boss. Go check it out. At the time of Jake's tweet, there was no integration between the awesome little project and my cluster of devices configured to host test automation in Jenkins. Because of the open source natures of both OpenSTF and Jenkins, and the robust plugin system on Jenkins, it seemed inevitable to me that a plugin would be written eventually to marry the two. I even speculated that I might write one if I got the chance. Luckily for everyone that wasn't going to be necessary . It's actually really straightforward to set up and easy to use but here are a couple of issues with work-arounds you might want to consider: Issue -The API key from OpenSTF for the plugin...

Testing Your Android App's Readiness for International Audiences Without Translation

Google are serious about the global reach of Android. They place translation services front and center in the dev console for Android app publishing. They provide lint checks for localizability and internationalization issues. And they even have a single-line trick for enabling testing your app for localization: pseudoLocalesEnabled true Back in November of 2014 , this setting was added under BuildType to tell aapt to inject pseudolocalized text into your build for the following two automatically generated fake locales: en-XA and ar-XB. This is documented in the Android Gradle plugin's DSL here . As you can see, the documentation is a little... "sparse". When I tried it out, it didn't look like it worked at first and I went so far as to open a bug because I couldn't find any directories where the new localized strings files were stored in my project and my app didn't appear to show any of the expected updated strings. It turns out I was wrong in my assump...

Updating My Favorite Script

Since the last time I updated my blog, I've changed jobs and titles. While I still technically work in my new company's QA organization, my work is devoted more to app delivery than app testing. This doesn't mean I am not a tester anymore but that it consumes less of my time. It's no surprise therefore that I'm only NOW getting around to posting an update to my favorite script which I first shared 3 years ago here in this post . 3 years later and at least 3 years lazier, the ways I've modified the script are all designed to simplify it, make it more generic, and have it do more of the work for you. Instead of supplying a lot of configuration, it only concerns itself with the URL to the last successful build artifact of your build job. In this regard, I highly recommend NOT configuring your builds to name the files with dynamic data such as date, build number, git hash, etc. The filename is not something I'd consider a trustworthy source of build trivia e...

The Economics of Device Clouds in Continuous Integration

The rent is too damn high. Okay, let's look at the topic of device clouds. Microsoft's recent purchase of Xamarin means that now Google, Amazon, and Microsoft (3 major cloud computing service providers) all have their own device clouds which they also lease time on to the public (well, Google's purchase of Appurify hasn't resulted in that yet but it's coming soon and is currently in Beta). That makes 3 major cloud players who also build mobile apps buying their own device clouds and renting their overhead to the public. To me that's purely confirmation that if you intend to use real devices and you're a developer or a company that does a lot of development and testing of mobile apps, particularly on Android, you had better have your own cloud. If it were cheaper to rent than to own, why would those three major cloud providers buy existing device cloud as a service platforms? In reality, Google Ventures was the primary early investor in the Y-combinat...

A marshmallow shaped problem in my screenshot empire

"Never without my permission" ~ Leeloo (translated) android.permission.WRITE_EXTERNAL_STORAGE As a tester, you probably have a favorite app, maybe a favorite feature, possibly even a favorite bug. But you probably don't have a favorite permission. I've been taking advantage of it for years to do things like gather code coverage on non-rooted devices, logcat output from an entire test run, and probably my favorite usage is screenshots triggered when tests fail. Yep, that little permission has been a big pal of mine for a while. So it should be no surprise that I felt a little betrayed when I recently discovered a problem with it on devices running Android 6.0 aka "Marshmallow". Among the many changes brought about by the 6.0 release was a long-overdue overhaul to Android's permission scheme, notably, from an all-or-nothing approval of permissions at install-time model from Android 1.0-5.1.1 to the more nuanced permissions requested when requ...

Tester GIF roll pt 4 (Young Frankenstein Edition)

When you talk to the platform tech lead for your project about how to coordinate what gets automated with what is tested manually and you're pretty sure he's convinced the manual testers treat each new build all like... When you haven't participated in the sprint demo phase of your team's bi-monthly review ritual and they suddenly ask for a demo of the test automation project and you're all like... When the senior manager suggests contrary to your professional advice that the right approach is to just get something running on this new project, even if you know it is broken, because you'll magically have time to refactor it later and do it right, so that you can just show some pretty graphs and you're all like... When your new project is so stuffed full of libraries for the sake of libraries that your debug build is failing on the dex limit, forcing you to ask the developers to make adjustments and they come back with a solution that you just KNO...

Why Developers Shouldn't Perform Software Testing - A Rebuttal

Take a minute and read the following 2-pager entitled " Guest View: Why developers shouldn’t perform software testing ". Man, I tried to like this article because the author, Martin Mudge, clearly knows that businesses who undervalue quality by trying to eliminate testing through simply shuffling the traditional testing task to developers are making a huge mistake. Unfortunately he begins by making an assertion that testing overburdens a developer which at face value is complete nonsense. If you feel overburdened, it is a timeline issue and that is true no matter WHAT the nature of the tasking is.  So his assertion of “one the most important” contributing factors being overburdening the developers is massively flawed. It gets immediately worse from there because his second point is about time constraints.  Mr Mudge just gets so much wrong. What he really should be shooting down is the idea that testing, as a cost-center not as a task, can be eliminated by having your p...

Boom! Screenshot! Level up your test debugging with RunListener

UI automation is like a dumb computer user; a really, really, profoundly dumb computer user. It will fail, it will be obvious that it is failing. But it won't always know immediately why. Sometimes just observing it's failures by means of a screenshot of the failure is all it takes. As you recall from my last post on the topic , screenshots on failure are a potent way to quickly reduce the time to answer the question of why a UI test case failed. Google's Android Test Tools team likes screenshots enough that they've included the capability inside the UiAutomator framework . Square likes it enough to have included it in their Spoon framework . And as we all remember, Robotium's been doing this for a long, long time . The main advantage to the approach I described previously is that screenshots would happen automatically based on errors of any kind in the test lifecycle. As of now, you're all probably migrating or have already migrated to the newer Android...

Tester GIF-roll pt 3 (UiAutomator 2.0 edition)

When you go from building UiAutomator 1.0 tests in Eclipse as a stand-alone JAR over the last couple years to trying to use UiAutomator 2.0 within a product codebase with Gradle and nothing looks familiar... When you figure out why you were getting a null pointer exception after 2 days and it was all because of a copy-paste error... When you start trying to explain a tricky problem with a new test framework to the front-end developers on your project and it starts to feel like they're more spectators then collaborators... When you right-click on a test method and choose "Debug as..." and start debugging your UiAutomator test after all those months of needing to compile a JAR and edit a shell script prescribing which test case to run instead... When you can no longer use all those fantastically useful shell commands you were able to run in your UiAutomator 1.0 tests because 'adb shell uiautomator...' imparted sufficient permissions but 'adb...

Tester GIF-roll pt 2

When you keep ramping up the event total count on your stress test because it mocks you by not resulting in crashes... When you join a legacy project and upon looking through their Gordian-knot of build dependencies realize that 90% of it is obsolete, yet subtly interdependent experimental code no longer included in the app (EWWWW)... When the project planners lowball the QA estimates because all they're doing is "throwing on a fresh coat of paint"... When that other team throws yet another party celebrating a routine bug-fix release...

Jenkins + Devices + AndroidJUnitRunner

New Android build system and test runner, same goose chase using undocumented features and hacks Oh, you thought they were ready to support full enterprise scale CI just because they moved to Gradle? As I've posted before, I am a big fan of Jenkins. It is extremely flexible, open source, and supported by a staggering array of plugins actively developed by engineers running over 100,000 instances of the server worldwide. With it's distributed node model, you can even build your own device cloud for hosting enterprise-scale automation , economizing hardware investments by sharing resources across multiple projects as well as speeding up automation by parallelizing test runs. I had been using a Jenkins-based system in the past to support instrumentation automation with Robotium quite happily. For the last couple years however, my work hasn't required that as much and I've found myself doing a lot more manual testing and using UiAutomator which didn't require...

Tester GIF-roll pt 1

When you label a bug P1 and are asked to justify that by explaining the impact on the user: When they force you to run the sprint demo and a new bug shows up in the middle of it: When a developer says "show me" and the bug miraculously stops happening: When your bug report is rejected on the grounds of "design by defect" not on the merits of the issue itself: When you spend all day searching the spec documentation for a subtle requirement justifying the bug you're reporting only to refresh the page and see that requirement was just deprecated: When you find a bug so pernicious, it takes the senior developer a week and a half of steady work to fix it, then you immediately find another bug in the fix: When you see the build in production and immediately find a spleling error: When you're asked to estimate the amount of effort it will take to test a specific user story during sprint planning and someone on the team...

UiWatchers + Factory Pattern UI Fragmentation handling = Device lab lock screen Jeet Kune Do

In 2013 at a Google-hosted event in New York called the " Google Test Automation Conference ", or GTAC for short, a team of Google engineers tried to sell the attendees the idea that a device lab consisting of real world devices is not as maintainable or optimal of a test bed as a vast server farm running emulators. That's right. Google said that in order to avoid the tyranny of dealing with the real world everyone should have a Google-scale server farm for testing their apps ( video , slides ). And then 2 months later they bought Appurify . Those are pretty epic mixed signals. Example of less paradoxical signaling. Now don't get me wrong, I would LOVE to have Google's server resources for my automated testing. But like many companies who do not make mobile apps or even software in general as their primary business, my current employer seems to prefer to invest more shall we say "modestly" in their app test automation environment resources. ...

Crushing Fragmentation using the Factory Design Pattern with UiAutomator

Android Fragmentation, UI Testing and You Last year, Eddie Vassallo over at Gigaom.com joined the rest of the well-informed tech bloggers in agreeing that at least as far as developers are concerned, " [it's] 2014, and Android fragmentation is no longer a problem. " While the developers have tools and patterns that will allow them to successfully build appealing, rich experiences for any screen size and support devices many years past their prime, just the term "Android fragmentation" can intimidate many people trying to decide what phone or tablet to buy. The developer has the ability to access powerful adaptive interface layout APIs and rely on Google Play Services to update crucial dependencies such as Maps and Push Notifications. That behind-the-scenes flexibility is meaningless to an end user staring at a dizzying array of devices from OEMs hellbent on stamping their unique mark on the user experience. Looking at phones such as the Samsung Galaxy Note...