Friday, July 4, 2014

I thought I'd tested that!

I had this big plan today to write about prime numbers, but after some initial investigation it turns out it's way more complicated than I thought. Now don't panic number lovers, I'm still going to cover it, I just want to make sure I do the idea justice.


So anyway, back to today's post. On Tuesday night I finally released my 2nd app, +task. Its a little to do list organizer I wrote for work.

I've been working on it for about 6 months now. This may seem like a lot of time, but any side project I work on only gets about 5 hours a week AND I just had a new kid (he's nice, so I want to hang around with him).


You might also be wondering why I don't just use any of the other numerous task apps out there. I tried. I used Keep, Wunderlist and many more I can't name. Turns out they didn't work perfectly for me, so being a nerd I thought I'd write my own.


I'd be remiss at this point if I didn't at least recommend it. I like it, give it a shot. It's available on Android only and is completely free. If you like it please rate it.


OK, so let's finally get down to the business of this post. It turns out I'm bad at testing, I always knew I was a little slap dash. I'd like to think over time I've become better, especially at work, but apparently when it comes to my side work, my testing is woefully lacking.


Case in point. I'm already on release 1.2. That's right, two updates in 3 days. I thought I'd done a good job, but on day 1 I found a bug and on day 2 a friend showed me another bug. These weren't little things, both crashed the app, and obviously left me with a feeling of shame.


It turns out adding features to your app in the week before release without proper testing is ill-advised. I actually had to remove a feature as the bug was so deep it was easier to remove than fix. Maybe someday it'll be back, who knows


I think the solution to this needs to be some kind of testing regimen. I don't have unit tests (I'm not sure if my app fits for this idea, maybe I'll do a post about this in the future).


Seeing as I can't be the first person to have had this epiphany, I did what I always do when I know nothing about a topic - to google! Then, obviously, follow up the initial info with a trip to stack overflow.

It turns our there are two major frameworks available for functional tests. Google has one called the Android Test Framework. Looks like it's completely integrated, but the major downside I see here is it's limitation to android 4.1 and above. That's a fast no for most developers. The main alternative looks to be called Robotium. From first glance it seems like it has everything Android Test Framework has and more, plus an easier command structure. It's hard to say how well either are for first timers (I think I'll try them out in the future and get back to you), but it's definitely a place to start. If I can offer you nothing else, here's a Stack Overflow question about which one's best.

I think my final advice is test. Somehow. If you're already testing thoroughly then nice job, you're clearly a better programmer than I am.

Tuesday, July 1, 2014

Introduction

Hi. Let me introduce myself. My name is Chris Johnson. That's right, Chris (11th most common) Johnson (2nd most common). Turns out there's actually 11,377 of us in America, 13,799 if we include the Chris and Christopher (and I will). At least I'm not lonely. In fact, if you're male (I assume people named Chris are) and live in the USA, there's approximately a 1 in 11,000 chance you share my name. So, kudos.



(I've never been great at introductions so just stick with me on this blog post, it can't get worse)

I grew up in Scotland and now live in Minnesota with my wife and 2 kids. I went to school for Physics and Math but realized a little too late my lack of interest for it. I now work as en Electrical/Software engineer for a little company in the Twin Cities. 

This blog is going to be about programming. I know, you're probably thinking, "Why would I read this when there are millions of other blogs out there?"

Fair point, what with all the Jeff Atwoods and Nick Bradburys out there, why bother? Well, hopefully I can provide a different point of view for you. 

I didn't go to college for computer science. I'm not some crazy computer genius who didn't go to college and has been coding since diapers (Jamie Zawinski, specifically). I'm just a regular guy who likes to program and wants to learn more about it. I thought I could use this space to talk about some of the things I work on and learn about and share some of that. 

I find the easiest way to code is to jump right in. Of course the problem with this is that things are never quite as pretty as I might like them to be. Thus, the name of this blog - Eternally Refactoring - describes most of my work.

For background, at work I'm using VB.NET with a little WPF and C# thrown in for good luck. At home I've been mostly working on Android and iOS apps. I'm hoping to keep learning and cover more as I go. 

If any of this sounds interesting, stick around. I'd be glad to have you. 

Chris.