The normal pattern is that the spec is shorter than the code, and therefore easier to get correct. That's why it's useful. Deriving the spec from the code therefore seems like going the less-useful direction.