Lincheck 指南
Lincheck is a practical and user-friendly framework for testing concurrent algorithms on the JVM. It provides a simple and declarative way to write concurrent tests.
With the Lincheck framework, instead of describing how to perform tests, you can specify what to test by declaring all the operations to examine and the required correctness property. As a result, a typical concurrent Lincheck test contains only about 15 lines.
When given a list of operations, Lincheck automatically:
- Generates a set of random concurrent scenarios.
- Examines them using either stress-testing or bounded model checking.
- Verifies that the results of each invocation satisfy the required correctness property (linearizability is the default one).
Add Lincheck to your project
To enable the Lincheck support, include the corresponding repository and dependency to the Gradle configuration. In your
build.gradle(.kts)
file, add the following:
【Kotlin】
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.jetbrains.kotlinx:lincheck:2.30")
}
【Groovy】
repositories {
mavenCentral()
}
dependencies {
testImplementation "org.jetbrains.kotlinx:lincheck:2.30"
}
Explore Lincheck
This guide will help you get in touch with the framework and try the most useful features with examples. Learn the Lincheck features step-by-step:
- Write your first test with Lincheck
- Choose your testing strategy
- Configure operation arguments
- Consider popular algorithm constraints
- Check the algorithm for non-blocking progress guarantees
- Define sequential specification of the algorithm