October 29, 2005

Speeding up Rails testing

In Faster Testing with Rails 1.0, Mike Clark talks about the changes to testing default in Rails 1.0.
Herewith, an overview of the new testing stuff, a how-to for upgrading your existing tests (though you don't have to), an obligatory math formula or two, and a performance comparison that's worth about as much as you paid to read this.
So I gave it a try...and was more than pleasantly surprised: the total test time was reduced (in one set of runs) from seven minutes down to about 40 seconds: the optimized tests run in just about 10% of the original test time.
Test Suite Run Times for Rails Testing

The following table shows the run times (in seconds) for my Culinary Census test suite. There are maybe 260 to 300 rows of data generated by the fixtures in 15 or so tables. Some 250 rows are static, the rest dynamically generated.

Type of Test No Optimization Non-instantiated Transactional NI
and
Transactional
Unit Tests
96 tests, 474 assertions
370 86 325 35
Functional Tests
47 tests, 170 assertions
60 15 47 6
Total 430 101 372 41

Legend

Use
Transactional
Fixtures
Use
Instantiated
Fixtures
No Optimization false true
Non-instantiated false false
Transactional true true
NI
and Transactional
true false
Posted by ronlusk at 05:47 PM

Worth repeating

Déjà fubar

Déjà fubar

Posted by andyhunt 8 days ago

déjà fubar |ˌdā zh ä ˈfoōˌbär | noun

That sinking feeling that you’ve made this very same mistake before. Maybe even many times before.

Posted by ronlusk at 07:11 AM

October 17, 2005

More on Life Hacking

Signal vs. Noise comments on the article cited earlier in The science of interruptions
Posted by ronlusk at 06:44 PM

The Life Hackers

A co-worker—perennially amused at the three or (with my laptop running) four monitors on my desk—sent me the reference to this article on computers and the study of interruptions.

"[Managing and multi-tasking the online relationships of work and personal life] makes us feel alive," Stone says. "It's what makes us feel important. We just want to connect, connect, connect. But what happens when you take that to the extreme? You get overconnected." Sanity lies on the path down the center - if only there was some way to find it.

[In a study, users ] juggled eight different windows at the same time - a few e-mail messages, maybe a Web page or two and a PowerPoint document. More astonishing, they would spend barely 20 seconds looking at one window before flipping to another.

Why the constant shifting? In part it was because of the basic way that today's computers are laid out. A computer screen offers very little visual real estate. It is like working at a desk so small that you can look at only a single sheet of paper at a time.…

This is part of the reason that, when someone is interrupted, it takes 25 minutes to cycle back to the original task. Once their work becomes buried beneath a screenful of interruptions, office workers appear to literally forget what task they were originally pursuing.…

…When Czerwinski walked around the Microsoft campus, she noticed that many people had attached two or three monitors to their computers. They placed their applications on different screens - the e-mail far off on the right side, a Web browser on the left and their main work project right in the middle - so that each application was "glanceable." …

The workers swore that this arrangement made them feel calmer. But did more screen area actually help with cognition? To find out, Czerwinski's team conducted another experiment. The researchers took 15 volunteers, sat each one in front of a regular-size 15-inch monitor and had them complete a variety of tasks designed to challenge their powers of concentration - like a Web search, some cutting and pasting and memorizing a seven-digit phone number. Then the volunteers repeated these same tasks, this time using a computer with a massive 42-inch screen, as big as a plasma TV.

The results? On the bigger screen, people completed the tasks at least 10 percent more quickly - and some as much as 44 percent more quickly. They were also more likely to remember the seven-digit number, which showed that the multitasking was clearly less taxing on their brains. Some of the volunteers were so enthralled with the huge screen that they begged to take it home. In two decades of research, Czerwinski had never seen a single tweak to a computer system so significantly improve a user's productivity. The clearer your screen, she found, the calmer your mind. [Emphasis mine—rl]

[Meet the Life Hackers - New York Times]
Posted by ronlusk at 10:49 AM