1. A method for testing a USB (universal serial bus) device comprising: receiving a USB packet trace output from a USB host, at a USB packet trace converting apparatus; generating at least one token corresponding to the USB packet trace received from the USB host; determining a syntax tree corresponding to the at least one token; and generating a host code for a USB host model corresponding to the syntax tree.