in reply to Unit Testing Non-Deterministic Behaviors

You can test that the generated password has the form you expect. Suppose you have read and chomped the wordlist into the keys of a hash, %words. Then the expression,

$passwd =~ /^(\w+)\d{3}$/ and exists $words{$1}
is true only if the password has the form you describe.

After Compline,
Zaxo