One of the major costs in a software project is the construction of test-data. This paper outlines a generalised test-case data generation framework based on optimisation techniques. This framework can incorporate a number of testing criteria unifying both functional and non-function testing. Application of the optimisation based approach are given for worst-case execution time, specification conformance, structural coverage and exception condition testing. The results of a number of small example case studies are presented and show the efficacy of the approach.