Loose Bits Thoughts on distributed systems, cloud computing, and the intersection of law and technology.

Sphinx Bootstrap Theme 0.3.0 - Bootstrap v3 and more!

Bootstrap v3 comes to Sphinx

The Bootstrap Theme for Sphinx has hit a new milestone with version 0.3.0, bringing in version 3.0.0 of the Twitter Bootstrap library.

[![Sphinx Bootstrap Theme v0.3.0][img_sbt]][img_sbt] [img_sbt]: http://loose-bits.com/media/img/2013/09/08/sbt.png

A lot has changed since the last v0.2.0 blog post, the most conspicuous being that you can now specify to use either Bootstrap v2.3.2 or v3.0.0 via the theme options:

html_theme_options: {
    # Choose Bootstrap version.
    # Values: "3" (default) or "2" (in quotes)
    'bootstrap_version': "3",
}

Thanks to the awesome work by MiCHiLU, the Sphinx Bootstrap Theme can easily switch between Bootstrap v2.x and v3.x with full support for all of the features, including Bootswatch CSS extensions.

Read more...

Writing a Technical Book, Part 1 - Starting the Project

Finding and Starting a Book Project

I published my first technical book, Backbone.js Testing, in July, 2013. Now that I am coming down off the high of actually getting the book out to the world, I thought that I would take a little bit of time to reflect on my journey and write a series of posts about the adventures and tribulations of writing a technical book.

In this first post, I will look back on how I got roped into becoming an author, planning and scoping a prospective book outline, and signing a contract to begin work on the book.

Why Write a Book?

Writing a book is an enormous time commitment, puts pressure on your personal and work obligations, and has little or no chance of being financially a worthwhile endeavor.

So, why do it?

The short answer is that I liked the proposed topic, I was already interested in writing, and Packt Publishing had some fortuitous timing in pitching the project.

A good, challenging topic

Frontend web application testing has been a topic of keen interest and frustration for me for quite some time. Historically, testing JavaScript in web pages has been an arduous task, with very few good options and enormous amount of pain in any solution. At the same time, there is enormous need for this type of testing as more and more logic is pushed from a traditional backend application (e.g., a Django or Rails app) to the frontend.

In my day-to-day work over the past few years, I’ve noticed that the biggest holes in application test coverage and sources of most actual bugs have been in frontend JavaScript code. Accordingly, I have now spent a good amount of time implementing and writing about testing on the client side. In 2011, I wrote two posts on an early frontend testing solution I came up with using Env.js and Rhino. The technologies were unreliable and hacked together, but at that point, at least it was something.

Fast-forwarding to today, with the rapid rise of Node.js on the backend and a whole host of new and exciting browser libraries, there are a lot more options for frontend testing. At Curiosity Media, we had a large Backbone.js web application that we were able to get a solid, modern test harness around using Mocha, Chai and Sinon.JS.

I missed writing

By way of a bit more background, software engineering is my second career. Before becoming a full-time geek, I was an intellectual property attorney, focusing on mostly computer software and hardware matters.

While some folks think that the life of a lawyer mostly involves standing up and arguing in court (e.g., “I object!”), the reality is that as a junior associate attorney, you spend nearly all of your time reading and writing legal documents of some type or another. Moreover, as a patent attorney, most of your time is spent writing patent applications and related legal documents. And, patent writing is essentially technical writing, albeit with a bit of a legal bent.

So, coming back to my current life as a software engineer, while I occasionally write blog posts and articles, it had been several years since any substantive writing project. And, I kind of missed it.

And, it seemed like the right time

With that background, Packt Publishing had the good timing to approach me with a book proposal for testing Backbone.js applications in late October of 2012.

I’m not sure the process was particularly selective in my case, as Packt has a reputation for somewhat aggressive recruitment strategies for book authors and reviewers (e.g., they send a lot of emails). But, the subject matter was a good fit for my frontend testing interests, and the book size seemed to make the project tractable.

Read more...

Book Announcement - Backbone.js Testing

Backbone.js Testing Book

I am very pleased to announce that I am in the last stages of publishing Backbone.js Testing - a book on Backbone.js test architecture and development due in final form around the end of June.

A brief abstract of the book’s content is available from the Packt Publishing website:

Frontend web applications are soaring in popularity and the Backbone.js library is leading this charge with a modular, lightweight approach for organizing JavaScript web applications. At the same time, testing client-side JavaScript and Backbone.js programs remains a difficult and tedious undertaking.

Backbone.js Testing brings sensible practices and current techniques to the challenges of Backbone.js test development. The book introduces fundamental testing concepts, comprehensive test infrastructure design, and practical exercises to easily and systematically test modern JavaScript web applications.

The book progresses from Mocha test suites and Chai assertions to advanced test mocks and stubs with Sinon.JS. The requisite libraries and utilities are introduced with in-depth examples and best practices for integration with your applications. The book guides you through the test planning and implementation processes for your application models, views, routers, and other Backbone.js components.

Backbone.js Testing gives you the tools, examples, and assistance to test your Backbone.js web applications thoroughly, quickly, and with confidence.

To provide a better idea of the book’s structure, the tentative chapter titles are as follows:

  1. Setting up a Test Infrastructure
  2. Creating a Backbone.js Application Test Plan
  3. Test Assertions, Specs, and Suites
  4. Test Spies
  5. Test Stubs and Mocks
  6. Automated Web Testing

All of the code examples in the book are provided online at the website backbone-testing.com and as an open source GitHub repository.

Read more...