Simulate Network Outages in Your App with Little Snitch

Modern development tools are super-convenient. XCode’s more recent builds let you debug an iOS app over WiFi, so you don’t have to succumb to the indignity of plugging in a Lightning cable (so 2017). React Native’s tooling goes a step farther, giving you the ability to run the native part of the app on a mobile device and execute the JavaScript side part of the app in a web browser on your development machine (where the JS inspection tools are more convenient). Networked debugging is amazing.

But sometimes, you need to test your app’s response to network outages. Read more on Simulate Network Outages in Your App with Little Snitch…

Debugging Strategies You Can Use on Every Project

I’ve wanted to write a post about debugging for a while, but it’s a topic that can be really difficult to discuss in a general way. Approaches to debugging vary wildly and span multiple technologies and domains (hardware vs. software vs. other).

Bugs can also exist on all types of scales—everything from users reporting an issue in your production application, to code failing to compile, to your app crashing when you use it in a certain way. Read more on Debugging Strategies You Can Use on Every Project…

What Shape is Your Project? – Tackling Software with a High “Complexity to Visibility” Ratio

Debugging a recent project has been surprisingly challenging. It’s a complicated product with multiple components, but that’s nothing new. The customer’s QA department has done great work, but it still feels like this is harder than it should be. Read more on What Shape is Your Project? – Tackling Software with a High “Complexity to Visibility” Ratio…

Debugging Techniques: #1 Break the System into Small Pieces

My PC wouldn’t boot, didn’t even make a sound. I traced the problem down to a particular mounting screw, but there was nothing to indicate that this screw was problematic. It was a perfectly fine screw, correctly installed in the right place. How did I figure this out? Debugging!
Read more on Debugging Techniques: #1 Break the System into Small Pieces…

Debugging ES6 Code in Node.js

I recently decided to use Node.js for my current project, and I also thought it would be a good idea to start off using ES6 (properly known as ECMAScript 2015). ES6 was a major addition to the language, and it was just formalized in June 2015. Since then, there has been a lot of effort to add ES6 compatibility to browsers (and Node.js). Until there is unanimous support for ES6, which will likely be quite some time yet, developers who use ES6 are required to run their code through a transpiler in order to transform it into valid ES5 for browser compatibility.
Read more on Debugging ES6 Code in Node.js…

Spying on Your WPF Applications with Snoop

If you’re developing WPF applications and do not have Snoop installed; install it now. I’ll wait. Installed? Good.

Snoop is an open source tool for spying and debugging a running WPF application. It can be used to inspect your running application and make changes while your app is still running. I’ve found it to be very useful for finding missing bindings and tweaking layout parameters when you can’t use Designer. (don’t ask, that’s a blog post for another day.)

Here are a few tips to get you started:

Selecting Your App

After installing and launching Snoop, drag the cross-hairs from the Snoop window to your WPF application. You’ll see your application tree on the left and a property editor on the right for whatever component you have selected.

Read more on Spying on Your WPF Applications with Snoop…

Debugging with Ember Inspector – Ember’s Chrome Plugin

When creating a single-page site using a technology like Ember or AngularJS, debugging code can become an issue. Firebug and the Chrome debugger quickly lose their power as you have to dig through Ember models and other representations of your application.

Thankfully, from the creators of Ember comes a plugin for Chrome debugging — Ember Inspector — which gives you quick access to Ember objects and data.

Tree View

The tree view visually allows you to walk through the different parts of your Ember application. This is useful for debugging but also helps to gain an understanding of how an Ember application is built up.

Read more on Debugging with Ember Inspector – Ember’s Chrome Plugin…

Tools for Debugging Running Ruby Processes

Let’s assume that we have a daemon running on some kind of POSIX system written in Ruby that works great most of the time, but every few months gets “stuck” and needs to be restarted. We might tolerate this failure rate, or we might set up something like monit to automatically restart the daemon when it becomes “stuck.” But wouldn’t it be better to get to the bottom of the issue?

Next time the daemon gets stuck, what tools might we use to figure out what’s happened to it? If you’re still developing, you might have included the pry gem or you might even be using pry-rescue to catch exceptions. But on a production system, you probably won’t have such luxuries available.

Luckily, since a Ruby process is still a process, there are actually quite a few POSIX utilities at our disposal. Let’s find the PID of our our process and see what we can learn. Read more on Tools for Debugging Running Ruby Processes…

Easier Debugging with capybara-screenshot

This is one of those Rubygems I wish I’d known about a long time ago: capybara-screenshot.

As the name suggests, when a capybara test fails, the gem will automatically take a screenshot of what the browser rendered. I don’t normally need this level of information, as the error is usually fairly obvious. But a handful of times now, the extra information has helped to work through those times where I’m scratching my head and can’t figure out why a test is failing.

I did change the stock behavior of the gem a bit — I don’t have it automatically take a screenshot. Since I don’t normally need that, I didn’t want it cluttering up my filesystem. Instead, I tag scenarios with a little piece of metadata when I want a screenshot. Here’s how I did that:

Read more on Easier Debugging with capybara-screenshot…