Code in the open
The text of this post is taken form the README of my newest project on GitHub test-tube.
Description
After reading a couple of blog posts about coding in the open and using public scrutiny to motivate yourself I decided to try an experiment. I’ll not only use GitHub to post the code openly, but also to solicit feedback on how to architect (I hate the a-word but can’t think of a better one.) the project and get ideas for potential features. (Mostly likely no one will ever see this but I’m writing it anyway.)
A brief history:
I started thinking about this project because once upon a time the people who sat across from me were web developers. They mostly produced HTML, CSS and Javascript that was actually seen by customers. I was working on applications that communicated server to server and didn’t have to have a pretty face. Frequently people, usually folks with manager in their job title, would come over and say, “Can you do X?” or “Could you just change Y?”. The justification was always “I feel like blah blah…” or “The customers will want mreh…”
Just overhearing these conversations was annoying. Everyone was trying to guess what the customer wanted (or more likely inject what they liked and wanted believing that everyone else thinks like them). I decided, should I ever write code that sees the light of day, I never under any circumstances wanted to be stuck in this conversation. It’s not an original idea by a long shot. Many successful companies test the living hell out of every aspect of their experience. A few years ago I went to see the (then) director of Netflix user interface (UI) team give a talk about UI design. Netflix has a great UI and I was hoping find out what the secret sauce was. He had nothing. I learned nothing about designing good UI that night, the only thing I did learn was that they never made strong decisions about the UI. They just narrowed it down to a few possibilities and threw up for testing.
So this all boils down to: When building a web app how can I test absolutely EVERYTHING? Not just bits of the UI, but search algorithms, AJAX interactions … everything. That’s the purpose of this project.
If this seems like an interesting problem please get in touch. Message me on GitHub, leave a comment, create a fork, whatever. Any all code and/or decisions are up for debate and review.
A few details:
- I have chosen to try and integrate with the Google Analytics and Site Optimizer tools. Google Analytics works well and hosting your own data collection, analysis and reporting seems like complexity to be avoided if possible.
- I’m thinking about having both MERB and Rails versions for anything web app specific. I like MERB and was originally thinking of just making this project a MERB slice and some helpers but since I’ve decided to try and elicit community input, Rails just has a much bigger following. Also, it really shouldn’t be that hard to do both. They’re quite similar in many ways.
Proposed Features
- View helpers for including Google Analytics JavaScript code. (There are a lot of other projects out there that do this already. I’ll probably just extend one of them since I haven’t seen one that has helper methods for the full JavaScript tracking API.)
- View helpers for Google Site Optimizer.
- Application is aware of tests in progress. (Haven’t fully thought through how this might be achieved since Google doesn’t provide an API…)
- Routing based on running tests so that A/B tests can be served from the same URLs.
- Anything else you might suggest…
Synopsis
The only thing that has been implemented so far is a module to support routing based to different controller methods using the same URI. I actual do this by having a mutable method that can route the call to a Proc based on a discriminator Proc that identifies if the call is requesting a particular test case. You might say, “Gee, that just sounds like a complicated case statement.” It sort of is. The main reason that I wrote it that way was to experiment with metaprogramming, and figure out how to write specs for metaprogramming code that verified it and clearly expressed its behavior. All those folks writing blog posts saying “Monkey patching is evil because it’s hard to [debug|test].” You’re wrong.
After all this if you’re interested head on over to GitHub.













My name is