Skip to main content

Visualize metamorphic test cases from gemtest

Project description

gemtest-webapp

The gemtest-webapp extends the gemtest framework by a web application that allows you to inspect and analyze your gemtest test metamorphic test runs. It features a tabular test report and a metamorphic test case detail view where one can examine all artifacts of a single executed metamorphic test case.

First, run a gemtest test suite with the --html-report flag:

$ pytest --html-report

Then, install gemtest-webapp via pip install gemtest-webapp and run it with the path to the gemtest_results folder created by a gemtest pytest run. Usually, this folder is created in the directory from which pytest was executed.

$ gemtest-webapp --results-dir gemtest_results/

Custom Visualizers

If the input or output of the system under test you are testing is not nicely presentable by a string, one can create a visualizer function visualaizing input and output on a static html page. For this, the system_under_test decorator can take functions as optional arguments, such as:

@gmt.system_under_test(
    visualize_input=visualizer.visualize_input,
    visualize_output=visualizer.visualize_output
)

The visualize_input function returns a string that is then embedded in the HTML:

def visualize_input(self, sut_input: Any, **kwargs) -> str:
        mtc = kwargs["mtc"]
        index = kwargs["index"]
        run_id = kwargs["run_id"]
        position = kwargs["position"]

        name = f"{mtc.report.sut_name}." \
               f"{mtc.report.mr_name}." \
               f"{mtc.report.mtc_name}." \
               f"{position}_{index}.png"

        image = (self.transform(sut_input).clone() * 255).view(96, 96)
        plt.clf()
        plt.imshow(image, cmap="gray")
        plt.axis("off")
        return self.savefig(self.image_folder, name, run_id)

Webapp

In the html-report, displayed by the gemtest-webapp, one can see the information of all passed, failed, and skipped test cases as well as filter by metamorphic relation, system under test, and test verdict.

MTC HTML Report

MTC Detail View

When clicking on the link/name of a specific metamorphic test case, the metamorphic test case detail view opens. It visualizes the inputs and outputs of the system under test if a custom visualizer is passed. This makes investigating why one's test case passed or failed faster and more intuitive.

MTC Detail View

Citation

If you find the gemtest or gemtest-webapp framework useful in your research or projects, please consider citing it:

@inproceedings{speth2025,
    author = {Speth, Simon and Pretschner, Alexander},
    title = {{GeMTest: A General Metamorphic Testing Framework}},
    booktitle = "Proceedings of the 47th International Conference on Software Engineering, (ICSE-Companion)",
    pages = {1--4},
    address = {Ottawa, ON, Canada},
    year = {2025},
}

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemtest_webapp-1.0.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemtest_webapp-1.0.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file gemtest_webapp-1.0.1.tar.gz.

File metadata

  • Download URL: gemtest_webapp-1.0.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/5.4.0-186-generic

File hashes

Hashes for gemtest_webapp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2f34e912f73d89bad0943703fdfa9ee0f7e233361cf8e58a228e1084a43c2a0b
MD5 0852a219d0a4b84f482ffbef7b6e038a
BLAKE2b-256 5d3f4add6287da2ed9787636eb99310fe7134245918a6fec1b0c40e496c24a39

See more details on using hashes here.

File details

Details for the file gemtest_webapp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gemtest_webapp-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/5.4.0-186-generic

File hashes

Hashes for gemtest_webapp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1662ae4c078cc62343810146fc8e5adad9726156e8db97009cae7fab6508b25a
MD5 e491537fbaa32a40a76fdfa9e0509b4c
BLAKE2b-256 6ac0039711d8496beace8786def3ec74680d2e1f8db196223468551e77e929b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page