We extend the classical Neyman-Pearson theory for testing composite hypothe
ses versus composite alternatives, using a convex duality approach, first e
mployed by Witting. Results of Aubin and Ekeland from non-smooth convex ana
lysis are used along with a theorem of Komlos, in order to establish the ex
istence of a max-min optimal test in considerable generality, and to invest
igate its properties. The theory is illustrated on representative examples
involving Gaussian measures on Euclidean and Wiener space.