A computer-implemented method for testing a system, the tested system being a computer program, a hardware system, or an embedded system. In the method, using a static analysis, a first part of an execution structure for the system is examined to see if the system runs corresponding execution paths without errors when the first part of the execution structure is executed. If in the static analysis error-free execution is determined for the first part of the execution structure, the system is examined using a dynamic analysis which leaves out execution paths which correspond to the first part of the execution structure.