Let IPA(c) denote the family of integer programs of the form min cx|Ax=b, x∈Zn obtained by varying the right hand side vector B but keeping a and c fixed. A test set for IPA(c) is a set of vectors Zn such that for each nonoptimal solution α to a program in this family, there is at least one element g in this set such that α–g has an improved cost value as compared with α. We describe a unique minimal test set for this family called the reduced Grobner basis of IPA(c). An algorithm for its construction is presented which call a geometric Buchberger algorithm for integer programming and we show how an integer program can be solved using this test set. The reduced Grobner basis is then compared with some other known test sets from the literature. We also indicate an easy procedure to construct test sets with respect to all cost functions for a matrix A∈Z(n–2)×n of full row rank.