31 Ocak 2019 Perşembe

Unit Test - Brim Testi

Unit Test Yapabilmek İçin Tasarım Değişikliği
Bunu yapmamak lazım. Açıklaması şöyle.
Unit tests often break encapsulation and make the code under test more complex than would otherwise be required (e.g. by introducing additional interface types or adding flags). As always in software engineering, every good practice and every good rule has its share of liabilities. Blindly producing a lot of unit tests can have a detrimental effect on business value, not to mention that writing and maintaining the tests already costs time and effort.
Bir başka açıklama şöyle. Özellikle test edebilmek için production koduna test arayüzü eklemekten kaçınmak lazım.
I would argue it depends of the kind of change. There's a difference between making code easier to test, and introducing test-specific hooks that should NEVER be used in production. I am personally wary of the latter, because Murphy...

Hiç yorum yok:

Yorum Gönder