<blockquote>
<p><em>This is a Bisq Network proposal. Please familiarize yourself with the <a href="https://docs.bisq.network/proposals.html" rel="nofollow">submission and review process</a>.</em></p>
</blockquote>
<p>The whole Bisq project only features 25 test classes, the need for better test coverage is clear. In order to achieve a higher test coverage, we should agree on the used tools/technologies/frameworks for testing before the collection of test frameworks within Bisq gets out of hand.<br>
This goal of this proposal is to foster an understanding on which testing frameworks are available and finally, decide on a small set of tools/technologies/frameworks to be used in Bisq.</p>
<h1>Unit Testing Frameworks</h1>
<p>Unit testing frameworks are a convenient way of doing test-driven development when no GUI is involved. As these frameworks are quite mature, integration testing can be done as well. Below, a couple of hand-picked test metrics are discussed. Afterwards, unittest frameworks are evaluated against the metrics. Finally, conclusions are drawn.</p>
<h2>Test Metrics</h2>
<ul>
<li><strong>IDE integration</strong> Low effort test-driven development/local testing is only possible when a proper IDE integration exists.</li>
<li><strong>Gradle integration</strong> provide effortless automated testing</li>
<li><strong>Test classes in Bisq</strong> The number of existing test classes in the Bisq code as per 2019-02-15</li>
<li><strong>Parameterized Tests</strong> parameterized tests make it easy to get greater test coverage without having to duplicate code</li>
<li><strong>Test Dependencies</strong> Given Test2 depends on Test1 and Test1 fails, Test2 is skipped. Useful in automated testing as it keeps the testing load down in case of a failure. Useful in test design, as basic functionality does not have to be considered for special tests which results in less editing of test code to match altered features.</li>
</ul>
<p><em>your input here</em></p>
<h2>Comparison</h2>
<table>
<thead>
<tr>
<th></th>
<th>IDE integration</th>
<th>Gradle integration</th>
<th>Test classes in Bisq</th>
<th>Parameterized Tests</th>
<th>Test Dependencies</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://junit.org/junit4/" rel="nofollow">JUnit4</a></td>
<td>+</td>
<td>+</td>
<td>18</td>
<td>o</td>
<td>-</td>
</tr>
<tr>
<td><a href="https://junit.org/junit5/" rel="nofollow">JUnit5 "jupiter"</a></td>
<td>+</td>
<td>+</td>
<td>7 (only in monitor)</td>
<td>+</td>
<td>-</td>
</tr>
<tr>
<td><a href="https://testng.org/" rel="nofollow">TestNG</a></td>
<td>+</td>
<td>+</td>
<td>0</td>
<td>+</td>
<td>+</td>
</tr>
<tr>
<td><a href="http://spockframework.org" rel="nofollow">Spock</a></td>
<td>?</td>
<td>?</td>
<td>0</td>
<td>?</td>
<td>?</td>
</tr>
</tbody>
</table>
<p><em>your input here</em></p>
<h2>Conclusion</h2>
<p>JUnit4 is outdated. Spock, being a functional testing framework, seems the most powerful, yet, it is quite different to use than the classic testing frameworks. TestNG allows for resource saving automated tests, is, however, not supported by at least one GUI testing framework.</p>
<h1>GUI Testing</h1>
<p>Automated GUI testing is more delicate then simple unit testing. However, given Bisq uses JavaFX only, there are a few testing frameworks which integrate well with unit testing frameworks. Below, a couple of hand-picked test metrics are discussed. Afterwards, available frameworks are evaluated against the metrics. Please be aware, that only frameworks compatible with JavaFX are listed. Finally, conclusions are drawn.</p>
<h2>Test Metrics</h2>
<ul>
<li><strong>Supported UnitTest Frameworks</strong> Which unittest frameworks the GUI testing framework in question integrates with.</li>
</ul>
<p><em>your input here</em></p>
<h2>Comparison</h2>
<table>
<thead>
<tr>
<th></th>
<th>IDE integration</th>
<th>Gradle integration</th>
<th>Test classes in Bisq</th>
<th>Supported UnitTest frameworks</th>
<th>easy to use</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/TestFX/TestFX">TestFX</a></td>
<td>+</td>
<td>+</td>
<td>0</td>
<td>JUnit4, JUnit5, Spock</td>
<td>+</td>
</tr>
<tr>
<td><a href="http://wiki.netbeans.org/Jemmy" rel="nofollow">Jemmy</a></td>
<td>o</td>
<td>o</td>
<td>0</td>
<td>-</td>
<td>o</td>
</tr>
<tr>
<td><a href="https://github.com/renatoathaydes/Automaton">Automaton</a></td>
<td>?</td>
<td>?</td>
<td>?</td>
<td>?</td>
<td>?</td>
</tr>
</tbody>
</table>
<p><em>your input here</em></p>
<h2>Conclusion</h2>
<p>It looks like TestFX is the only option as of now. Jemmy does rely on a <code>void main(.)</code> for running the tests, Automaton seems pretty outdated (last release 2 year ago) and dead (last change 1 year ago).</p>
<h1>Overall Conclusion</h1>
<p>As of now, JUnit5 along with TestFX seems to be the winner.</p>
<h1>Aftermath</h1>
<p>Having decided on the testing frameworks, contributors can freely create tests. In the long run, efforts required for manual testing should be reduced while increasing test coverage and therefore, the quality of Bisq.</p>
<h1>Call for contribution</h1>
<p>I have started a sketch on how testing frameworks can be compared. I also filled in unit test frameworks as I have some experience with them. I, however, do not have any experience with GUI testing frameworks. If you can contribute something to this proposal, please do so! Thanks!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/proposals/issues/74">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AkpZtpvD7x-U9hGFJRqEmS9PVohelKvMks5vNsx-gaJpZM4a91Ar">mute the thread</a>.<img src="https://github.com/notifications/beacon/AkpZtkX_3YQhhk8bBLyLsMODxzQ9R2yzks5vNsx-gaJpZM4a91Ar.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/bisq-network/proposals","title":"bisq-network/proposals","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/bisq-network/proposals"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"[WIP] Finding a unified test framework for Bisq (#74)"}],"action":{"name":"View Issue","url":"https://github.com/bisq-network/proposals/issues/74"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/proposals/issues/74",
"url": "https://github.com/bisq-network/proposals/issues/74",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>