OpenStax Anatomy and Physiology
The testes are located in a skin-covered, highly pigmented, muscular sack called the scrotum that extends from the body behind the penis. This location is important in sperm production, which occurs within the testes, and proceeds more efficiently when the testes are kept 2 to 4°C below core body temperature.
The dartos muscle makes up the subcutaneous muscle layer of the scrotum. It continues internally to make up the scrotal septum, a wall that divides the scrotum into two compartments, each housing one testis. Descending from the internal oblique muscle of the abdominal wall are the two cremaster muscles, which cover each testis like a muscular net. By contracting simultaneously, the dartos and cremaster muscles can elevate the testes in cold weather (or water), moving the testes closer to the body and decreasing the surface area of the scrotum to retain heat. Alternatively, as the environmental temperature increases, the scrotum relaxes, moving the testes farther from the body core and increasing scrotal surface area, which promotes heat loss. Externally, the scrotum has a raised medial thickening on the surface called the raphae.
Betts, J. G., Young, K. A., Wise, J. A., Johnson, E., Poe, B., Kruse, D. H., … DeSaix, P. (n.d.). Anatomy and Physiology. Houston, Texas: OpenStax. Access for free at: https://openstax.org/details/books/anatomy-and-physiology