Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Viewing all articles
Browse latest Browse all 167

Comment by Filip Milovanović on How do unit tests facilitate refactoring without introducing regressions?

$
0
0
"Unit tests are inherently tied to the way code is implemented." - no, but that's the crux of the issue: how most people write tests makes them tied to the implementation. Suppose you're testing a function that anonymizes data - if you write a test so that it checks a for a specific value, you're tied to the implementation and you can't choose a different anonymization algorithm. Instead you should be testing for properties that are expected of this function (a.k.a. "behavior") that client code relies on. 1/2

Viewing all articles
Browse latest Browse all 167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>