In terms of CI and test coverage, the code of this function has already been covered elsewhere (in Base). Shouldn’t it be possible for the CI process to “discover” that and mark it as (at least indirectly) tested? Or is this science fiction?
I’m assuming there is a continuum from impossible to automate to my example above. In the first case, automated tests would be a bad idea, but in the second case the automation wouldn’t do a worse job than what I’d be able to accomplish.
The fact that sin(x)+ and 2 work individually doesn’t mean the behavior you get by composing them is what you want and that you didn’t accidentally introduce a bug here.
To make an analogy, even if you use perfect bricks, mortar, and wood, you can still make a bad house.
Presumably, you created f to have some “higher” purpose, that is what we want to test.
No idea. I thought it would be possible to see that f is equal to the sinus of x plus two. Decompose it to units of code that have already been tested. But it sounds like that it would either be impossible or unwise.