Modern optimisation algorithms are often metaheuristic, and they are very promising in solving NP-hard optimisation problems. In this paper, we show how to use the recently developed firefly algorithm to solve non-linear design problems. For the standard pressure vessel design optimisation, the optimal solution found by FA is far better than the best solution obtained previously in the literature. In addition, we also propose a few new test functions with either singularity or stochastic components but with known global optimality and thus they can be used to validate new optimisation algorithms. Possible topics for further research are also discussed.