Abstract. Formal methods are considered to be highly expensive. Therefore, they are currently applied almost only in high risk software development. In this paper, we show that formal techniques can be also efficiently used in standard large-scale applications. We focus on the generation of specifications which state the termination condition of for loops in Java code (expressed as so called Java Modeling Language decreases clauses). We demonstrate that with help of relatively simple techniques it is possible to successfully generate the clauses for almost 80% of the loops in a number of widely deployed applications. Moreover, it turns out that the remaining 20% cases contain loops which should be carefully reviewed by software quality assurance personnel. The results show that our technique might be helpful in spreading the usage of formal methods onto typical business software.