Saturday, July 04, 2009

IDE vs. vim is integration testing vs. unit testing

Unit testing can be more effective of integration one because it find defects on the single parts. But also single parts, a la unix way of life, can be more effective of a whole.

Disclaimer: IDEs and vim/emacs is the topic of a long Holy War. This is only my opinion and I don't want to start a flame.
As discussed in Respect my privacy, we should try to write more unit tests than integration ones, exercising one class or component at the time. This is because you don't test a ship engine by going out in the sea, but isolating him in a naval yard.
As many have written in the past, an engineering process, like building a Shuttle or a complex software, works best when is done bottom-up, testing the single parts, while is difficult and costly when doing with a top-down approach. In code, for instance, there are too many path to tests because for every class that is added to a test a multiplicative factor is placed in front of the testcases. If we have 10 components integrated with each other, well'have 9*10 unidirectional channels of comunication to test; testing indipendently reduce this number to 10.
The same can be said of IDE, but this time we can have up to 20-30 plugins. Not all of these components interact, but we can never be sure. If there are two options in a menu coming from different plugins, they're already interacting.
The problem is not testing here, but software complexity: how can a single software does the job of 20? I think that is not 20 times as complex, but 400 ones (n^2); and what is overly complex will someday break over its weight.
Compare that to the simplicity of the unix philosophy: doing one thing, and doing it well. We have not Eclipse and its plugins, but we have command line gems such as svn, phing, ant, ssh, vim (or emacs). And we can use vim over ssh trasparently, to edit a phing buildfile checked out from svn.
Some IDEs take advantage of these tools delegating at them, others incorporate a buggy implementation of a subversion or ftp client. There is always some reinvented wheel in the ten panels of an IDE.
You're using a giant Swiss knife or a good tool box?

No comments:

Post a Comment