# Improving unit tests

**URL:** <https://swi-prolog.discourse.group/t/improving-unit-tests/6091>\
**Category:** Request For Comments\
**Created:** [January 13, 2023, 3:32pm UTC](https://swi-prolog.discourse.group/t/improving-unit-tests/6091 "2023-01-13T15:32:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [January 14, 2023, 12:22pm UTC](https://swi-prolog.discourse.group/t/improving-unit-tests/6091/5 "2023-01-14T12:22:10Z")

</div>

One thought that might be nice is to persist the output results into a Prolog file (thinking [library(persistency)](https://www.swi-prolog.org/pldoc/man?section=persistency)) so that the results can be loaded and queried directly. This would be in addition to a formal format as proposed.

The nice think about having a persisted Prolog file is that it could include info that is not part of a standard format which can also be queried with Prolog.

* * *

If I understand the proposal correctly then one of the side benefits of a standard output format would be the ability to use a third party GUI that understands the format to control the running of the tests. Note: Image only to get an idea of what such a GUI interface would look like, not as a recommendation for the particular unit framework.

![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/0/08939f415ed44873253ad008235c54cb82a29df0.png)

(Image from Wikipedia [CsUnit](https://en.wikipedia.org/wiki/CsUnit))

* * *

The only other [unit testing framework](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks) I have had extensive experience with in the past is [xUnit.net](https://xunit.net/) which derived from [xUnit](https://en.wikipedia.org/wiki/XUnit). I used it often when developing F# code and it made running test enjoyable, writing test were still a pain. A side benefit of the GUI was also seeing code coverage and grouping test into categories (think labels) such as new tests for a release, bug, enhancement, … .

---

_[View the full topic](https://swi-prolog.discourse.group/t/improving-unit-tests/6091)._
