Git Pre-Commit Hooks and Specta’s Focused Examples

On my current iOS project, we’re using Specta as the testing framework. One of the really nice features that Specta provides is the ability to run specific specs/tests by prepending an f to an it or describe (or the other spec aliases). According to the Specta docs, “When specs are focused, all unfocused specs are skipped.”

When you’re trying to figure out why a test is failing, the ability to run a specific spec is invaluable. I love this feature, and I use it all the time. Read more on Git Pre-Commit Hooks and Specta’s Focused Examples…

Asynchronous Testing with Protractor’s ControlFlow

Protractor is an end-to-end testing framework for AngularJS applications that uses a real browser, just as a real user would. It is built on top of NodeJS and WebDriverJS and taps into the internals of Angular to know when Angular is done processing and updating bindings.

The joy of Protractor and WebDriverJS is that we can write our tests in a synchronous style, and still have the added benefits of asynchronous code. Read more on Asynchronous Testing with Protractor’s ControlFlow…

Understanding Ember.js Computed Properties

Ember has a lot of great things going for it. One of the Ember features I constantly praise is computed properties. The Ember guides are a great starting point to learn about computed properties. Computed properties allow quick ways to massage and manipulate data into the form your application needs it. It makes presenting data a cinch.

Read more on Understanding Ember.js Computed Properties…

Simpler Deploys with git Subtrees: A Retrospective

Back in March I posted about using git subtrees to simplify deploys. I was initially hoping to clean things up a bit by using subtrees. I wanted to reduce the size of my deploy and my Heroku slug by excluding source assets. I also wanted to make sure that it was easy to understand and that other developers didn’t have to worry about extra steps when cloning the repo or when deploying. Submodules force some extra steps when cloning, pulling, and pushing, so they weren’t my first choice.

Using subtrees like this did work fairly well, but I would think twice before using them again for this type of problem. Read more on Simpler Deploys with git Subtrees: A Retrospective…

More Typing, Less Testing: TDD with Static Types, Part 2

In part 1 of this post I claimed it’s easy to test-drive our way into a poor design. We looked at some techniques for using types with TDD, but the examples were simple. Today I’ll walk through Kent Beck’s Money example showing where the design fails and how it can be improved with types. Read more on More Typing, Less Testing: TDD with Static Types, Part 2…

More Typing, Less Testing: TDD with Static Types, Part 1

I learned test-driven development from Kent Beck’s book Test-Driven Development By Example. It’s an excellent introduction that whets the appetite for one of my other favorites, Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce.

Both of these books have a blind spot, though: they are completely silent about how modern static type systems might augment or even replace tests. After reading these books, it’s easy to think that “typing” mainly has something to do with keyboards. Read more on More Typing, Less Testing: TDD with Static Types, Part 1…

Ember-Style Computed Properties in Ruby Gamebox

I’ve been using Ember.js on a recent project because it has a ton features for building web-apps, like routing, event handling, and templated views that use built in data binding. Ember also does a great job of managing data on its objects via its computed properties.

I wanted computed properties in Gamebox, but no Ruby gem existed. So, after reading some Ember.js source, I wrote my own.
Read more on Ember-Style Computed Properties in Ruby Gamebox…

Automating Artifact Generation on Capybara(-Webkit) Failures with Autopsy

System tests are a crucial piece of testing any application. I’m a big believer in isolated unit tests as well, but if I had to pick just one kind of test to use, it would be system tests. There is no substitute for actually exercising the full code base from top to bottom.

That said, I don’t know if any one thing about software development has caused me more frustration than system tests. Read more on Automating Artifact Generation on Capybara(-Webkit) Failures with Autopsy…

How to Perform an Unwind Segue Programatically

In my previous blog post, I introduced you to Unwind Segues in iOS. In that example, much of the work was done in the Interface Builder of Xcode. Now I’ll show you how to perform an unwind segue in code and how to pass data along the unwind segue. Read more on How to Perform an Unwind Segue Programatically…

Read more on How to Perform an Unwind Segue Programatically…

byte_array – The Missing Built-in Type for C

The C language is long from dead. In fact, it is still the most popular programming language in the world, according to LangPop.com.

Of course, C still has those dreaded pointers that allow attempted access to arbitrary memory locations. Even though when you try to access invalid memory, things still go BOOM! Read more on byte_array – The Missing Built-in Type for C…