3 ms·
> You do know there's a way to verify a function to a degree > of 100% without writing a single test? I carefully tried to avoid the word "function", as mathe
by bArray 6y ago
> You do know there's a way to verify a function to a degree
> of 100% without writing a single test?
I carefully tried to avoid the word "function", as mathematically they tend to be well defined. As soon as you have anything even mildly complex or some element of randomness - suddenly the number of required tests to brute force the problem can explode.
> I would say the last micro service I wrote, (in python)
> was virtually 100% bug free ever since it went into prod.
There is never any bugs, until there is. Also there is quite some difference between code that is easy to reason about and code that is not.
> I would still say a testing suite is still good for new
> programmers diving into an unfamiliar system attempting to
> change things haphazardly, but in terms of correctness I
> question this strict almost religious adherence to unit
> testing.
I think relegating bugs to something only new programmers write is unfair.
I doubt you have a full compiler in your head or could even begin to consider all possible states of some code that could be considered complex. If your existing code is complex enough, chances are that you already have introduced some bug.
To be honest, I don't write high test coverage either for most projects, but I am sure to write tests for code that I either have trouble reasoning about or is of high enough complexity. It happens, even for veterans. Sometimes when pair programming I even spotted very seasoned programmers making such mistakes when they are tired.