|
|
|
|
|
by ben509
2603 days ago
|
|
That's been my experience in recent years; unit tests eliminate a whole swath of bugs that I'd otherwise use a debugger for. And beyond the bugs themselves, reading the unit tests shows me what a function is expecting and what it's doing, and especially its behavior in edge cases. The other technique I use is judiciously placed assertions that enforce invariants. I'd rather the system fail explicitly than have it returning junk data to users. (I work in finance, so customers are far more forgiving of a system returning an error message than seeing their balances be mysteriously wrong.) |
|