Interim submission for parts 05,06,07 done

This commit is contained in:
Claudio Maggioni 2023-12-09 18:27:49 +01:00
parent 6bb60c3323
commit eadbd8f14a

View file

@ -6,7 +6,8 @@ This project has the goal of writing a search based automated test generator for
It is part of the Knowledge Search & Extraction - 2023 course from the Università della Svizzera italiana. It is part of the Knowledge Search & Extraction - 2023 course from the Università della Svizzera italiana.
In this repository, you can find the following files: In this repository, you can find the following files:
- benchmark folder: which contains the benchmark of functions under test to be instrumented
- `benchmark/` folder: which contains the benchmark of functions under test to be instrumented
Note: Feel free to modify this file according to the project's necessities. Note: Feel free to modify this file according to the project's necessities.
@ -19,3 +20,31 @@ python3 -m venv env
source env/bin/activate source env/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
``` ```
## Instrumentation (Part 1)
To generate the instrumented code for all the files in the benchmark run the command:
```shell
python3 ./instrument.py
```
The generated files are created in the directory `instrumented`. Each file name matches the file name of the
corresponding source file in `benchmark`.
## Test case generation (Part 2 and Part 3)
To generate test cases for all files in the benchmark run the command:
```shell
python3 ./genetic.py
```
The test suite is created in the directory `tests`. One test class is generated for each function defined in the
`benchmark` package. Run the command with the `-h` options for more details on partial generation.
The test suite can be then executed over the benchmark code with the command:
```shell
python3 -m unittest discover tests
```