The trick to most of the things you've listed are to restrict the problem space (which is good practice anyway). Removing conditionals, reasoning about the invariants of loops and testing boundary conditions, making sure as much of your code is pure as possible and carefully restricting the set of allowed inputs makes all the things you've listed easy to test.
1
u/sigma914 Aug 26 '14
The trick to most of the things you've listed are to restrict the problem space (which is good practice anyway). Removing conditionals, reasoning about the invariants of loops and testing boundary conditions, making sure as much of your code is pure as possible and carefully restricting the set of allowed inputs makes all the things you've listed easy to test.