Looking at the book's table of contents, it seems there's very little discussion on testing tools. Which particular testing tool do you mention in the book? Are there any resources besides ScalaTest that you'd recommend?
I didn't spend a lot of time on this topic. The language itself was a lot to cover! I briefly discuss the choices in the "tools" chapter.
I used MUnit (https://scalameta.org/munit/) because it's very lightweight. I've decided I dislike all the dialects the better known tools provide. Also, MUnit was available for early builds of Scala 3 ("Dotty") before ScalaTest supported it, so that helped when I started the 3rd Edition. MUnit also integrates with ScalaCheck, which is a requirement for me.
Thanks. ScalaTest seems well suited for BBD-style tests. MUnit on the other hand is based on JUnit and has a different look and feel from ScalaTest. Besides being lightweight, is there anything else about MUnit that makes you prefer it over other testing tools?
I like the concept of BDD, but I strongly dislike the verbosity of BDD DSLs, along with the idiosyncrasies of their DSLs and the difficulty remembering them. Those DSLs are fine for the original intent of BDD, to communicate with stakeholders, but for tests that developers read and write, I prefer native idioms of the language with a helper library where needed. You already know the language and you can be concise.
ScalaCheck is used for property based testing, which I think is the strongest approach we have to correctness, besides what the types can enforce.
Suppose you write a type to encapsulate currency. Presumably it must obey accounting rules for addition and subtraction, multiplication by percentages (e.g., for computing taxes), have strict rules for rounding off to a desired number of decimal places, etc. These are properties. Tools like ScalaCheck (or the original framework in Haskell, called QuickCheck) make it easier to verify these properties.
Here are a resources that explain property-based testing: