The invention discloses a testing logic generation method. According to the testing logic generation method, a parsing engine and an execution engine are designed based on configure languages, logic control content and module configuration content are separated, modules executing specific motions in testing software and the entire testing logic are uniformly described by adopting the configure languages, and therefore a user can define motions and a motion sequence needed to be completed by target logic through an interface provided by an application program and according to the described and separated modules having specific testing functions in the testing software. When used for testing electronic products with different functions, the testing logic generation method enables the user to freely define test functions and a testing sequence conveniently, and the user does not need to specifically write a program with certain functions. Meanwhile, the invention further discloses a testing logic generation device. By means of the testing logic generation device, the user does not need to specifically write the testing program when facing the electric productions with different functions, and the testing logic generation device has low requirements for professional level of the user, and is strong in applicability.