Monthly Archives: June 2014

Capture/Replay Fails

Well, I was just getting ready to write about how capture/replay does not work.

Instead, I'll link to this devastating assessment.

And, by the way, read the whole book.


Talking Pictures

Don’t forget that an important tool for showing the steps to reproduce a bug is a movie.

You can walk through the steps (and talk through at the same time), recording as you go. The movie can be an attachment to the bug report.

If necessary the movie can be speeded up or slowed down. I had an incorrect popover that disappeared in less than a second. I made a movie for the bug report, and included instructions for navigating to the right spot and running the movie slowly enough to see the popover, and stop the movie if desired.

The tool I’m using (Windows 7) is MS Screen Recorder, which is available for download.

This Is Gonna Be Fun!

In my two recent posts, I wrote about getting better by learning PowerShell, and about provisioning a test machine to run CUITs without VS.

Two things since then:

  • I’ve been able to determine that all the utilities involved in the provisioning have CLIs (that’s command-line interface, to the youthful among you) and can run in quiet (unattended) mode. That means that the provisioning can be automated.
  • I’ve looked a bit at PowerShell, and I think I’m going to like it!

Getting Better

One way to get better is to learn a new language.

I’m beginning Windows PowerShell. I have the Windows PowerShell Cookbook from Amazon. (I always like a cookbook.)

I’m going to love never again using cmd.exe, which I’ve always hated. I’ve sometimes used Cygwin instead, but this PowerShell is positively wired into Windows.

(Yes, yes, I know I’m late to the PowerShell party, but I haven’t really needed it up to now.)

Now Playing: CUITs Without VS!

I’ve spent time this week setting up a virtual machine. It now has MSTest, the Selenium binaries, and the Test Agent and Test Controller.

Together, they can run my Coded UI Tests without Visual Studio. This is essential if we’re going to have multiple test machines, because we don’t want to have to have a VS license for every test machine.

Wasn’t easy, though. I’ve captured all the steps in a doc. I need to write a PowerShell script to do this work!

Going Through Some Changes

Quite a while ago I ran across this post (now a PDF periodical article). I’d been doing what I call “change testing” for some time, and I thought this was a good introduction to the concept. Please see the section “Regression Testing” that begins on the second page. (But it’s okay — informative, even — to read the whole article.) I especially like the metaphor that sees change testing as a “quality ratchet.”

But I think it’s unfortunate that the authors characterize change testing as regression testing, which I think invites confusion.

I’ve done change testing on a large scale, and will have much more to say about it in forthcoming posts.

The Square Root of 5?

Sometimes in a job interview I’m asked to whiteboard some code (or pseudo-code). One such time I was asked to whiteboard code for a function fibonacci(n) to return the nth Fibonacci number, and then discuss its performance.

I declined, and here’s why: I think coding should be informed by knowledge and, you know, thought.

When I got home, I began gathering the knowledge.

Obviously, the function could be crafted using either iteration or recursion. But the first thing I wanted to know is whether it could instead use direct computation. On Wikipedia, I found that the answer is Yes! I also found some things that were to me very surprising:

  • The computation involves \sqrt 5.
  • The formula is derived using matrix algebra.

The fact that the computation involves \sqrt 5 means that floating-point arithmetic is required, not integer arithmetic. That, in turn means that for large n, the result will be incorrect because of rounding error. So the direct computation works only for the smaller values of n.

Then I looked up a list of Fibonacci numbers, where I noticed that:

  • fibonacci(48) does not fit in a 32-bit unsigned integer.
  • fibonacci(94) does not fit in a 64-bit unsigned integer.
  • fibonacci(187) does not fit in a 128-bit unsigned integer.

Now that means that even simple integer arithmetic can produce only the smaller Fibonacci numbers.

At this point, I’d want to get the actual requirement: What’s the maximum n that would be needed. If small, I’d implement a lookup table to immediately return the desired number. If large, I’d continue investigating — perhaps look into a “big num” library.

So, I believe I was right to decline the whiteboard exercise.

But, you might say, they just wanted to get an idea about how you think.

Well, this is how I think.