Posts Tagged ‘TDD’

BDD vs TDD in Android

Posted: April 7, 2011 in Android, Java
Tags: ,

Several firms including PivotalLabs have advocated choosing TDD for android development. Thus, one has to ask what have they forgot to mention is part of the android platform that will force most developers the other way?

Yes, TDD is faster if you execute the process as that is not it. Android right now is a slightly crusted fragment platform. What is the most obvious choice to cope with that fragmentation? Let me put another way.

Do you have $1000 per month extra to pay deviceanywhere for their VirtualLab access? Show me the hands!  What can act as a sieve to allow you to make the correct performance, etc choices to target a majority of android OS versions in the market in users hands?

It is these things; the android sdk emulator and some smart programming choices. Think about it, the emulator does not emulate multiple core cpus or gpus which means it perfectly mirrors the low end android device.  Than by choosing BDD over TDD you are forcing yourself to examine those performance choices more closely as you will see them daily in operation as you execute all those BDD tests.

And to be blunt honest running BDD tests while coding in other areas is not that damn hard to make happen. Yes you kind of have to learn how your IDE operates so you can script some tasks, but so what?

Now lets go back to one of the first games on the G1, Replica Island. Guess what sieve they used to force them to make some performance and programming choices that happen to benefit the performance of the game? The sieve they used as the emulator and one G1 device which happen at the time to be very low end.

Now than look in the svn of ReplicaIsland you will see a game engine with very simple but powerful programming choice at its core. A modified mobile java singleton. With that and some other programming choices they got over 30fps on the G! devices.

Its not the agile process. Its going through every tool and process and asking does this tool or process fit within the constraints I have to work with. Now having stated that does an artificial sieve guarantee that you will make the right programming choices? NO, but you will see what happens if you do not right away right before your eyes as visual cues in that the application or game will run slow.

I am finishing up my next android contribution. Its a bug fix to fix the ANT support in the SDK by adding the proper ANT targets for unit and mock testing. If you have downloaded my Sdk customization extras you wil want to look at this bug fix as it has new targets added that are very useful. I will be posting a copy to this blog between now and Saturday.

List of new ANT  targets:











The post at this blog will contain a link to a code sample showing code for all the tests as an example so everyone can use it as a guide . Still attempting to get sponsored support for covering these Android Agile method subjects so that I can publish some chapters, if you know of a firm that would sponsor this let me know.

Reblog this post [with Zemanta]