Kent Beck has a good article on Medium titled, Programmer Test Principles.
Quite often when I’m asked to review a UML “Use Case” that someone else has written, I ask “Have you tested your Use Case with real data?” Sadly, the answer is usually “no.”
I don’t know why people don’t do this, but they don’t, and it seems like a very logical thing — essentially a unit test for Use Cases.
I had never heard of the term “Yoda Conditions” until now, but I have seen them in some Java code where programmers put the constant first in an effort to avoid null pointer exceptions.
If for some reason you ever need a list of people’s given names for testing your Java/Scala/Kotlin/JVM code, here’s a Java class with a sorted, static list of over 5,000 male and female given (first) names:
Writing custom generators for ScalaCheck can be one of the more difficult and/or time-consuming parts of using it. As a result I thought I’d start putting together a list of generators that I have written or seen elsewhere. Unfortunately I can’t credit all the ones I’ve seen in other places because I google’d and copied them many moons ago, but I’ll give credit/attribution to all the ones I can.Back to top
This is a combination of generators I wrote, and some that I copied from other places and may have modified a little:
If you ever need to intentionally throw and catch an exception with ScalaTest, here’s an example of how to do that:
I just started using a new version of SBT, and when I went to run a test I got this SBT warning message:
JMH is an SBT plugin for running OpenJDK JMH benchmarks. Per its docs, “JMH is a Java harness for building, running, and analysing nano/micro/milli/macro benchmarks written in Java and other languages targeting the JVM.”
They also recommend reading an article titled Nanotrusting the Nanotime if you’re interested in writing your own benchmark tests.
This page is a collection of popular tools, libraries, and frameworks for the Scala programming language.Back to top
If you ever need an example of a Unix/Linux shell script where you need to determine whether today is a weekend day, I can confirm that this code works: