c. 1300, roten, of animal substances, "in a state of decomposition or putrefaction," from a Scandinavian source akin to Old Norse rotinn "decayed," past participle of verb related to rotna "to decay," from Proto-Germanic stem *rut- (see rot (v.)).
Of vegetable substances from late 14c. Also used in North America of weak, melting ice (1660s). The figurative sense of "morally corrupt, wicked; unsound in character or quality" is from late 14c.; the weakened slang sense of "bad" is recorded by 1880.
Rotten apple is from a saying traced back to at least 1528: "For one rotten apple lytell and lytell putrifieth an whole heape." The Rotten Row in London and elsewhere probably is from a different word, but one of uncertain origin. Rotten-hearted is attested by late 14c.
word-forming element denoting action, quality, or state, attached to an adjective or past participle to form an abstract noun, from Old English -nes(s), from Proto-Germanic *in-assu- (cognates: Old Saxon -nissi, Middle Dutch -nisse, Dutch -nis, Old High German -nissa, German -nis, Gothic -inassus), from *-in-, originally belonging to the noun stem, + *-assu-, abstract noun suffix, probably from the same root as Latin -tudo (see -tude).
<a href="https://www.etymonline.com/word/rottenness">Etymology of rottenness by etymonline</a>
Harper, D. (n.d.). Etymology of rottenness. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/rottenness