Saturday, December 22, 2007

Artikel über Unittesting (in .NET)

Als ich noch vor zwei Wochen bei dem Wort "JUnit" angeguckt wurde wie ein Alien und nachdem etwas schief gegangen ist hämische Bemerkungen kamen, habe ich wieder bemerkt, dass Unittesting von den meisten Uni-Absolventen immer noch nicht wirklich wahrgenommen wird.

Da kommt es mir gerade gelegen, dass Karl Sequin diese Woche einen ausführlichen Artikel über die Unittesting veröffentlicht hat. Die von ihm vorgestellte Toolchain ist zwar auf .NET ausgerichtet, aber ersetze NUnit durch JUnit und RickoMock durch jMock und auch der Toolchain-Abschnitt ist weiterhin grundsätzlich gültig:

Sein Fazit ist:

But after my first project [using unit testing], I learnt a lot about what did and didn't work. One thing that immediately became clear was how much cleaner my code became. I quickly came to realize that if something was hard to test and I rewrote it to make it more testable, the entire code became more readable, better decoupled and overall easier to work with. The best advice I can give is to start small, experiment with a variety of techniques, don't be afraid to fail and learn from your mistakes. And of course, don't wait until your project is complete to unit test – write them as you go!

Der Artikel ist Teil der Serie "Foundations of Programming", die insgesamt sehr lesenswert ist.

No comments:

Post a Comment