News for hackers. Stuff that matters.
Re:What if writing tests was a joyful experience? by blowski on Thursday January 12, 2023 @08:45AM (#34353378)
There is a difference between these three statements:

1. It can't be tested.

2. I don't know how to test it.

3. The tests don't give enough value given the effort required to write them.

The less experience you have with tests, the worse the cost-benefit analysis comes out. This is why people disagree over unit tests. Good tests give a huge productivity gain, but the opposite is true of bad tests. Unfortunately, there's a vicious cycle:

  You write bad tests 
  -> You don't value tests 
  -> You don't spend time learning to improve tests 
  -> You continue to write bad tests
Re:What if writing tests was a joyful experience? by hbrn on Thursday January 12, 2023 @03:57PM (#34360148)
The problem is that writing good tests is harder than writing original code.

And what happens in most companies? We hired a junior engineer and don't have work for them... let them write tests!