-
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.…
-
Process vs. Procedure Recursion
2016-04-06
Just because a procedure is recursive, doesn’t mean the process that it generates is recursive. A procedure is recursive when that procedure refers to itself in order to evaluate. (defn factorial [x] (letfn [(fact-iter [product counter max-count] (if (> counter max-count) product (fact-iter (* counter product) (inc counter) max-count)) )] (fact-iter 1 1 n)) ) fact-iter, in the above code, is a recursive procedure, but the process it generates is not recursive.…
-
Abstraction, Scope, and Bound Variables
2016-04-06
Here’s my big take away from sicp section 1.1.8: Abstraction requires Scope and Bound Variables Procedures (or functions or methods) let us abstract our code. Abstraction is about dividing our program into identifiable tasks that can be reused in the construction of other (identifiable) tasks in our program, which can in turn be used to construct more complex identifiable tasks, etc. In order for procedures to enable us to abstract our code, parameter names of a procedure must only have meaning within body of that procedure.…
-
Sicp 1.1.1-1.1.7
2016-03-29
Today was my first work day at the Recurse Center. Yesterday, I found out that there’s an SICP study group. I’ve been wanting to study SICP for a while now, so naturally I joined. What follows are my thoughts and key take-aways from sections 1.1.1-1.1.7. Declarative vs. Procedural Knowledge Abelson et al. open the book with a really interesting distinction between declarative and procedural knowledge. Moreover, they suggest that the most significant achievement of computer science is that it provides a way for us to study procedural knowledge.…
-
Testing Package Implementation from 'the Outside'
2016-02-03
Sometimes you need to test a package’s implementation from outside of the package containing the implementation you’d like to test. This post briefly covers why this need arises and how we can meet that need. Much of the information here is already covered in Andrew Gerrand’s testing techniques talk, so if you’ve watched that, you’ll probably only think the last section of this post is interesting. Why? Like I just said, sometimes you need to test a package’s implementation from outside of the package containing the implementation you’d like to test.…