Сообщения

Сообщения за март, 2012

AutoFixture

AutoFixture - автоматическое наполнение тестируемого объекта и вложенных объектов произвольным данными. Интересная библиотека, приятная и удобная в использовании. Имеет гибкую систему подстройки и внедрения в процесс автозаполнения. Нет версии для Silverlight, но я легко ее доработал для работы в нем. Потребовались незначительные изменения. Автор просто не использует Silverlight в своей работе. Если полюбите, то не забывайте в Unit-тестах про тестирование пограничных значений!

Test Not First

From http://www.simple-talk.com/dotnet/.net-framework/on-writing-unit-tests-for-c/ A practice that is made popular by Agile and Extreme Programming methodologies is ‘test-first development’. From Wikipedia: ‘The tests should be written before the functionality that is being tested’. I don’t agree with that. Tests for a portion of code should be written at the same time as the code itself. I advocate this because not all edge cases can be faced up-front, even by domain experts or professional testers. Edge cases are generally discovered only when thoroughly implementing an algorithm. This is an iterative process where you write a few tests, then write the few corresponding lines of code and methods, and repeat until the features and classes are completely implemented and 100% covered by tests. By talking with many who advocate test-first principles, I find that they are also talking of a process where code and test writing are iterated. We are certainly doing it all the same way in