June 2015

Gavin Pickin

Post Conference - Session Review - How do I Write Testable Javascript?

Conferences, Dev.Objective, Javascript, jQuery, Unit Testing

dev.Objective() has come and gone, and like my Cordova Hooks session, I wanted to write a review of the session, and provide some additional information for those who attended, or those who wanted to attend. The conference was a blast, lots of great info, lots of great people, one of my highlights of the year... so many talented people, and whether you are in the sessions, or in the hallways, there is always something to learn. I submitted this session because although there is a lot of great information on testing, sometimes the hardest steps are the first steps, and most people are live and breathe testing, forget the first few steps, and how many stumbling points they ran across from. Hopefully this session will help everyone get started with Javascript testing.

I did mean to write this sooner, but I got carried away with the deep dives on each of my Cordova Hooks, so I'll try and split the next few posts 50/50 with a little of both. I think the session and the slides gave the users a lot of useful information, I wanted to dive deeper into some of the topics, to make it clear for those who didn't attend, or maybe some of those who did attend, but will not be able to actually put this into action until later, and essentially be starting from ground zero.

I have a Mini Website setup for this session, which includes the Powerpoint, and PDF of the slides, and links to various relevant information, like the github repo for my spaghetti code refactor, and these blog posts, as I release them. Please bookmark my mini site and refer back as needed:

Session Review

I was really concerned with this session, I knew Javascript is a hot topic and thought there would be a good number of people attending, and I wanted to make sure I delivered value to each and every person. This session was aimed at the real beginner in testing, I hoped that came across well in the description of the session. In short, a lot of pressure, I just hoped it lived up to the expectations.

We were in the Cedar room, alongside the hallway, seating approx 50, I thought if I got half the room, that would be a good session. Before the session was supposed to start, I was passing chairs from the last Panel session held in that room to several people forced to sit on the floor in the back of the room. It was packed, it was awesome to have that many people show up to hear what I had to say... but that just meant more pressure to deliver... a lot of people showing up is one thing, will a lot of people get what they wanted out of it?

The first thing I said to the group, after offering the extra chairs, I asked what levels of experience the audience had with Testing Javascript. It was an expectedly low number of hands shown. I expanded that to see how many test their server language code, and more raised their hand, but still surprisingly low number of developers. I think a lot of people realize the value of testing, but its hard to START testing, and hopefully this session helped the attendees to get started.

1 hour later, the end of the session was upon us, and I was still trying to squeeze in a little more, we heard the clattering of dishes in the hallway, so I said :

"Thank you to everyone who came, as you can hear, its lunch time already, if you want to head to lunch already, I completely understand, if you want to wait to see my show you how to get Grunt Watch and Grunt Jasmine running in Sublime, I'd love to keep going and show you that too."

To my surprise, only 2-3 got up and headed to lunch, but the rest stayed and listened as I continued. That was the true sign to me, that I had given a good session, and they wanted to hear more. Even the sounds and smells of lunch were not enough to drag them out of my session. Of course, they might have all being really "NICE", but I don't believe that many people would put my feelings ahead of their own lunch lol.

After showing the Sublime Package Control Package Manager in action, getting Grunt and Jasmine running in minutes, we all went to lunch. While packing up, a couple of attendees came up, and chit chatted with me, and even installed the Grunt Plugin right there while I bagged up my cables. We carried our conversations over to lunch, and several people hit me up in the hallways, and on twitter to go a little deeper. If you have questions, feel free to reach out, I'm not the best, but I'll do what I can to help.

I was really happy with the way the session turned out, and I think that everyone got some value out of the session. I know the quick comparison of the testing frameworks was valuable, and showing the tools like Grunt Watch and Grunt Jasmine vs Node Jasmine really made it seem more approachable.

One of the big pieces of value, IMHO, was taking the Spaghetti Code example, and going through step by step, to boil the code down, and slowly make it better and better. Slowly cleaner up the code, extracting functions, adding tests, step by step. The process even showed some missteps so you could see how I changed my mind halfway through the process. I know its not perfect code, but its more about the process, and I wish I had the opportunity to work at this level with people on a regular basis. 

I have shown that to members of our user groups, and I want to break this down in a blog series, or maybe even a screencast, because it's really good to see how people break down their code, how they refactor. Let me know if you would like to see this? The code itself, is on my mini site, and on my github, each step, is broken down into branches, so you can check in and check out branches, to see whats changed.

Thanks to all of you who attended, I enjoyed giving the talk, and hope you all got what you wanted out of it.
Bookmark my mini site, as I add more content to my blog, whether it be blogs, or videos, I'll make sure to update that mini site page so all the relevant content is there.

Mini site:

Blog Search