The invention discloses a method, a device and a
system for converting a testing and test control notation version 3 (TTCN-3) script into a
Java source code so as to compile the TTCN-3 script. According to the method, a translator of the TTCN-3 script is constructed, analyzes and verifies a
test object file, and then translates the TTCN-3 script into a
Java file according to predefined translation rules. A
Java runtime support
library is constructed according to the translation rules of the translator, supports the foundation classes quoted in a translation scheme, and completes the execution of the code generated by translation and the recording of the execution results. The complete Java
source code in accordance with a TTCN-3 semanteme can be acquired through the integration of the code translated by the translator and the code of the runtime support
library. By the method, the process of the design of an interlanguage by a
compiler and the optimization of the
object code is eliminated; and moreover, the method is simple and convenient to implement, and allows self-customization of the grammar range of translation.