A Philosophy of Testing 2: Idiomatic Scala and Testing

Favor Types Over Tests

First of all, Scala is strongly typed. While it isn’t absolutely perfect, you can go a long ways to restrict what values can go where in your code by using more-precise types for your fields and parameters.


One of those “Scala idiom” details is:

Favor Immutability

Another central element of idiomatic Scala can be summarized as:

Idiomatic Scala is Different

The key point here is that unit testing is not a one-size-fits-all affair. Folks tend to assume that testing is testing, and that the same principles apply regardless of the language you are working in. But that’s just not true.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mark "Justin" Waks

Mark "Justin" Waks

Lifelong programmer and software architect, specializing in online social tools and (nowadays) Scala. Architect of Querki (“leading the small data revolution”).