Patent ID: 8028276

Claim:
A method for generating a test file, comprising: receiving annotated test code comprising a first testing annotation, a second testing annotation, a class, and a method comprising test case code, wherein the first testing annotation defines an attribute value for an attribute of a test group, wherein the second testing annotation defines an attribute value for an attribute of a test case, and wherein the annotated test code is written using an object oriented programming language; parsing, by one or more computer processors, the annotated test code to create a data structure representation of the annotated test code; generating, by the one or more computer processors and using the data structure representation, test code in a markup language according to a plurality of testing definitions to obtain generated test code, wherein generating the test code comprises: identifying the class in the data structure representation; determining, by an existence of the first testing annotation in the class, that the class is a test group class; obtaining a template for the test group class in response to determining that the class is the test group class; extracting, from the data structure representation, the attribute value for the attribute of the test group in the first testing annotation; identifying, from the first testing annotation, a markup language tag defining a first field in the template; populating a value of the first field in the template with the attribute value for the attribute of the test group; identifying the method in the data structure representation; determining, by an existence of the second testing annotation in the class, that the method corresponds to the test case; and creating, using the template, the test case in response to determining that the method corresponds to the test case by: extracting, from the data structure representation, the attribute value for the attribute of the test case in the second testing annotation; identifying, from the second testing annotation, a markup language tag defining a second field in the template; populating a value of the second field in the template with the attribute value for the attribute of the test case; and storing the test case code in a body of the test case; and storing the generated test code in the test file.