Among animals, viviparity is development of the embryo inside the body of the parent. This is opposed to oviparity which is a reproductive mode in which females lay developing eggs that complete their development and hatch externally from the mother. 
The term 'viviparity' and its adjective form 'viviparous' derive from the Latin vivus meaning "living" and pario meaning "give birth to". 
Five modes of reproduction have been differentiated in animals  based on relations between zygote and parents. The five include two nonviviparous modes: ovuliparity, with external fertilisation, and oviparity, with internal fertilisation. In the latter, the female lays zygotes as eggs with a large yolk; this occurs in all birds, most reptiles, and some fishes.  These modes are distinguished from viviparity, which covers all the modes that result in live birth:
- Histotrophic viviparity: the zygotes develop in the female's oviducts, but find their nutrients by oophagy or adelphophagy ( intra-uterine cannibalism of eggs or sibling embryos in some sharks or in the black salamander Salamandra atra).
- Hemotrophic viviparity: nutrients are provided by the female, often through some form of placenta. In the frog Gastrotheca ovifera, embryos are fed by the mother through specialized gills. The skink Pseudemoia entrecasteauxii and most mammals exhibit a hemotrophic viviparity.
- Placental viviparity is arguably the most highly developed form of viviparity. Placental mammals, including humans, are the best-known example, but adaptations in some other animals also have incorporated this principle or close analogies. Other examples include some species of scorpions  and cockroaches,   certain genera of sharks and snakes, and velvet worms.
- Ovoviviparity, a less developed form of viviparity, occurs in most vipers, and in most live-bearing bony fishes ( Poeciliidae). However, the term is poorly and inconsistently defined, and may be obsolete.  This term has been redefined and more commonly referred to as oviparous egg retention or prolonged egg retention. 
At least some transport of nutrients from mother to embryo appears to be common to all viviparous species, but those with fully developed placentas such as found in the Theria, some skinks, and some fish can rely on the placenta for transfer of all necessary nutrients to the offspring and for removal of all the metabolic wastes as well once it has been fully established during the early phases of a pregnancy. In such species, there is direct, intimate contact between maternal and embryonic tissue, though there also is a placental barrier to control or prevent uncontrolled exchange and the transfer of pathogens.
In at least one species of skink in the large genus Trachylepis, placental transport accounts for nearly all of the provisioning of nutrients to the embryos before birth. In the uterus, the eggs are very small, about 1 mm in diameter, with very little yolk and very thin shells. The shell membrane is vestigial and transient; its disintegration permits the absorption of nutrients from uterine secretions. The embryo then produces invasive chorionic tissues that grow between the cells of the uterine lining till they can absorb nutrients from maternal blood vessels. As it penetrates the lining, the embryonic tissue grows aggressively till it forms sheets of tissue beneath the uterine epithelium. They eventually strip it away and replace it, making direct contact with maternal capillaries.  In several respects, the phenomenon is of considerable importance in theoretical zoology. Blackburn & Flemming (2011)  remark that such an endotheliochorial placenta is fundamentally different from that of any known viviparous reptile. 
There is no relationship between sex-determining mechanisms and whether a species bears live young or lays eggs. Temperature-dependent sex determination, which cannot function in an aquatic environment, is seen only in terrestrial viviparous reptiles. Therefore, marine viviparous species, including sea snakes and, it now appears, the mosasaurs, ichthyosaurs, and plesiosaurs of the Cretaceous, use genotypic sex determination (sex chromosomes), much as birds and mammals do.  Genotypic sex determination is also found in most reptiles, including many viviparous ones (such as Pseudemoia entrecasteauxii), whilst temperature dependent sex determination is found in some viviparous species, such as the montane water skink ( Eulamprus tympanum). 
In general, viviparity and matrotrophy are believed to have evolved from an ancestral condition of oviparity and lecithotrophy (nutrients supplied through the yolk).  One traditional hypothesis concerning the sequence of evolutionary steps leading to viviparity is a linear model. According to such a model, provided that fertilization was internal, the egg might have been retained for progressively longer periods in the reproductive tract of the mother. Through continued generations of egg retention, viviparous lecithotrophy may have gradually developed; in other words the entire development of the embryo, though still with nutrients provided by the yolk, occurred inside the mother's reproductive tract, after which she would give birth to the young as they hatched. The next evolutionary development would be incipient matrotrophy, in which yolk supplies are gradually reduced and are supplemented with nutrients from the mother's reproductive tract. 
In many ways, depending on the ecology and life strategy of the species, viviparity may be more strenuous and more physically and energetically taxing on the mother than oviparity. However, its numerous evolutionary origins imply that in some scenarios there must be worthwhile benefits to viviparous modes of reproduction; selective pressures have led to its convergent evolution more than 150 times among the vertebrates alone. 
There is no one mode of reproduction that is universally superior in selective terms, but in many circumstances viviparity of various forms offers good protection from parasites and predators and permits flexibility in dealing with problems of reliability and economy in adverse circumstances. Variations on the theme in biology are enormous, ranging from trophic eggs to resorption of partly developed embryos in hard times or when they are too numerous for the mother to bring to term, but among the most profoundly advantageous features of viviparity are various forms of physiological support and protection of the embryo, such as thermoregulation and osmoregulation.  Since the developing offspring remains within the mother's body, she becomes, in essence, a walking incubator, protecting the developing young from excessive heat, cold, drought, or flood. This offers powerful options for dealing with excessive changes in climate or when migration events expose populations to unfavourable temperatures or humidities. In squamate reptiles in particular, there is a correlation between high altitudes or latitudes, colder climates and the frequency of viviparity. The idea that the tendency to favour egg-retention selectively under cooler conditions arises from the thermoregulatory benefits, and that it consequently promotes the evolution of viviparity as an adaptation, is known as "the cold climate hypothesis". 
Through ancestral state reconstruction, scientists have shown that the evolution of viviparity to oviparity may have occurred a maximum of eight times in the genus Gerrhonotus of anguid lizards.  Advanced ancestral state reconstruction was used to more accurately prove that the reverse evolution of viviparity to oviparity is true.  In the analysis, the authors use a maximum likelihood tree to reveal that parity mode is a labile trait in the Squamata order.  They also further show through analysis that viviparity is also strongly associated with cooler climates which suggests the previously stated "cold-climate hypothesis" is true. 
However, others directly refute this notion that parity is a labile trait.  In their critique, they show that ancestral state reconstruction analyses are reliant on the underlying phylogenetic information provided.  The use of a maximum likelihood tree which is vulnerable to phylogenetic error may cause an artificial inflation of the number of viviparity to oviparity occurrences.  Additionally, they state that the previous study does not take into account the morphological and behavioral modifications that would have to occur for reversion to occur.  Some of these modifications would be the redevelopment of uterine glands to synthesize and secrete shell fibers, the restoration of the careful timing of oviposition due to eggshell thickness, etc.  The degradation and loss of function of oviparous genes during viviparous evolution suggests that these genes would have to re-evolve in order for the reversion of this evolution to occur.  Since this re-evolution is near impossible due to the complexity of oviparous reproductive mode, the simple labile characteristic of parity cannot be sufficiently supported. 
- Blackburn, D.G. (1999). "Viviparity and oviparity: Evolution and reproductive strategies". Encyclopedia of Reproduction. Academic Press. 4: 994–1003.
- Schuett, G.W. (2002). Biology of the Vipers. Eagle Mountain, UT: Eagle Mountain Publications.
- Lodé, Thierry (2001). Les stratégies de reproduction des animaux [Reproduction strategies in the animal kingdom] (in French). Paris, FR: Eds Dunod Sciences.
- Blackburn, D.G. (2000). Classification of the Reproductive Patterns of Amniotes. Herpetological Monographs. pp. 371–377.
- Capinera, John L. (2008). Encyclopedia of Entomology. Springer Reference. p. 3311. ISBN 9781402062421 – via Google Books.
- Costa, James T. (2006). The Other Insect Societies. Belknap Press. p. 151.
- Newbern, E. (26 January 2016). "Mom Genes: This cockroach species' live births are in its DNA". LiveScience. Purch. Retrieved 26 January 2016.
- Blackburn, D.G.; Flemming, A.F. (2011). "Invasive implantation and intimate placental associations in a placentotrophic African lizard, Trachylepis ivensi (scincidae)". Journal of Morphology. 273 (2): 37–159. doi: 10.1002/jmor.11011. PMID 21956253. S2CID 5191828.
- Organ, Chris L.; et al. (2009). "Genotypic sex determination enabled adaptive radiations of extinct marine reptiles". Nature. 461 (7262): 389–392. doi: 10.1038/nature08350. PMID 19759619. S2CID 351047.
- Robert, Kylie A.; Thompson, Michael B. (2001). "Sex determination: Viviparous lizard selects sex of embryos". Nature. 412 (6848): 698–699. doi: 10.1038/35089135. PMID 11507628. S2CID 4420854.
- Griffith, OW; Blackburn, DG; Brandley, MC; Van Dyke, JU; Whittington, CW; Thompson, M.B. (2015). "Ancestral state reconstructions require biological evidence to test evolutionary hypotheses: A case study examining the evolution of reproductive mode in squamate reptiles". J Exp Zool B. 324 (6): 493–503. doi: 10.1002/jez.b.22614. PMID 25732809.
- Blackburn, D. G. (1992). "Convergent evolution of viviparity, matrotrophy, and specializations for fetal nutrition in reptiles and other vertebrates". Am. Zool. 32 (2): 313–321. doi: 10.1093/icb/32.2.313.
- Blackburn, Daniel G (2014). "Evolution of vertebrate viviparity and specializations for fetal nutrition: A quantitative and qualitative analysis". Journal of Morphology. 276 (8): 961–990. doi: 10.1002/jmor.20272. PMID 24652663. S2CID 549574.
- Lambert, S. M.; Wiens, J. J. (2013). "Evolution of viviparity: a phylogenetic test of the cold-climate hypothesis in phrynosomatid lizards". Evolution. 67 (9): 2614–2630. doi: 10.1111/evo.12130. PMID 24033171. S2CID 3890276.
- Fraipont, M.D.; Clobert, J.; Barbault, R. (1996). "The evolution of oviparity with egg guarding and viviparity in lizards and snakes: A phylogenetic analysis". Evolution. 50 (1): 391–400. doi: 10.1111/j.1558-5646.1996.tb04501.x. PMID 28568867. S2CID 205780092.
- Pyron, R. A.; Burbrink, F. T. (2013). "Early origin of viviparity and multiple reversions to oviparity in squamate reptiles". Ecology Letters. 17 (1): 13–21. doi: 10.1111/ele.12168. PMID 23953272.
- Griffith, O.W.; Blackburn, D.G.; Brandley, M.C.; Dyke, J.U.V.; Whittington, C.M.; Thompson, M.B. (2015). "Ancestral state reconstructions require biological evidence to test evolutionary hypotheses: A case study examining the evolution of reproductive mode in squamate reptiles". Journal of Experimental Zoology Part B: Molecular and Developmental Evolution. 324 (6): 493–503. doi: 10.1002/jez.b.22614. PMID 25732809.
- Wang, Y.; Evans, S.E. (2011). "A gravid lizard from the Cretaceous of China and the early history of squamate viviparity". Naturwissenschaften. 98 (9): 739–743. doi: 10.1007/s00114-011-0820-1. PMID 21766177. S2CID 8017857.