Mittwoch, 19. März 2008

7 reasons why test-driven development rocks

Did I ever mention that test-driven development rocks? No? Well, it sure does :)
Here are my top 7 reasons:

  • Know when you're done. Back when I didn't have tests prior to implementing functions I never was sure when the implementation was actually done. There was always this unspecific feeling of having forgotton something...

  • Reward. Everytime a test passes, I get this satifying feeling of having accomplished something :)

  • Efficiency. Writing tests forces me to think about solutions instead of thinking about problems.

  • Better software design. Writing tests before implementing the actual method forces me to think about what exactly I expect the method to do. Methods that are awkward to test are awkward to use, and require redesign.

  • Refactoring. You simply cannot refactor your code without having tests in place. But if you have tests, refactoring is a breeze.

  • Confidence. Having tests in place makes me confident that my code does what I want it to do. Well, most of the time... But when I encounter a bug I add another test and regressions won't hurt me.

  • Example code. Test functions are concrete examples how to use a given function in my code.

I would have liked to have 10 top reasons, but couldn't figure out the remaining three... If you have one, please comment!

Donnerstag, 13. März 2008

Neural Ensemble

The Neuralensemble project brings together several efforts to make simulations of neurons easier. Currently, I spend most of my time working with the tools they created. Since a few days I have an account on their TRAC server, so I thought this is a good time to blog about it.

The project which got me into neuralensemble is PyNN , which provides a unified front end to several widely used neural simulators, e.g. NEURON, NEST and PCSIM. PyNN greatly facilitates setting up neural networks, because it provides an abstraction from simulator-specific languages. As the name suggests, it's written in Python, and lets you specify the network in Python, too.

For experiment design and analysis of simulated data there is Neurotools. It's written for PyNN (in Python), but can also be used independently from it. One of the most promising design goals is its ability to control large experiment sets, e.g. to systematically investigate the impact of certain parameters on network function. I'm sure every scientist who does computational modeling has written code to deal with this tasks at least once. Having a common API for this is a great thing.

Neuralensemble is a dynamic community which is still very open to all sorts of contributions. So if you're into modeling of neural networks, you should definitely give it a shot!

Montag, 10. März 2008

Python IDE revisited

Today Komodo edit got released under various open source licenses. Since I'm still looking for a decent Python IDE I could not wait to try it.

My very first impression is a very good one! It looks like Eclipse, but I can live with that... especially because it lets me use Emacs keybindings. Killer feature :). Beyond that, code completion seems to do a good job in Komodo Edit, something I never got around to set up in emacs.

Of course, I still need to check out things like code navigation, refactoring and other IDE goodies... soon to be reported here!