1. A method for optimal ordering of tests in a set of tests, the method comprising: (a) providing a set of tests X, wherein each x i ε X includes the marginal reject probability r i that test x i rejects and the cost t i of executing test x i , wherein said tests x i ε X are statistically independent; wherein at least a first test x i ε X has an ordering constraint with respect to at least a second test x j ε X; and wherein the only type of ordering constraints allowed obey a series-parallel structure; (b) providing a partial order, specified as a read-once series-parallel structure expression (SPE) having a lexical derivation tree structure, wherein the internal nodes of said tree are labeled either with a “Series” constructor S or with a “Parallel” constructor P; (c) processing said set of tests X thereby determining if said SPE contains a single test x, being a single leaf; (d) when said SPE contains a single leaf, computing the quality value for each test x i and returning test x i and said computed quality; (e) recursively processing said method for optimal ordering of tests in a set of tests X(C), where C ε CC, CC denotes the children of R and R is the root of said SPE; (f) when R is a P constructor, processing said tests X(C) with a merging process; (g) when R is an S constructor, processing said tests X(C) with a conglomerating process; and (h) scheduling said tests according to tests x i in resulting X.