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

Comment by Filip Milovanović on How to know the expected result in Test Driven Development when using Constrained Non-Determinism without duplicating Logic

$
0
0
This goes better with a different way of testing - where you're not testing for specific outputs, but for things you want to be true of any implementation. E.g. suppose Scramble(string) function should return some random-looking output, and suppose one of the requirements is that the scrambled output should be the same for the same input strings. You could write a test that has a prepared input string & checks for an expected output string, but then you'd have to change the test every time you change the scrambling algorithm. Instead, call Scramble twice and assert if the two outputs match.

Viewing all articles
Browse latest Browse all 167

Trending Articles



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