Cedric on Testing

I like how Cedric articulates his approach to testing:

Typically, I code a feature, iterate over it a few times and I reach a point when I’m pretty happy with its shape: it’s looking decent, it gets the job done and while there is obviously more work to be done on it, it’s mature enough that writing tests for it at this point will not be a waste.

Fresh Start

Sony gives you the option to remove crapware from certain new Windows 7 PCs. They call it their “Fresh Start” option, as shown here:

Fresh Start

Problems:

  • A crapware-free PC should be the DEFAULT selection, not an easily missed opt-out selection
  • Fresh Start is only available for Win 7 Professional

This leaves me with a very uneasy feeling about Sony. If I were to buy a laptop from them, it would be Win 7 Home Premium. But since Fresh Start is not available with Home Premium, what kind of crap is pre-loaded?

Magic Mouse

A family member got a Magic Mouse so I had some time to play around with it.

Magic Mouse

Here are my thoughts:

  • Step 1 – Go to System Preferences and enable right click. Duh.
  • Left and right click work perfectly, unlike the Mighty Mouse which I never could get to work reliably. You won’t mis-click with the new mouse.
  • There are no buttons, but the whole mouse does physically move and click, so it feels right.
  • The twoone-finger vertical swipe to scroll vertically works well.
  • I do not like the two-finger horizontal swipe gesture. This makes your browser go back and forward. The problem is, the entire mouse moves when I swipe horizontally. So I have to awkwardly hold the mouse while trying to contort my fingers…it’s not good.
  • For me, the mouse is far too dainty and tiny. Women and children will love this mouse. Men with big hands might be better served by a Logitech mouse.

Unit Tests are Tests

James Carr writes:

Unit Tests are NOT “tests” in the classical sense… they instead should be used to drive your design, to help you think about how the system you are writing should work, to illustrate functionality.

I disagree with the all caps “NOT”. I think unit tests are primarily for testing, and are particularly valuable for regression testing. I do find that writing tests as I write code influences and usually improves design, but they certainly are “tests”. The fact that tests can drive your design and illustrate functionality are often nice side effects, but they are not the primary reason I write tests.

He goes on to write:

If you ever find yourself running a code coverage tool after writing fresh code, step back and realize that you’re doing it wrong.. my suggestion is if you run a code coverage tool and find parts of your freshly written code aren’t covered, delete that code and try again.

Deleting and rewriting code is a bit too extreme for my taste, but I often do something similar. When fleshing out new work, I’ll often write new classes and interfaces, bounce ideas off coworkers, and rename / refactor heavily. Once I feel like I’ve found the right approach, I will sometimes comment out blocks of code, write a quick unit test (that fails), and then replace the code.

State Capitals 1.1.0

I just published a new version of State Capitals to the Android Market. If this were an iPhone app, who knows how long that process would take. On Android, the app is available within seconds of publication.

This version features one bug fix and completely new graphics. You can find it on the Android Market under the Applications -> Reference category.

Home Screen

The app does have menus to set configuration options, but everything else is through the touch screen. The new graphics show where the state resides and where the capital resides within each state.

Missouri

State Capitals is free (as in beer), and is also ad-free. Enjoy!

News Lets us Down Again

Arianna Huffington sums it up:

After a commercial break, Ed asked me about the story. I told him that, for me, once the boy had been found, there was no story — just tele-voyeurism. Why continue the wall-to-wall coverage of a story that had turned into a non-story — on a political show — during a week when health care, financial reform, and Afghanistan are all at the tipping point?