An Introduction to Property-Based Testing with JavaScript

Property-based testing is a powerful technique that’s been widely and successfully applied to functional-style codebases for a long time. As functional programming continues to get more and more popular among JavaScript developers, the value of this style of testing is becoming more obvious to a wider audience. Read more on An Introduction to Property-Based Testing with JavaScript…

Using State Tables for Testing

Tests can benefit a project in many different ways. For example, they help ensure that the software behaves as expected. They also help document that functionality for pieces of code that other developers may have to maintain.

Lately, I’ve been using state tables in my tests to improve both of these benefits. State tables allow for clear and comprehensive tests that are scalable during the development. Read more on Using State Tables for Testing…

Accept It: Software is Wabi-sabi

Last week, after dealing with a frustrating build and deployment issue, I reflected on what makes software development frustrating at times–specifically, the well-known feeling that code “rots” over time. I happened to glance at a small Zen rock garden my wife had given me long ago and was reminded of wabi-sabi.
Read more on Accept It: Software is Wabi-sabi…

Take Your Emacs to the Next Level by Writing Custom Packages

I wrote recently about using Emacs as a JavaScript development environment. One of my chief complaints was the inability to easily run JavaScript tests from within Emacs. I practice TDD frequently, and having to context-switch out of the editor I’m using to run tests is a big annoyance for me.

I knew it was possible to do what I wanted from within Emacs, as evidenced by other test runner modes like RSpec-mode. Armed with that knowledge, I decided to go through the process of learning enough Emacs Lisp to make a Mocha test runner. In the process, I learned a lot about developing Emacs packages and ended up with a really useful tool, so I thought I would share some of the things I learned.
Read more on Take Your Emacs to the Next Level by Writing Custom Packages…

Testing with Swift – Approaches & Useful Libraries

I’ve been working on developing an iOS app in Swift. It’s my first experience developing in pure Swift, without any Objective-C. This project has taught me a lot about the current state of testing in Swift, including different testing approaches and best practices. In this post, I’ll share some of my experiences and discuss how we have approached testing different types of Swift code. I’ll also talk about some useful testing libraries. Read more on Testing with Swift – Approaches & Useful Libraries…

Bye-Bye, Sinon – Hello, testdouble

UPDATE: Justin Searls, the author of testdouble.js sent me an email with some notes on this post. I’ve added some his comments below to provide some additional context.

I’ve been working in JavaScript-land for the last little while, writing lots of Node.js code. Since I practice TDD, I’m always trying to keep my eye on the best new ways to test JavaScript code. Read more on Bye-Bye, Sinon – Hello, testdouble…

How I Test CSS

At Atomic, we practice Test-Driven Development for all the code we can, from single functions to entire stacks. But there’s one kind of code we’ve long neglected testing: CSS. We rarely have coverage of it, and we often discover bugs and style regressions long after they were introduced. We’re not alone. Most software developers don’t do CSS testing. It’s tough to assert that a website looks the way you want.

I’ve wrestled with the problem of CSS testing for a long time, and I have two suggestions for catching style problems early. Read more on How I Test CSS…

Property-Based Testing for Serialized Data Structures

When I first heard about property-based testing, my instincts told me it was too academic to be of practical use. But, as is often the case in the art of software, my gut reaction failed to appreciate the value of something new.

I originally felt the same way about functional programming, so I guess I can’t trust my gut very much when it comes to new concepts. To quote Nick Hornby, “Between you and me, I have come to the conclusion that my guts have s— for brains.” I’ve recently stumbled into some great ways to get real-world value out of property-based testing.
Read more on Property-Based Testing for Serialized Data Structures…