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.
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % "test"
it’s only available in the SBT “test” scope. This means that when you start a Scala REPL session inside of SBT with its
console command, the ScalaCheck library won’t be available in that scope.
To use ScalaCheck with the SBT console (REPL), don’t use its
console command — use
test:console instead. A complete example looks like this:
$ sbt > test:console scala> import org.scalacheck.Gen.choose
Note that after you type
test:console your project may be compiled, so that step may take a few moments.
In summary, use SBT’s
console command to start a “normal” Scala REPL inside SBT, and use
test:console to start a REPL that you can run tests inside of. (Note that this same advice also applies to using ScalaTest or specs2.)
“Program testing can be used to show the presence of bugs, but never to show their absence.”
~ Edsger Dijkstra
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?
“What makes a clean test? Three things. Readability, readability, and readability.”
As a business analyst (or any person interested in writing software requirements and quality), there is one thing you should always ask yourself whenever you write a business requirement:
Is this software requirement testable?
I’ve seen some business analysts write some crazy things and call them requirements, but IMHO, if you can’t test it, it’s not a requirement.
Yesterday’s Blue Origin in-flight “crew capsule” escape test is extremely cool. If you haven’t seen it yet, there’s an animation of what the test is supposed to accomplish starting just after 3:30, and then the launch is at 51:20. If you get tired of watching the launch, make sure you fast-forward to see the booster landing at the end:
Matt Cassel, talking about New England Patriots head coach Bill Belichick in this espn.com article:
My rookie year, I got crushed in the back by a corner blitz against the Giants. We’re playing them the next year in the last preseason game. He asks me, “OK, Cassel, what front do they like to bring the corner blitz from?” I had looked it up the night before, anticipating it. I said, “Coach, it’s an over.” And he goes, “Brady?” Well, you know immediately when he goes to the next guy: “Oh, no. Oh, no.” And Brady says, “An under.”
Then Bill goes, “Brady’s right. I don’t want to have to send your mother another note that says, ‘Dear Mrs. Cassel, we regret to inform you that your son got killed being a dumbass.’”
From the website:
“Dailyprogrammer is about challenging programmers of all skill level with weekly programming challenges. 3 challenges a week are posted at increasing difficulty. Solutions are peer reviewed and redditors can ask for the community for feedback and comments.”