A common problem many people ask is - should you test private code? In
short, you shouldn't. You should always test the public api of your code
where possible. This is not always easy. Based on the context of the
code in question there are a few options available.
The use of randomly generated test data seems like a good thing at first
glance. Having worked with several teams that have used this concept I
generally discourage the practice. Consider a simple method that joins
together two strings. A test using random values may look like this.
I remember being introduced to Test Driven Development (TDD) very well.
This is because it had such an overwhelming change on how I write code
day to day. It was incredibly alien, difficult, yet rewarding. On this
journey for the last five years I've changed my style, learned how not …