News for hackers. Stuff that matters.
Re:Questions to ask yourself when writing tests by blowski on Tuesday January 02, 2018 @03:19AM (#16050631)
There is no silver bullet. Personally, I let a combination of complexity and importance guide my tests.

The more likely it is that a piece of code will break, and the more business damage it will do if it does break, the more tests I wrap around it.

For self-contained algorithms that have a lot of branches or complex cases, I use more unit tests. When the complexity is in the interaction with other code, I write more high-level tests. When the system is simple but critical, I write more smoke tests.

If I’ve got simple code that’s unlikely to break and it doesn’t matter if it does break, I might have no tests at all.

Re:Questions to ask yourself when writing tests by ed_blackburn on Tuesday January 02, 2018 @07:12AM (#16051423)
100% In critical areas I would suggest parameterised tests are worth the effort, especially in conjunction with generators. Property-based testing in FP for example, or just test data generators that'll generate a good range.
Re:Questions to ask yourself when writing tests by blowski on Tuesday January 02, 2018 @08:58AM (#16051832)
I'm not sure what's involved there. Do you have more detail, like a good blog post, to read about how to do that?
Re:Questions to ask yourself when writing tests by dvlsg on Tuesday January 02, 2018 @11:41AM (#16053012)
Not OP, but I particularly enjoy the fsharpforfunandprofit article about it.

https://fsharpforfunandprofit.com/posts/property-based-testi...