For now I'm writing tidbits about computer programming, the plan is to actually blog at some point in time.

Wednesday, April 09, 2008

TDD and a code coverage tools

Arguments about how important is the use of code coverage tools are not scarce. I don't want to participate in any of those. I merely want to show that using a coverage tool while doing TDD will increase the probability of not leaving stones unturned.

The generally recommended way to do TDD looks like something along these lines:

1 - write a failing test case
2 - write the simplest code modifications that will make the test pass
3 - we are done if can't think of more test cases to write
4 - go back to (1)

If we absolutely stick to the recommended way, chances are that our test cases cover the totality of the code we write to make them pass. Unfortunately I would adventure to say that somehow in step 2 we tend to write more code that we should, and as a result we end up with code that is not tested.

Ending up with code that is not tested is precisely one of the things TDD tries to make sure we avoid.

Good thing is that with the help of a code coverage tool it is very easy to make sure we don't have code that is not tested. All we have to do is modify step 3 to look like:

3 - we are done if can't think of more test cases to write, and the code coverage of the class we are actually writing is 100% when all the test for that class are run.

---
EclEmma, a Java Code Coverage Plugin For Eclipse

Saturday, March 29, 2008

Intalling Mysql 5.1 in Leopard

if you are having trouble getting the Mysql Preference Pane to stop/start Mysql 5.1 in Leopard, you'll find the solution here.

Thursday, March 27, 2008

eSATA Express Card / eSATA Ext HD Enclosure and Leopard

I just had quite a nightmare after I got connected my new external hard drive enclosure to my macbook pro using an eSATA express card. Leopard kept on making on my macbook pro whenever I attempted to make any serious use of the external HD. Thank god it finally stopped crashing after reading many blogs entries and trying different drivers.

These are the hardware pieces:

- eSATA HD Enclosure
- Griffin eSATA Express Card
- Hard Drive

And this is the driver I ended up using:

- SiI3132_1.1.9u_Sil_Pkg

good thing is that the HD is fast fast fast!