Larger testes are considered the quintessential adaptation to sperm competition. However, the strong focus on testis size in evolutionary research risks ignoring other potentially adaptive features of testicular function, many of which will also be shaped by post-mating sexual selection. Here we advocate a more integrated research programme that simultaneously takes into account the developmental machinery of spermatogenesis and the various selection pressures that act on this machinery and its products. The testis is a complex organ, and so we begin by outlining how we can think about the evolution of testicular function both in terms of the composition and spatial organisation of the testis ('testicular histology'), as well as in terms of the logical organisation of cell division during spermatogenesis ('testicular architecture'). We then apply these concepts to ask which aspects of testicular function we can expect to be shaped by post-mating sexual selection. We first assess the impact of selection on those traits most strongly associated with sperm competition, namely the number and kind of sperm produced. A broad range of studies now support our contention that post-mating sexual selection affects many aspects of testicular function besides gross testis size, for example, to maximise spermatogenic efficiency or to enable the production of particular sperm morphologies. We then broaden our focus to ask how testicular function is affected by fluctuation in sperm demand. Such fluctuation can occur over an individual's lifetime (for example due to seasonality in reproduction) and may select for particular types of testicular histology and architecture depending on the particular reproductive ecology of the species in question. Fluctuation in sperm demand also occurs over evolutionary time, due to shifts in the mating system, and this may have various consequences for testicular function, for example on rates of proliferation-induced mutation and for dealing with intragenomic conflict. We end by suggesting additional approaches that could be applied to study testicular function, and conclude that simultaneously considering the machinery, products and scheduling of spermatogenesis will be crucial as we seek to understand more fully the evolution of this most fundamental of male reproductive traits.