Disclosed in the present invention are a device for automatically generating test cases for embedded software and a method thereof, which belong to the technical field of software testing. The device comprises a symbolic execution kernel module, a path selection module, a solver, a debugger, an actual execution kernel module and a debugging agent module. Tested software and test cases are uploaded to an embedded system from a host system through the debugger and debugging agents. The actual execution kernel module starts the tested software. Through the debugger, the symbolic execution kernel module obtains the running information of the tested software. When the tested software operates a symbolic source, the symbolic execution kernel module marks the symbolic source, tracks symbolic propagation, generates path conditions, sends the path conditions to the path selection module and then sends the modified path conditions to the solver. If there is a solution, the corresponding test cases are generated. The present invention enables automatic generation of test cases for embedded software, and can process commercial software without the source codes of the tested software.
展开▼