(no title)
nrinaudo | 9 years ago
Don't get me wrong, that's still valuable - if only for the non-regression aspect - but I feel property-based testing is a superior approach.
Write your code ("this is a function that sorts lists of ints"), write a property ("when given a list of ints, after sorting it, elements should be sorted and the list should have the same size"), let the framework generate test cases for you. Whenever something breaks ("lists of one element come back empty"), extract the test case and put it in a unit test to make sure the same issue doesn't crop up again in the future.
No comments yet.