3 ms·
Counting digits is very closely adjacent to the general category of parsing and printing (or serialization/deserialization), which are both tricky to get right
by fanf2 2y ago
Counting digits is very closely adjacent to the general category of parsing and printing (or serialization/deserialization), which are both tricky to get right and have simple correctness tests. They are perfect candidates for property-based testing.
- MrJohz 2y agoBut how do you do PBT here without having a known-correct algorithm available? Because that scenario is seldom the case in practice.