The onion test is a way of assessing the validity of an argument for a functional role for junk DNA. It relates to the paradox that would emerge if the majority of eukaryotic non-coding DNA were assumed to be functional and the difficulty of reconciling that assumption with the diversity in genome sizes among species. The term "onion test" was originally proposed informally in a blog post by T. Ryan Gregory in order to help clarify the debate about junk DNA. The term has been mentioned in newspapers and online media, scientific journal articles, and a textbook. The test is defined as:  The onion test is a simple reality check for anyone who thinks they have come up with a universal function for junk DNA. Whatever your proposed function, ask yourself this question: Can I explain why an onion needs about five times more non-coding DNA for this function than a human? Onions and their relatives vary dramatically in their genome sizes, without changing their ploidy, and this gives an exceptionally valuable window on the genomic expansion junk DNA. Since the onion (Allium cepa) is a diploid organism having a haploid genome size of 15.9 Gb, it has 4.9x as much DNA as does a human genome (3.2 Gb). Other species in the genus Allium vary hugely in DNA content without changing their ploidy. Allium schoenoprasum (chives) for example has a haploid genome size of 7.5 Gb, less than half that of onions, yet Allium ursinum (wild garlic) has a haploid genome size of 30.9 Gb, nearly twice (1.94x) that of onion and over four times (4.1x) that of chives. This extreme size variation between closely related species in the genus Allium is also part of the extended onion test rationale as originally defined: Further, if you think perhaps onions are somehow special, consider that members of the genus Allium range in genome size from 7 pg to 31.5 pg. So why can A. altyncolicum make do with one fifth as much regulation, structural maintenance, protection against mutagens, or [insert preferred universal function] as A. ursinum? Some researchers argue that the onion test is related to wider issues involving the C-value paradox and is only valid if one can justify the presumption that genome size has no bearing on organismal physiology. According to Larry Moran, the onion test is not an argument for junk DNA, but an approach to assessing possible functional explanations for non-coding DNA. According to him, it asks why allium species need so much more of that proposed function than do humans, and why so much more (or less) than other closely related species of allium and does not address the variation in genome size (C-value) among organisms itself.
 
According to Jonathan McLatchie, the onion test is only valid if one can justify the presumption that genome size has no bearing on organismal physiology. Long sequences of repetitive DNA can be highly relevant to an organism and can contribute to transcription delays and developmental timing mechanisms for an organism. Furthermore, he argues that there is a positive correlation between genome size and cell volume for unicellular eukaryotes like plants and protozoa and so the larger amount of DNA thus provides a selective advantage by contributing to the skeleton and volume of the nucleus of these cells. Larry Moran who was actually addressed in McLatchie's post extensively replied : 
[the onion test is] designed as a thought experiment to test a hypothesis about the possible function of large amounts of noncoding DNA. If you think you have an explanation for why most of the human genome has a function then you should explain how that accounts for the genomes of onions. Ryan Gregory knew that most so-called explanations look very silly when you try using them to account for genome size in onion species. Ewan Birney (then head of the ENCODE Project) explained the difference as a product of polyploidy,[better source needed] and therefore not relevant to the discussion of humans. 
(re: onions etc); polyploidy and letting your repeats "go crazy" (bad piRNAs anyone) mean your genome can be v. big 
Similar claims were made by John Mattick in an article defending the ENCODE project against arguments disputing the main finding of the project: 
The other substantive argument that bears on the issue, alluded to in the quotes that preface the Graur et al. article, and more explicitly discussed by Doolittle, is the so-called ‘C-value enigma’ , which refers to the fact that some organisms (like some amoebae, onions, some arthropods, and amphibians) have much more DNA per cell than humans, but cannot possibly be more developmentally or cognitively complex, implying that eukaryotic genomes can and do carry varying amounts of unnecessary baggage. That may be so, but the extent of such baggage in humans is unknown. However, where data is available, these upward exceptions appear to be due to polyploidy and/or varying transposon loads (of uncertain biological relevance), rather than an absolute increase in genetic complexity. Moreover, there is a broadly consistent rise in the amount of non-protein-coding intergenic and intronic DNA with developmental complexity, a relationship that proves nothing but which suggests an association that can only be falsified by downward exceptions, of which there are none known. Freeling et al. proposed a genome balance hypothesis that presumably accounts for the C-Value Paradox and passes the Onion Test.