Download TestStudio: An environment for automatic test generation based on

Transcript
TestStudio – Diploma project
get the system information. Then it sets the test scope, by first including all clusters, classes
and features and then selecting only the ones specified by the user through the files, if any. It
sets the global stress level and the values used for basic types to the defaults. It also sets the
level of assertion checking and the testing order to the default values. Finally, it creates an
instance of class TS_XML_GENERATOR and calls its save_project routine, which will
write the project information to a .tsp file.
Class TS_CL_TEST_GENERATOR contains the functionality for generating and
compiling the test code. Its most important routine is generate_compile_test. It uses an
instance of class TS_XML_READER to read in the project information from the project file,
then it calls the generate_test procedure on an instance of class
TS_TG_ROOT_GENERATOR, which will generate and compile the test code.
The main routine of class TS_CL_TEST_RUNNER is run_test, which launches the
execution
of
the
“generated_test.exe”
file
in
the
directory
“generated_test_root\EIFGEN\F_code”.
Class TS_CL_RESULT_DISPLAYER contains the functionality for creating HTML files
for the test results and displaying them in a browser. Its main routine is get_test_results,
which uses an object of class TS_CSV_READER and calls its get_test_results function to
read the results from the CSV file. If an error occurs while reading the results, it prints a
message; otherwise it creates an object of TS_HTML_GENERATOR and calls its
generate_html routine to create the HTML files.
6.4. STORING TEST CONFIGURATIONS
We must save all data contained in a project (test scope, data and options, and projectrelated information) to reuse it again later. We decided to save this information in XML
format, as a single file (with the “.tsp” extension, which stands for TestStudio Project). Below
is an example of such a file, for a project called “integer_ref_test”, which tests some of the
features of class INTEGER_REF.
<?xml version="1.0" encoding="ISO8859-1" ?>
- <project_settings>
<project_name>integer_ref_test</project_name>
<project_dir>D:\Testing\projects\integer_ref_test</project_dir>
<ace_file>D:\Testing\test_libraries\librarybase.ace</ace_file>
- <test_scope>
- <cluster_selection>
<cluster>kernel</cluster>
</cluster_selection>
- <class_selection>
- <cluster>
<name>kernel</name>
- <classes>
<class_name>INTEGER_REF</class_name>
</classes>
</cluster>
</class_selection>
- <feature_selection>
- <class>
<name>INTEGER_REF</name>
34