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.

No comments:

Post a Comment