-
RxLoader: Lightweight, Boilerplate-Free Data loading with Loaders and RxJava
2016-07-23
Loaders are awesome…they’re essentially the best practice implementation of asynchronous data loading in your Activities. -Reto Meier, Developing Android Apps Udacity Course …
-
An Espresso Test Recorder Deep Dive
2016-07-07
I’ve been working on a unit test recorder for Android. After struggling to find a way to implement the unit test recorder,1 I decided to take a look at how Google implements the espresso test recorder. This post presents what I found when I dug into the source code of the espresso test recorder. Collecting User Interaction Info Before I took a look at the source for the espresso recorder, I half expected to find some fancy bytecode manipulation of the sort we see for the proguard or jacoco transformers.…
-
Why don't we have a unit test recorder?
2016-07-01
Last week, I introduced Vice, a proof of concept regression test generation library. Vice generates regression tests simply by exercising the code we want to test. This is neat, but there’s already something else out there that does something like this, and ultimately, Vice as it stands doesn’t answer a fundamental question I have about regression tests: if we can record functional UI tests using the espresso test recorder or apple’s test recorder, why don’t we have a unit test recorder?…
-
Vice: A Regression Test Generation Library
2016-06-22
Changes in a system can be made in two primary ways. I like to call them Edit and Pray and Cover and Modify…When you use Edit and Pray, you carefully plan the changes you are going to make, you make sure that you understand the code you are going to modify, and then you start to make the changes. When you’re done, you run the system to see if the change was enabled, and then you poke around further to make sure that you didn’t break anything…Cover and Modify is a different way of making changes.…
-
How to Safely move Logic out of Activities
2016-06-16
In my last post, I argued that we should stop putting our app logic in Activitys and Fragments because it makes both unit testing and functional testing our apps more difficult. In this post, I’ll try to suggest a method of safely removing app logic from our Activitys and Fragments, drawing on a central idea discussed in Michael Feathers’ Working Effectively with Legacy Code: characterization tests. In the first section, I briefly introduce the idea of characterization tests.…
-
Why we Should Stop Putting Logic in Activities
2016-06-14
A while back, I wrote a series of articles about why unit testing Android apps is so difficult and what we can do to make our apps more unit testable. The upshot of the those articles is that dependency injection makes it easier to unit test our Android apps and we can’t get proper dependency injection just by using Dagger (or any other DI framework for that matter) to inject dependencies into our Activitys (or Fragments).…
-
A New way of Learning (Android Development)
2016-06-11
I’m working on a new way of learning android development. I call it “University Android.” The first lesson is available now. Check it out.
-
Testing Strategies with a React/Redux Architecture
2016-06-09
In my last post, I briefly introduced the principles behind React and Redux. I said that React is about making what gets rendered to the screen a function of some view-state object. I also said that Redux is about making updates to the screen a function of the current view-state object and an action describing a user’s interaction with the view. In this post, I explore a benefit of a React/Redux-like architecture vis-a-vis testing.…
-
How React-and-Redux-like Architectures for Android can make Testing Easier
2016-06-08
I think there’s a lot of value in seeing what else is happening, even if you’re not a master of one of those other languages. As long as you’re being exposed to it, you’re opening your mind up to different ways of approaching problems and solving problems and different techniques. Jake Wharton, Fragmented, Episode 6, 27:45-28:20 React and Redux are libraries that have taken the web development world by storm.…
-
PSA: Dont Use Espresso Idling Resources like Google does
2016-06-07
Roman Nurik: …That’s actually one of the harder things with writing good sample code. People are going to be copying and pasting the heck out of it so you can’t take those shortcuts that you sometimes hopefully aren’t taking. Chet Haase: I always take the shortcuts. That’s one of the more interesting things that the developer relations group does in general…we will put together tests and sample code for the features that we work but we really don’t have the time to dive in deeply and do it in a real context.…