-
What makes Android Apps Testable?
2016-12-03
This post is a continuation of my attempt to reproduce my recent DevFest talk in written form. …
-
Why we Should Probably Write More Tests for Our Android Apps
2016-11-07
This past weekend, I had the privilege of speaking about writing testable Android apps at Florida DevFest. This post is a written version of one of the major points I made in my presentation. Let’s start off with two descriptions of attitudes towards testing. The first comes from Kaushik Goupal (he’s describing an attitude, not endorsing it): Testing seems to be like going to gym. Everyone feels like “yeah. I should be testing.…
-
3 Ways of 'Getting to Green'
2016-10-16
A part of the TDD work flow is getting a failing test to pass as quickly as possible. This makes sense if we think about how TDD is supposed to help us take smaller steps when we’re writing programs. Beck goes over three ways of getting a test to pass quickly in the fist part of TDD By Example. The first method is to fake it. Just hard code whatever values you need to to get the tests to pass.…
-
The goal of refactoring During TDD
2016-10-16
Red, green, refactor. That’s the TDD flow. That much was obvious to me. However, refactoring is a pretty broad term. There are many reasons you may want to refactor code and as a result of this, I didn’t really understand what exactly was supposed to happen during the refactor step of the TDD loop until I finished the first part of Kent Beck’s TDD by Example. Actually, in the first description of TDD, Beck uses a more helpful description of the “refactor step.…
-
TDD and Startups
2016-10-16
Kent Beck introduces TDD by Example with a little story meant to show the business value of automated testing: Early one Friday, the boss came to Ward Cunningham to introduce him to Peter, a prospective customer for WyCash, the bond portfolio management system the company was selling. Peter said…“I’m starting a new bond fund, and my strategy requires that I handle bonds in different currencies.” The boss turned to Ward, “Well, can we do it?…
-
Unit Testable RecyclerViews
2016-08-08
When building our Android apps, we can often wind up with a decent amount of code in our RecyclerView.Adapters that we want to test. In this article, I briefly suggest two ways of structuring our RecyclerView-related classes so that we can accomplish this. …
-
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).…
-
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.…