Categories
computer

New MacBook Pro Battery

The stock battery on my 1st-generation MacBook Pro has only been providing an hour of power as of late. When I hot-swapped in a fully charged new battery from my local Apple store, I was thrilled with the estimated remaining charge..

I highly doubt it will actually last this long, but one can dream. 🙂

Categories
personal

Dear TSA, Check Out The 4th Amendment. Thanks.

Just a little food for thought for your next airplane ride. The 4th amendment of the U.S. constitution reads..

The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Sounds reasonable to me. And now, the little note from the TSA left in my checked bag, neatly tucked between my clean, folded boxer shorts..

The full text follows below the line..


Transportation
Security
Administration
 


NOTICE OF
BAGGAGE INSPECTION 


To protect you and your fellow passengers, the Transportation Security Administration (TSA) is required by law* to inspect all checked baggage. As part of the process, some bags are opened and physically inspected. Your bag was among those selected for physical inspection.

During the inspection, your bag and its contents may have been searched for prohibited items. At the completion of the inspection, the contents were returned to your bag.

If the TSA security officer was unable to open your bag for inspection because it was locked, the officer may have been forced to break the locks on your bag. TSA sincerely regrets having to do this, however TSA is not liable for damage to your locks resulting from this necessary security precaution.

For packing tips and suggestions on how to secure your baggage during your next trip, please visit:

We appreciate your understanding and cooperation. If you have questions, comments, or concerns, please feel free to contact the TSA Contact Center:

Phone:866.289.9673 (toll free)
Email:TSA-ContactCenter@dhs.gov
*Section 110(b) of the Aviation and Transportation Security Act of 2001,
49 U.S.C. 44901(c)-(e)
Rev. 8-1-2004
Smart Security Saves Time
Categories
computer

Sufficiency In Software Testing

 

When I was finishing up my B.S. I took a class in embedded software testing. The big assignment was to write the software that controls a single elevator, test the software to our satisfaction and deliver the whole shebang at the end of the semester. The critical lesson I learned from the course was not that the elevator software was difficult to write, but that there are an infinite number of odd and unfortunate events that could happen to any component involved, at any time, and there is no way to declare with 100% confidence that you have accounted for all possible defects.

So most software is not about perfection, but sufficiency. Everyones wants ultra-high quality, defect free wares, but at some point you must put down the keyboard and declare the product “sufficient” for release. Key problems: “How do you know when you’ve done enough testing?” And just as important, “When is the right time to test?”

This topic has been a open talking point at OpenRain. Marc is a strong proponent of many TDD/BDD principles and goes knife-throwing-freak-show when stuff isn’t well covered. (Ed. note: possible slight exaggeration… maybe.) I am also highly concerned with sufficient tests, but prefer a incremental approach and am wary to invest too much effort in automated tests up front for several key reasons.

  1. While development is underway, you incur unnecessary overhead to maintain tests developed before design stabilization. This overhead is inevitable during long-term maintenance, but the last thing I want to do on the project I started yesterday is refactor all my tests because I dropped a single column from the “users” table.
  2. When inexperienced developers write tests too early, they oft end up testing the dummy data and underlying framework, not your design. It is not our job as application-level developers to write test cases for all underlying dependencies, but since that’s all you have at the beginning of a project, it’s easy to waste time here.
  3. The benefits of writing tests first to flush out design details is diminished in dynamic languages. In Java, writing a quick block of pseudo-code to use your interface is a great way to explore your design from an “external” perspective. Once you’ve achieved design clarity, you can easily use your compiler errors to create correct interfaces. Dynamic languages such as Ruby, however, do not offer this compile-time help, lowering the benefit of the technique.  
  4. There’s no freaking way we’re checking in code that doesn’t compile. Sorry, but if I’m writing a Java unit test, there’s no way I’m putting up with 800 compiler errors (and no autocomplete) over the next day while I generate all my stubs. I don’t care if TDD says otherwise; it’s a stupid practice for statically typed languages.

Granted, if any of our systems crash, we probably aren’t going to irreparably harm anything except for my phone that goes flying across the room for ringing at 5AM, but we still have the issue of “sufficiency”. For OpenRain‘s Rails-based applications, I’ve been using the following philosophies on a personal level.

  • Models tests should be implemented first and as soon as possible. Validation logic and other constraints should be verified up front, as key bugs here will likely effect other code. Add sample data as necessary.
  • Only functional/integration tests for core use cases should be done early. Adding too many upfront tests to the yet-to-stabilize design tends to add maintenance liability before it’s able to pay itself off.
  • Tests for non-core features should be tested shortly after a brief “breathing” period, wherein others can comment on the design/code before you’re fully committed to it. Don’t waste your time with a massive test suite until people stop telling you it sucks.
  • Avoid complex methods of testing. Multi-threaded and singleton-based designs have inherent testing complexities, and should be designed out if possible.
  • Aim for 100% coverage in dynamic languages. Otherwise you won’t catch retarded bugs like syntax errors.
  • Have all known, likely and anticipated issues resulting in a significantly negative state covered by an automated case. This is, perhaps, the crux of my “sufficiency” perspective. You must have some mental benchmark that determines when you are “done”. This does not imply that all issues are resolved, only that they are tracked and, hopefully, all the significant ones are fixed.

I’d love to hear your thoughts on practical testing philosophy. Please let me know what you think!

 

Categories
Uncategorized

