-
Maybe Don't Inject That
2019-10-03
I’m actually always suspicious when I’m writing up a pattern or a technique if I can’t talk about reasons when you shouldn’t use and trade-offs against it. If I can’t find arguments against it, then I’m worrying that I’m not really analyzing things properly. –Martin Fowler, “Is TDD Dead?”, 35:00 DI is useful. It’s great. It makes your code more flexible, testable, etc. Dagger? Also useful. Great. My favorite DI library.…
-
Dagger 2, 2 Years Later
2019-08-27
…in software, feedback cycles tend to be on the order of months, if not years…It’s during the full lifetime of a project that a developer gains experience writing code, source controlling it, modifying it, testing it, and living with previous design and architecture decisions during maintenance phases. With everything I’ve just described, a developer is lucky to have a first try of less than six months… –Erik Dietrich, “How Developers Stop Learning: Rise of the Expert Beginner”…
-
How to Abuse Kotlin Extension Functions
2017-05-26
I’ve got a “sweet tooth,” which, in my case, is just a euphemism for me saying that I’m addicted to sugar. I’m young now, but I know that this addiction won’t end well once my metabolism slows down, so I try go to the gym. Unfortunately, when I leave the gym, I often think to myself, “I just worked out, so I can snag that Oreo McFlurry I’ve been craving all day.…
-
Not Needing Dagger is a Code Smell (Pt. 1)
2017-05-12
A code smell is a surface indication that usually corresponds to a deeper problem in the system…smells don’t always indicate a problem…You have to look deeper to see if there is an underlying problem there. –Martin Fowler Some people don’t think Dagger is very useful. I’m a bit suspicious of these people. An application that doesn’t need Dagger smells. It suggests that there might be something wrong with the application’s architecture.…
-
Setting up a Jenkins Pipeline for Android Testing
2017-04-28
Some tests are fast. You can run 1000s of them in seconds. These are the tests that are the heart and soul of TDD, so you run them every chance you get. There are other tests that aren’t so fast. Because they’re slow, you don’t want to run them often. You’ve got better things to do than to sit and wait for test results to come through. Unfortunately, the less you run your slow tests, the less valuable they are.…
-
Android Testing Calisthenics: Domain Objects
2017-04-14
Imagine that you’ve never run a single mile in your life. You know that exercising is good for your health, so you decide that you’re going to take up running. Strangely, however, you also decide that you’re going to begin your journey towards physical fitness by running a marathon tomorrow. That’s obviously a bad idea. Less obviously, deciding to go from no experience with testing to writing tests for an already existing Android app is also a bad idea.…
-
Test Driving away Coupling in Activities
2017-04-09
Activitys and Fragments, perhaps by some strange historical accidents, have been seen as the optimal building blocks upon which we can build our Android applications for much of the time that Android has been around. Let’s call this idea – the idea that Activitys and Fragments are the best building blocks for our apps – “android-centric” architecture. This series of posts is about the connection between the testability of android-centric architecture and the other problems that are now leading Android developers to reject it; it’s about how our unit tests are trying to tell us that Activitys and Fragments – like the cracking bricks in the above image – don’t make the best building blocks for our apps because they tempt us to write code with tight coupling and low cohesion.…
-
Why Cryptography?
2017-03-25
We as engineers somewhere have a level somewhere where everything beneath that is a black box… Jake Wharton, Fragmented Episode 7, 1:12:00 For a while now, anything security or crypto related on Android has been a black box for me. For example, when I read the docs on Android’s KeyStore class or hear about Android’s Fingerprint authentication functionality on Fragmented, I often feel like I’m just barely understanding what’s being said.…
-
Why Im Skeptical about Kotlin Coroutines for Android Development
2017-03-19
A few weeks ago, the folks working on Kotlin announced the 1.1 release. Kotlin’s 1.1 release has experiment support for coroutines. Here’s the elevator pitch for coroutines from their blog post announcing the release: Asynchronous programming is taking over the world, and the only thing that is holding us back is that non-blocking code adds considerable complexity to our systems. Kotlin now offers means to tame this complexity by making coroutines first-class citizens in the language through the single primitive: suspending functions.…
-
What Unit Tests are Trying to Tell us About Activities Pt 2
2017-03-10
Activitys and Fragments, perhaps by some strange historical accidents, have been seen as the optimal building blocks upon which we can build our Android applications for much of the time that Android has been around. Let’s call this idea – the idea that Activitys and Fragments are the best building blocks for our apps – “android-centric” architecture. This series of posts is about the connection between the testability of android-centric architecture and the other problems that are now leading Android developers to reject it; it’s about how our unit tests are trying to tell us that Activitys and Fragments don’t make the best building blocks for our apps because they force us to write code with tight coupling and low cohesion.…