3 ms·
I don't care about known inputs. I care about correct output (including lack of crashes) on new inputs. Behavior on known inputs is only good for refactoring,
by tbrownaw 10y ago
I don't care about known inputs. I care about correct output (including lack of crashes) on new inputs.
Behavior on known inputs is only good for refactoring, not debugging.
- edgyswingset 10y agoHere are two scenarios: 1. Calling a function with the same input sometimes gives you a different output. 2. Calling a function with the same input will always give you the same output. Which do you think will more reliably give you correct outputs? > I care about correct output That's why we unit test. Well, and to protect the requirements of the system from the engineers who change the codebase. Referential Transparency (the concept described above) is a boon to this.