Cool Daily Links

  • SearchMe.com :: Google search meets Apple’s “Cover Flow” for the web. Smells hot to me.Â
  • iPhone SDK Gets Interface Builder :: Now it’s actually fun to learn about native iPhone application development.
  • Upcoming Free iPhone Development Webcast
  • Monoprice.com :: You need to buy your random cables from these folks. I started using them last year and couldn’t be more pleased with the price and quality of the CAT 6, DVI and FireWire cables. Shipping isn’t free, but it’s reasonable, and if you wait until you have $100 in needs before placing an order, well worth it.
Categories
computer

Redmine w/OS X OpenLDAP, Parallels Server and JumpBox

OpenRain used a slew of crappy Trac sites for issue tracking until we switched to Redmine several days ago. The decision came because..

  • Redmine can authenticate off LDAP with trivial configuration.
  • Redmine has multi-project support out-of-the-box.
  • Redmine has some nifty Gantt chart and calendaring schwag and is generally better.
  • Parallels Server (for OS X) is finally available.
  • JumpBox has a beta Redmine VM image available.

If you’ve got an existing LDAP infrastructure, the whole shebang shouldn’t take more than an hour or two to set up.

  1. Install Parallels Server on your OS X Leopard server.
  2. Download the Redmine JumpBox. Generate a new MAC address and boot it. Do the one-page configuration thingy in your browser.
  3. Log into Redmine and create a new “Authentication Mode” set to LDAP. If you’re using the default OpenLDAP schema that ships with Leopard server, enter the attributes like so..redmine.png
  4. All your users should now be able to log into your Redmine JumpBox using their LDAP credentials! You’ll have to set up your projects, ACLs etc. within Redmine, but that’s some pretty hot shizzle to get running in such a small timeframe.

Mad props to Redmine, Parallels, JumpBox and Apple for further simplifying my business.

Categories
games

Review: Why Army of Two (360) Sucks

aot.pngThe overall aiming mechanic is *very* poor. I don’t expect PC-level ease, but at least something on par with the Tom Clancy games is necessary to make a console shooter fun. Both me and my buddy commented on this suckage right from the start. AoT also suffers from poor pacing. Remember how in Serious Sam they would spawn an insane amount of identical enemies in a large space and you’d fight them off for, like, 15 minutes? Yeah… expect some of that. On the plus side, after you clear an area you’ll be treated with the gong sound ripped straight off the Gears of War disc. (Now that you have your GoW disc out, why not put it in the drive instead?)

In single player mode, your AI buddy has a severe learning disability. He doesn’t make great decisions on when/where to heal you, or even where to drag you. When told to advance aggressively, he’ll pretty much clean house while you check your iPhone email. Using the aggro meter to a planned strategic advantage is pretty much impossible. Update: That’s really only true in the easy mode or easier parts. In certain difficult sections–especially in the hardest mode–closely controlling aggro for your AI buddy is necessary and useful.

Multi-player campaign co-op fairs only slightly better. All the special BFF moves you saw in the trailer can only be done at specific, pre-defined points along IKEA-like map paths. “Step jump” is a completely useless gimick which contributes nothing to the game except to serve as a trigger to spawn baddies. The team skydiving thing is… retarded. So one person snipes from the air. Cool.. except the other person “steers”. That’s… great. Co-op sniping on the ground is also worthless. The Max Payne-esque back-to-back mode would be awesome if you could choose when/where to do it, but you can’t… sooooo, lamX0r.Overkill, feign death, weapon upgrading and the aggro meter are actually useful strategic elements. The placement of large gun turrets throughout the game was clearly done to force teamwork and render any Leroy Jenkins types useless. Periodic encounters with enemies that can only be damaged from behind also provide a clever way of leveraging the aggro system. Unfortunately, you always use the same basic strategy of “I’ll fire at his shield to draw aggro while you walk up to him and shoot him in the butt.” The repetition gets old fast.

Oh, and I swear if I see one more BFF door opening cutscene I’m eating my controller and letting my stomach acid play the game for me. You opened a door together for the 30th time! YAY TEAM!!!

Conclusion: Rent only if you’re planning on playing with a friend. Otherwise continue getting your fix with GRAW2, RS: Vegas or Gears of War.

Categories
computer

Debugging JavaScript With Safari

I usually use FireBug and other FireFox-based tools for troubleshooting JavaScript issues, but never found a solid way to approach it in Safari, my primary browser. It turns out that the nightly builds of WebKit (Safari’s core) also come with a great utility called Drosera.app, which allows you to attach to a running WebKit process and get funky with a JavaScript console.

w00t l00ps! drosera.png

Categories
computer

Marc Chung on Amazon Web Services

marc.png

Mad props to fellow OpenRain’r Marc Chung for an excellent AWS presentation at this months Phoenix Rails meeting. Follow-up links..

Great job, Marc!

Categories
Uncategorized

Rails 2.0: selenium-on-rails routes.rb fix

When I updated a few projects to Rails 2.0 last year, selenium-on-rails stopped working … some issue with routing and the lame way selenium-on-rails adds its routes. I didn’t spend the time to figure out exactly what the routing problem was, but did manage to hack a quick fix into routes.rb. This feels like the Wrong Way for an ultimate fix but it at least solves the immediate problem. Shove these rules into your routes.rb and the /selenium path should start resolving again…

Categories
computer

RailsConf 2008 Registration Now Open

Register here. Fresh from my inbox…