Tractatus is a library for Logic Based Testing documentation and reporting.
About the name! The project is named by Mohammad Reza when he created it. Tractatus is one of the most complex philosophical books ever written!
If you want to use this library you just need to know these annotations.
- @ClauseCoverage
- @UniqueTruePoint
- @NearFalsePoint
- @CACC (Correlated Active Clause Coverage)
- @Valuation
- @ClauseDefinition
Easily document your test cases like below. For more info see the test sample in the repo and also refer to the documents.
@UniqueTruePoint(
predicate = "ab",
dnf = "ab + acd",
implicant = "a(b + cd)",
valuations = {
@Valuation(clause = 'a', valuation = true),
@Valuation(clause = 'b', valuation = true),
@Valuation(clause = 'c', valuation = false),
@Valuation(clause = 'd', valuation = true)
}
)
@Test
public void smpleTestForOneAnnotation() {
assertTrue(predicate(0,0,1,0));
}
The technical terminology is mainly from logic based testing literature used in the book Introduction to Software Testing.
Simply add the extension to your test classes and see the reports in the tractatus
directory in your project root.
Currently, reporting Junit 5 extension is experimental so feel free to report any issues.
@ExtendWith(ReportingExtension.class)
class YourTestClass {
The report is a simple document like this:
Currently, the Maven Central does not have the latest version. But you can easily use Github Maven Repository to access the latest version. As you know, the library could also be fetched by the other build tools like Ant, SBT, Gradle, and so on with the proper syntax.
<dependencies>
<!-- other dependencies... -->
<dependency>
<groupId>com.github.mryf323</groupId>
<artifactId>tractatus</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
<repositories>
<!-- other repositories... -->
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github-kiarash</id>
<url>https://maven.pkg.github.com/kiarashazarnia/*</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
The project is open-source under the MIT License, so feel free to fork it and make a pull request if you have any ideas. Although the deployment process is automated thanks to Github Actions, the merging action is manual, so do not hesitate to deploy it on your own fork. The Github Packages service has a fairly easy mechanism despite the Maven Central's.