Wrapping up everything in tests is a good way to avoid everything blowing up if something's missing/wrong/broken.
(For debugging purposes (of the inlined parts of the script), testing your scripts with a shell in -e mode is also a good practice, especially if you rely on external tools with broken return codes).
Cf. dos1's tool for more examples, or the upstart jobs of the
SS/Fonts hacks).