The testis (from the Greek word orchis) is the male gland important for both reproductive (exocrine) and endocrine functions.  Initially, it begins as an undifferentiated gonad in the retroperitoneal area. Transcription of the SRY gene (testis-determining factor region) on the Y chromosome ultimately leads to sex differentiation. Without the SRY gene, the gonad would develop into an ovary. As the fetus develops, the functioning testis produces the male hormone testosterone to allow development of male genitalia. Over the last 3 months' gestation, the testis must course its way down from its original retroperitoneal position to its final destination in the scrotum. During its journey, it must pass through the peritoneum, abdominal wall via the inguinal canal, and into the scrotal pouch.
An image depicting the testes and epididymis can be seen below.
The testis is a paired, ovoid male reproductive organ that sits in the scrotum, separated from its mate by a scrotal septum. Described by some as being shaped and sized like a large olive or small plum, the average volume of the adult testis is approximately 25 mL. Typically, it measures 3.5-5 cm in length by 2.5-3 cm in both width by 3 cm in depth (anteroposterior diameter). 
Smooth to palpation, the testis sits obliquely with its long axis mostly vertical with a slight anterior and lateral slant to the superior pole. Superiorly, it is suspended by the spermatic cord, with the left testis often sitting lower than the right testis. Inferiorly, the testis is anchored to the scrotum by the scrotal ligament, a remnant of the gubernaculum. 
The tunica vaginalis testis (a remnant of the processus vaginalis) envelopes the testis in a double layer, except at the superior and posterior borders, where the spermatic cord and epididymis adhere to the testes. 
The visceral layer of the tunica vaginalis testis is closely applied to the testis, epididymis, and ductus deferens. On the posterolateral surface of the testis, this layer invests a slitlike recess between the body of the epididymis and the testis that is called the sinus of epididymis. 
The parietal layer of tunica vaginalis is adjacent to the internal spermatic fascia, is more extensive, and extends superiorly into the distal part of the spermatic cord.
Deep to the tunica vaginalis, the tunica albuginea is a tough, fibrous outer covering of the testis. On the posterior surface, it is reflected inwardly to form an incomplete vertical septum called the mediastinum testis.
The mediastinum testis extends from the superior to near the inferior portion of the gland. It narrows in width as it travels inferiorly. Anteriorly and laterally, numerous imperfect septa are given off, which radiate to the glands surface and are attached to the tunica albuginea. These divide the interior of the testis into numerous, cone-shaped spaces that have a wide base at the gland’s surface and narrow as they converge to the mediastinum. In these spaces, the numerous lobules of glandular structures (the minute but long and highly coiled seminiferous tubules) are housed. The mediastinum supports the ducts and vessels as they pass to and from the glandular substance. The seminiferous tubules are lined with germ cells that produce sperm and nutrient fluid. These tubules empty their contents into a network of anastomosing ducts, which ultimately empties into the epididymis.
The epididymis is a comma shaped, elongated structure composed of a single, fine tubular structure estimated up to 6 meters (approximately 20 feet) in length. This tube is highly convoluted and tightly compressed (average size of approximately 5 cm) to the point of appearing solid. Located on the posterior border of the testis, it is composed of 3 parts, including the head (caput), body (corpora), and tail (cauda). The epididymal head overhangs the upper pole of the testis, receives the seminal fluid from the ducts of the testis (which pierce the upper portion of the mediastinum), then allows the passage of the sperm into the distal portion of the epididymis. Due to its length, the epididymal duct allows space for storage and maturation of sperm. Progressively tapering in width, the narrow tail continues as the ductus deferens (vas deferens; see the image below).
The arterial supply to both testes is primarily from the testicular arteries, which arise from the anterolateral aspect of the abdominal aorta just inferior to the renal arteries. They travel retroperitoneally, cross over the ureters and the inferior parts of the external iliac arteries to pass through the deep inguinal ring to enter the inguinal canal and become one of the components of the spermatic cord. The testicular artery enters the testis through the posterior midportion. The testicular artery or one of its branches anastomoses with the artery of the ductus deferens.
Venous drainage from the testis and epididymis form a network of 8-12 veins, called the pampiniform venous plexus, lying anterior to the ductus deferens and surrounding the testicular artery in the spermatic cord. The veins converge superiorly, forming a testicular vein, after passing through the deep inguinal ring. The right testicular vein enters the inferior vena cava, and the left testicular vein drains into the left renal vein.
Lymphatic drainage of the testis follows the testicular vessels (in the spermatic cord) to the right and left lumbar (caval/aortic) and preaortic lymph nodes at the second lumbar level.
Autonomic innervations of the testis arise as the testicular plexus of nerves on the testicular artery, which contains vagal parasympathetic and visceral afferent fibers and sympathetic fibers from the T7 segment of the spinal cord.
The testis is composed of lobules of glandular tubules. These tubules are highly convoluted and held together by loose connective tissue with interspersed groups of “interstitial cells,” which contain Leydig cells. The individual tubule consists of a basement membrane formed by laminated connective tissue with numerous elastic fibers with flattened cells between the layers and covered by an external layer of flattened epithelioid cells. Within the basement membrane are epithelial cells arranged in several irregular layers but may be separated into germ cells at the periphery and varies cells of spermatogenesis up to mature sperm cells as they advance toward the lumen. Also, interspersed in the layer are Sertoli cells, which project inward from the basement to the lumen and provide support to the developing sperm cells.
In the apices of the lobules, the tubules are less convoluted and converge into 20-30 larger, straight ducts (tubuli recti). These ducts merge into anastomosing tubes in fibrous stroma, lined with flattened epithelium (rete testis). The tubes terminate into approximately 15 ducts that initially are straight in their course.
After piercing the tunica albuginea at the superior mediastinum, they enlarge and become increasingly convoluted. These convolutions are held together by fine areolar tissue and bands of fibrous tissue. They form a series of conical masses, the conic vasculosi. This series forms the head of the epididymis. These ducts are thicker and lined by ciliated columnar epithelium. Below this epithelium is muscular tissue arranged in a mostly circular fashion. As the tail of the epididymis merges with the ductus deferens, the microscopic anatomy demonstrates a thickened duct with increased muscular material, increased in diameter, and still lined with ciliated columnar epithelium.
Two vestigial embryonic structures of no known physiologic function are often found on the testis and epididymis, as follows:
The appendix testis is a pear-shaped structure that is the vesicular remnant of the cranial end of the paramesonephric (Mullerian) duct. This is the embryonic genital duct that in the female forms half the uterus. It is found approximately 92% of all testes. The typical location is at the superior testicular pole in the groove between the testis and the head of the epididymis.
The appendices of the epididymis are remnants of the cranial end of the mesonephric (wolffian) duct, the embryonic duct that in males forms part of the ductus deferens. This is located in approximately 23% of testes. Its location may vary, but it usually projects from the head of the epididymis.
In 6-7% of males, the epididymis is found on the anterior surface of the testis.
In a premature infant, the testis may not be fully descended. This process is usually complete by 9 months' gestation. Special attention should be paid to an undescended testis, and this should be closely followed. The testis may exit the superficial inguinal ring but slip down between the scrotum and thigh and come to rest in the perineum. This is known as perineal ectopia testis.
Androgen insensitivity may lead to testes being found in the labia majora of a chromosomal male 46 XY, but phenotypical female.
The testis begins as a retroperitoneal organ in the lumbar region. Its descent outside the abdominal cavity is imperative for normal testicular function and reproductive viability. By resting in the scrotum, the testis is kept at a temperature 2-3º C lower than the core body temperature. The countercurrent of blood flow with the venous plexus surrounding the testicular artery allows heat transfer to cool the blood flow. Further, the cremasteric reflex allows the testis to be elevated toward the body core to control testicular temperature.
Because of its intraabdominal origin, the testis have lymph drainage to the lumbar lymph nodes. Thus, infection of the epididymis or testicular carcinoma does not typically cause enlarged inguinal lymph nodes.
Cryptorchidism is important to recognize, not just because of sterility, but due to an increased incidence of testicular cancer in these males. Unless it is able to be surgically brought into the scrotum, where testicular surveillance may be performed, the undescended testis should be excised. Also, understanding the increased risk is extended to the contralateral testis as well is important. So, the individual should be instructed in careful, regular self-examinations.
Serous fluid may collect between the layers of the tunica vaginalis. This is termed hydrocele. This may be due to trauma, inflammation, or congenital due to persistent communication with the general peritoneal cavity.
Epididymitis is inflammation of the epididymis. It may be due to infectious process, commonly in men ages 19-35. In this age group, the treatment should cover gonorrhea and chlamydia. In young children and older men, E coli is the most common pathogens. Still, other causes include pathogens such as ureaplasma, Mycobacterium tuberculosis, and the drug amiodarone, which is commonly used for cardiac rate control.
Testicular torsion may occur if the testis twists on the suspending spermatic cord. This is a surgical emergency because the blood supply needs to be restored within 6 hours of initiation of symptoms. After 12 hours, the testis may be so badly damaged that it cannot be salvaged. The testis is fixed in the scrotum with suture to prevent recurrence, and the contralateral testis should be sutured in place as well. This is due to the increased incidence of testicular torsion recurrence.
Most acute presentations of scrotal pain and swelling can be attributed to epididymitis, testicular torsion, or torsion of a testicular appendage. In many cases, torsion of a testicular appendage, although a benign condition, may present identically to testicular torsion, a true urologic emergency. Ultrasound may be used for defining the problem, but clinical examination of a normal, nontender testis with the presence of a paratesticular nodule at the superior pole may point more to appendical torsion. Classically, a blue-dot appearance (blue dot sign) may be seen in the area of the injury, but this is only present in approximately 20% of cases.