test

Use Case best practice: Test your Use Cases with real data alvin November 12, 2009 - 9:20am

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.

Fifty Shades of Mast Cell Activation Disease (MCAD/MCAS) alvin September 23, 2019 - 5:31pm

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?

Doc: Yes, pee in this cup, and we’ll look at it under a fluorescent light to see if you have the same disease that King George III had.

Me: The crazy one?

Doc: Yes.

Me: Cool.

Solution: When AndroidManifest.xml changes aren’t seen in your Flutter dev/test app alvin September 23, 2019 - 12:44pm

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.

Programmer Test Principles (Kent Beck) alvin July 5, 2019 - 10:05am

Kent Beck has a good article on Medium titled, Programmer Test Principles.

Yoda Conditions alvin May 5, 2019 - 9:15pm

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.

A large list of people’s given names, sorted for Java/Kotlin/Scala testing alvin March 9, 2019 - 11:09am

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:

ScalaCheck custom generator examples alvin February 8, 2019 - 5:48pm
Table of Contents1 - Custom generators2 - Built-in ScalaCheck generators3 - How to use ScalaCheck generators4 - More ScalaCheck generators

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

Custom generators

This is a combination of generators I wrote, and some that I copied from other places and may have modified a little:

How to intentionally throw and catch an exception with ScalaTest alvin February 6, 2019 - 6:22pm

If you ever need to intentionally throw and catch an exception with ScalaTest, here’s an example of how to do that:

SBT warning: Getting the hostname was slow alvin December 27, 2018 - 6:47pm

I just started using a new version of SBT, and when I went to run a test I got this SBT warning message:

JMH, an SBT plugin for running OpenJDK JMH benchmarks alvin August 29, 2018 - 2:48pm

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.