Close and Go BackBack to Viget

Tips and Tricks

Tips for Writing Better Bug Reports

Josh Korr
Josh Korr, Web Project Manager, January 06, 2012

Though we might wish otherwise, bugs (or, more generally, defects) are a fact of life in software development. Unfortunately for developers, so are unhelpful and infuriating bug reports.

Bad bug reports waste time and money while everyone goes back and forth to clarify the necessary details. Perhaps worse, bad bug reports tug at developers' sanity and can put strain on the team dynamic.

I know this from experience -- not as a developer, but as a bug reporter who has infuriated plenty of developers in my time as a product/project manager. Because I love my dev colleagues, I've tried hard to improve my bug reporting. Here are some tips I've come up with along the way for writing better bug reports:

  • The first step is changing how you think about experiencing bugs, so you can report them in sufficient detail.
  • Next, be as specific as possible in providing that detail.
  • Finally, always try to reproduce a bug before you report it.

Let's look at each of those tips in depth.

Continue reading "Tips for Writing Better Bug Reports"

Regular Expressions in MySQL

David Eisinger
David Eisinger, Senior Developer, September 28, 2011

Did you know MySQL supports using regular expressions in SELECT statements? I’m surprised at the number of developers who don’t, despite using SQL and regexes on a daily basis. That’s not to say that putting a regex into your SQL should be a daily occurrence. In fact, it can cause more problems than it solves, but it’s a handy tool to have in your belt under certain circumstances.

Continue reading "Regular Expressions in MySQL"

Testing Your Code’s Text

David Eisinger
David Eisinger, Senior Developer, August 31, 2011

The “Ubiquitous Automation” chapter of The Pragmatic Programmer opens with the following quote:

Civilization advances by extending the number of important operations we can perform without thinking.

–Alfred North Whitehead

As a responsible and accomplished developer, when you encounter a bug in your application, what’s the first thing you do? Write a failing test case, of course, and only once that’s done do you focus on fixing the problem. But what about when the bug is not related to the behavior of your application, but rather to its configuration, display, or some other element outside the purview of normal testing practices? I contend that you can and should still write a failing test.

Continue reading "Testing Your Code’s Text"

Using Javascript postMessage to Talk to iFrames

Tony Pitale
Tony Pitale, Former Staffer, July 05, 2011

To javascript, iFrames are typically black boxes. Javascript now allows cross-document communication thanks to the postMessage function. Here's how I used postMessage to get the height and width of a document in an iFrame.

Continue reading "Using Javascript postMessage to Talk to iFrames"

Convert a Ruby Method to a Lambda

David Eisinger
David Eisinger, Senior Developer, April 26, 2011

Last week I tweeted:

Convert a method to a lambda in Ruby: lambda(&method(:events_path)). OR JUST USE JAVASCRIPT.

It might not be clear what I was talking about or why it would be useful, so allow me to elaborate. Say you’ve got the following bit of Javascript:

var ytmnd = function() {
  alert("you're the man now " + (arguments[0] || "dog"));
};

Continue reading "Convert a Ruby Method to a Lambda"

We're the Developers

at Viget Labs. We write about web development trends, tips, best practices, industry events, and our projects — all with an emphasis on Ruby on Rails.

Upcoming Events

Future Insights Live - April 29 to May 4
Future of Web Apps, Future of Web Design, Future of Mobile, and Future of Web in the Enterprise have joined forces to bring you our most comprehensive event EVER!

Contact Us

Have any questions, comments, ideas, or secrets to share? Let us know.


How many days in a non-leap year?

Sorry, you need to have Javascript enabled to use this form. (Don't blame us, blame the spammers!) If you'd like to contact us, please visit our Contact page.