Where there is an inverse function for a function, the two functions should be paired to ensure that they are entirely consistent, and remain so. A function's inverse could also be used to generate test inputs from expected results.
Some functions are their own inverse, and pair with themselves (for example, a function which reverses the order of its input).
Some functions are naturally "lossy" and have no inverse (like a sort). Some of these can be constructed as a lossless function that has an inverse, followed by a lossy function that does not. (For example, you can sequentially number the elements to be sorted before you begin the sort function; the "unsort" inverse would then sort by the sequence number, returning the elements to their original order.)
"And if a function is paired with its inverse, you can automatically check that the final output is the same as the initial input. As under#Distillation of existing content, this is an important consideration for a rendering sub-function, whose inverse is a parser sub-function.--GrounderUK (talk) 23:26, 29 July 2020 (UTC)
I really like the idea of using the inverse to auto-generate tests! That should be possible, agreed. Will you create a phab-ticket? --DVrandecic (WMF) (talk) 02:11, 5 August 2020 (UTC)
https://meta.wikimedia.org/wiki/Talk:Abstract_Wikipedia#Some_questions_and_ideas