Software Project Estimation: Inaccurate and Unavoidable

This is a follow up to On Our Project, We’re Always 90% Done.

The coder is the one on the hook for long nights, weekends, and stress-related health problems if the estimates suck. It’s in your interest to exert as much control over estimation and scheduling as you can. If you’re not making the estimate, someone is making it for you.

Continue reading “Software Project Estimation: Inaccurate and Unavoidable”

Silencing pointless reverse DNS warnings from OpenSSH

If you’ve been using SSH for long you’ve probably seen this at least once: Address 11.22.33.44 maps to www.foobar.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

Sometimes this is helpful. Sometimes this is really annoying and incorrect. Assuming you are a moderately well informed sysadmin and know that this message can safely be ignored, you might have been stumped trying to silence it. You may have tried every option in man ssh_options and even some of your own (STFU on?) I think I may be able to help.
Continue reading “Silencing pointless reverse DNS warnings from OpenSSH”

Making Rcov measure your whole Rails app, even if tests miss entire source files

I’ve seen a few Rake tasks for Rcov that work OK, but which fail in an interesting way (if you care about coverage): they give your coverage metrics an unexpected boost if you have 0% coverage in one or more source files.

Huh? Exactly. If you have 500 source files, and your test suite only requires one of them, then you get a free ride on those 499 files that have 0% coverage. Theoretically you could get 100% coverage in your report even though 499 source files are not touched at all. D’oh!
Continue reading “Making Rcov measure your whole Rails app, even if tests miss entire source files”

Rails snippet: require app files only once

Ruby’s Kernel.require method will re-require the same source file if you pass it differing arguments that point to the same file. It doesn’t use File.expand_path to make sure it hasn’t already loaded the same file before. This can cause problems if you’re using constants or doing one-time initialization in a source file that’s getting loaded multiple times for one reason; you’ll need to add a wrapper that prevents re-entry.

If this annoys you as much as it does me (why should my application code include workarounds for what I regard to be a Ruby bug?), add this snippet to your config/environment.rb (pre Rails 2.0) or config/preinitializer.rb (Rails 2.0 or later).
Continue reading “Rails snippet: require app files only once”