My Thoughts: Spike to Refactor

When you're stuck on how to do TDD for a refactor; and can't find the test to drive the refactor you'd like to see; a spike can often help. What I've done are a spike w/o tests to figure out a solution and then figure out the tests required to drive the code to that solution. I did this recently with the Android HackerNews App. During the Clean Architecture [Read More]

JWT Token Validation in C#

(and not doing it wrong) A blog post directly tied to something I'm doing at work - Like researching something FOR WORK!!! Not just related to, or ancillary to; but actual research for actual work. Crazy, I know. The basic premise is that we're doing OAuth for our mobile app; which the server endpoints need to validate the token. The server is not the authenticating server. We'll need to share [Read More]

Android HackerNews App : Refactor to Clean Architecture

A philosophy I like and have made a(n unknowingly) passive effort to implement before is called "Clean Architecture". It's the idea of an application having dependencies that flow "outward". Go read The Clean Architecture by Uncle Bob; for the full picture. A simple way to state this is, "No Circular Dependencies". If A depends on B; B and nothing B depends on can have a dependency on A. It [Read More]

HackerNews Android - Let's not crash

As discovered in our last session - Opening a lot of connections breaks things. The creation of the OkHttpClient is done in HackerNewsNetwork#getClient... ugg... A get. Ruthless refactoring! As I was saying; the creation is done in HackernewsNetwork#httpClient. private OkHttpClient httpClient() { return interceptorObj == null ? new OkHttpClient() : new OkHttpClient().newBuilder().addInterceptor(interceptorObj).build(); } Obviously just spinning up a bunch of them. We need to keep a single client to [Read More]

Interface Overloading - TDD Against UI

WTF... ... is interface overloading. Or Overriding. I kinda toggle between the terms. Right now I'm favoring Interface Overloading; so that's what the title is. Interface Overloading Interface overloading is the process I've found in C# and JAVA to allow TDD when using Libraries and OS Systems. This should clearly not be the ONLY way. It's a mechanism I stumbled across while TDDing up an android app. I wrote this post [Read More]

Code Kata - Bowling BlackJack

As an exercise; I'm doing a CodeKata... well... working on extending a code kata via BlackJack. We've done the kata for Bowling. Now we're going to extend it to include BlackJack scoring. BlackJack is a fairly simple game to score. You have points between 1 and 11; you sum them. Right. Now make it do Bowling and BlackJack. Oh... As an added larf; Make it output FizzBuzz. Yes. I sometimes [Read More]

HackerNews Android - Get a Job

The Top Stories apparently can include job postings. I have the StoryAdapter only accepting responses that have the type of "story". We need to build up a path for Jobs because it's in the payload. Well... mostly because it crashes the app when I scroll. Network We can assume that we'll have a Job class like we have a Story class. Gonna swing in the test class to TDD it [Read More]

My Thoughts: Android App Development

I'm blogging because I'm not seeing resources that covers the things I've been asked; or that I've worked out myself (like an upcoming post about maintaining Object Encapsulation). I also blog so I can google my brain later for myself or to provide my thoughts to others in a shareable repeatable form. There's not enough examples of Software as a Craft practices, in general, with Android especially lacking. I find [Read More]

VBM on Android - Activity Testing

We're continuing our work towards understanding how we can have near 100% test coverage. I get pretty annoyed at the Activity class sitting there at super low percentages and feeling like there's nothing I should do. Not that I feel there's nothing I can do; just that "it's a boundary layer" ... A lot of the same arguments I made for the Adapter. Welllll.... That's at 100% now. I've tried a [Read More]

MyThoughts - Requirements Drive Design

A recent comment on the blog had me start to implement a Formatter for the Android HackerNews app. I did work on it and realized quickly that I had no idea what I was doing. Not that I can't code (ehhhh...); I had no requirements driving it. I was putting in a pattern for the sake of using a pattern. This emphasized to me the need to have a requirement [Read More]