And test them on a shell that isn't bash. Even with the --posix option bash accepts non-standard bashisms, particularly the execrable 'extension' of '>&'.
That's why I always put "#!/usr/bin/env bash" at the top of my scripts. Most were written to be portable, but unless it's been well tested, it's best to consider it not portable. Fail early and predictably rather than in strange ways.