Re:We should be more ambitious with the software we build
by huijzer on Monday October 26, 2026 @12:43PM
(#50246803)
Say we have a trivial function like this
Now what would a test for these two paths test? It would basically be writing down the same - easy to understand logic - in a less generalized way. Good perhaps to ensure that this function doesn’t accidentally change over time but apart from that it wouldn’t add much value.
[ Parent
| on HN ]
Re:We should be more ambitious with the software we build
by thunky on Monday October 26, 2026 @06:33PM
(#50252061)
> It would basically be writing down the same - easy to understand logic
Perhaps this is a sign that this function isn't necessary.
Re:We should be more ambitious with the software we build
by AndrewKemendo on Monday October 26, 2026 @08:56PM
(#50253403)
Exactly. If the function is already verified to be correct, then the unit and integration tests will determine if the function is appropriate for the context.
Unit tests aren't for verifying functions.