ScalaCheck
ScalaPB
ScalaCheck | ScalaPB | |
---|---|---|
3 | 3 | |
1,933 | 1,282 | |
0.2% | 0.5% | |
8.3 | 9.0 | |
about 21 hours ago | 7 days ago | |
Scala | Scala | |
BSD 3-clause "New" or "Revised" License | Apache License 2.0 |
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.
ScalaPB
-
Friction-less scala - Tell us what is causing friction in your day-to-day life with Scala
I've had great experience with ScalaPB and even better with fs2-grpc (which builds on top of ScalaPB).
-
Working with polymorphic data models in a REST API
One way I've solved this is to use Protobuf contracts to serialize json with ScalaPB. They have a way implementing oneof that keeps each object individual and separate. Even if you don't decide to use PB, you can take some inspiration from the implementation.
-
Scala 3.0 serialization
You could try out protocol buffers. Not sure how stable it is, but I noticed they have a Scala3 version of their runtime library. (Disclaimer: I have not tried it out myself)
What are some alternatives?
ScalaTest - A testing tool for Scala and Java developers
scodec - Scala combinator library for working with binary data
Gatling - Modern Load Testing as Code
ScalaBuff - the scala protocol buffers (protobuf) compiler
scalaprops - property based testing library for Scala
µPickle - uPickle: a simple, fast, dependency-free JSON & Binary (MessagePack) serialization library for Scala
Nyaya - Random Data Generation and/or Property Testing in Scala & Scala.JS.
Pickling
ScalaMock - Native Scala mocking framework
Scrooge - A Thrift parser/generator
Specs2 - Software Specifications for Scala
Avro4s - Avro schema generation and serialization / deserialization for Scala