> If you aren’t perfect at writing tests, how do you know the tests are complete, bug free, and actually useful? :)
I did like the rest of the post, but this is not hyperbole. It's just a disingenuous argument, and one that looks orthogonal to your point that "tests are a tool for a job".
If you aren't perfect at magnetizing iron, and you need a working compass, you better magnetize two needles and use one to test the other. The worse you are at magnetizing iron, the more important it is that you do this if you want to end up with a working compass.
> If you aren't perfect at magnetizing iron, and you need a working compass, you better magnetize two needles and use one to test the other. The worse you are at magnetizing iron, the more important it is that you do this if you want to end up with a working compass.
This is modern testing in a nutshell - it's ineffective but the author of the test can't actually tell that!
Using this analogy, if you created 10 magnetised needles using the wrong process and getting the wrong result, then all 10 would agree with each other and your test passes, but your needle is still broken.
Hint: if you think the way to test whether a needle is magnetized using another possibly magnetized needle is by building both needles into two separate compasses, you're nowhere close.
> Hint: if you think the way to test whether a needle is magnetized using another magnetized needle is by building both needles into two separate compasses, you're nowhere close.
I thought it was clear from my post that I do not think this.
> if you created 10 magnetised needles using the wrong process and getting the wrong result, then all 10 would agree with each other and your test passes
This suggests that you do think soemthing like this. Again, the way you test wheher you successfully magnetized a needle using another potentially magnetized needle is not by checking whether they "agree with each other" in the end application.
> This suggests that you do think soemthing like this.
Or it suggests they’re continuing the analogy (which isn’t perfect) to make a different point.
> Again, the way you test (…) is not (…)
Twice you’ve spent the majority of words in your post telling someone they’re wrong without explaining the correct methodology. That does not advance the conversation, it’s the equivalent of saying “nuh-uh” and leaving. If you disagree, it’s good form to explain why.
It doesn’t take long to say the failed magnetisation would leave all needles pointing in disparate directions, not the same consistent wrong direction. Unless there’s something else in your test that is so strong and wrong that it causes that problem, in which case the analogy starts working again.
>> if you created 10 magnetised needles using the wrong process and getting the wrong result, then all 10 would agree with each other and your test passes
You snipped out the qualifier to the paragraph. The qualifier is important. Here's the full quote with the qualifier:
> Using this analogy, if you created 10 magnetised needles using the wrong process and getting the wrong result, then all 10 would agree with each other and your test passes, but your needle is still broken.
IOW, using this analogy for software development, all the products created with the wrong algorithm and/or process would all agree with each other. It's why I say you are missing the point.
You're not creating a binary product that either exists or doesn't exist, like magnetism, so repeating the process as some sort of "test" is a broken way to test.
It's also the most popular way to write tests: the tests are effectively moot because a pass does not indicate that the result is correct.
Apart from the fact that in your example the produce is validated using the exact same produce, you are actually describing the perfect test:
Two magnetized needles will validate each other, so both the product (needle#1) and the test-setup (needle#2) will be confirmed as valid in one step. If one is not working, the other will self-validate by pointing at the earth magnetic field instead...
The problem with using two needles to test each other (instead of using an external third source like the earth's magnetic field) is North and South could be swapped on both of them. The test would validate correct but the needles be wrong.
I did like the rest of the post, but this is not hyperbole. It's just a disingenuous argument, and one that looks orthogonal to your point that "tests are a tool for a job".
If you aren't perfect at magnetizing iron, and you need a working compass, you better magnetize two needles and use one to test the other. The worse you are at magnetizing iron, the more important it is that you do this if you want to end up with a working compass.