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.
Notes from September 24, 2016:
Doctor: I’d like to collect a bone marrow sample ...
*Al runs out of the hospital in a hospital gown, screaming like a little girl*
(later, after they caught me)
Doctor: The next time you break out in a rash, hives, or blisters, I want you to have those biopsied.
Me: Is there going to be any part of our relationship that doesn’t involve a lot of pain on my part?
Me: The crazy one?
As a brief note, if you’re developing an Android app with Flutter and then find that the changes you made to your AndroidManifest.xml file aren’t being seen in your app, you’ll probably need to uninstall your dev/test app and completely reinstall it with
flutter run. I just ran into this problem while working with flutter_local_notifications — which requires changes to AndroidManifest.xml to work properly — and uninstalling and reinstalling the app fixed the problem.
Kent Beck has a good article on Medium titled, Programmer Test Principles.
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.