ScalaCheck
µTest
Our great sponsors
ScalaCheck | µTest | |
---|---|---|
3 | 2 | |
1,931 | 478 | |
0.4% | -0.6% | |
8.3 | 4.2 | |
2 days ago | 2 days ago | |
Scala | Scala | |
BSD 3-clause "New" or "Revised" License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ScalaCheck
-
How to Survive Your Project's First 100k Lines
Regarding numbers 2 and 3, I believe you are describing "property-based testing"[0]. A Scala version of this is ScalaCheck and can be found here[1].
There appears to be at least one Rust library which claims to provide same, but I am not a Rust developer so cannot recommend any for fitness of purpose.
0 - https://hypothesis.works/articles/what-is-property-based-tes...
1 - https://github.com/typelevel/scalacheck/blob/main/doc/UserGu...
-
Friction-less scala - Tell us what is causing friction in your day-to-day life with Scala
And the readmes and tutorials written for the major libraries are some of the best, and most concise out there. Seriously, even the old stuff, like scalacheck's guide is really good. Compare that to hypothesis. The hypothesis uses readthedocs, but other than the window dressing, much better. Try to find similar concise guides for major Java projects outside of spring boot. They're all external to the projects, published on Baeldung.
-
I’m really struggling with testing using Scalatest.
Write your test as properties that must be held, and let the framework generate random values and apply the function to thus values and compare the output by those properties. Take a look to ScalaCheck for that approach.
µTest
-
From First Principles: Why Scala?
Let's clarify some points for folks not so familiar with Scala.
> * Scala minor version are binary incompatible, so maintaining Scala projects is a big pain. Upgrading Spark from Scala 2.11 to Scala 2.12 was a massive undertaking for example.
Scala just chose a strange naming scheme. Other languages would have just increased their major version instead. The scala minor version is increased every few years and not every month or so.
> * Scala has tons of language features and lets people do crazy things in the code.
Actually, that's not true. Or rather: compared to what language?
Scala has surprisingly few language features, but the ones it has are very flexible and powerful. Take Kotlin for example. It has method extensions as a dedicated feature. Scala just has implicits which can be used for method extension.
> * Scalatest is stil used by most projects and is annoying to use, as described here: https://github.com/lihaoyi/utest#why-utest. The overuse of DSLs in Scala is really annoying.
I agree with the overuse of DSLs. Luckily that got much better, but older libraries like scalatest still suffer from that.
> * Li's libs (os-lib, upickle, utest) have clean public interfaces, but most Scala ecosystem libs are hard to use, see the JSON alternatives for examples
I think that just comes from using the library in a non-idiomatic way. In most applications, you will need to use the whole json anyways, and then you use (or can use) circe like that:
{
What are some alternatives?
ScalaTest - A testing tool for Scala and Java developers
ScalaMock - Native Scala mocking framework
Gatling - Modern Load Testing as Code
Diffy
scalaprops - property based testing library for Scala
Nyaya - Random Data Generation and/or Property Testing in Scala & Scala.JS.
Scala Test-State - Scala Test-State.
Specs2 - Software Specifications for Scala
Scalive - Connect a Scala REPL to running JVM processes without any prior setup