A method and apparatus for generating a test stream wherein tests of
digital TV software at various levels and various digital broadcast
standards can be supported. The apparatus includes a data generator
module for generating test data by referring to a database based on
demands of a user, a data writer module for fetching the test data
generated by the data generator module and writing the fetched test data
into a text or XML data, a data transformation module for transforming
the written text or XML data into a transport stream, and a database in
which information needed for the modules to perform their own functions
is stored and from which the stored information is fetched. The method of
invention may similarly follow the functions of the apparatus.