As soon as I had more or less clear idea of what should be done I started creating the application. During last few years I was one of the fans of agile methodologies and integrated them on all projects I participated into. I was so eager to start that ignored practices of TDD and start coding to gain immediate results (Honestly, haven’t done it on production projects for the last years). I did write tests – initially I created no UI, and used NUNit to run simulations (I do it even now). And after having first results very fast (like having simulation for several creatures “fighting” with each another) I recognized that some nasty bugs appeared there. In most cases it caused incorrect results and incorrect statistics of simulation. Code did compile and some results were produced – but I had to spend type debugging more and more each day.
I had no other choice (at least a reasonable one) than cover existing code as much as possible not to miss any possible bug and save my time further. I downloaded NCoverExplorer and started measuring coverage. Well, it was not so bad even initially (~50%) but I forced me to write tests at the same time (I know that classical way is to write tests first but another approach works for me so far) as writing functionalities and measure coverage all the time. Well, it was event pleasant seeing how the coverage grows…
As a conclusion – write tests, check the code coverage(and keep it high) ,don’t skip good practices, even if you’re making something for yourself – otherwise you’ll loose your time that you could spend for something interesting
Regarding writing tests first – personally for me it is almost the same if I keep in mind what I am going to achieve while writing them
пятница, 27 апреля 2007 г.
Подписаться на:
Комментарии к сообщению (Atom)

Комментариев нет:
Отправить комментарий