CodeMash 2013 Day 3 Session 4

CodeMash

# Getting Good – Integrating Novice Developers
Elise Worthy @eliseworthy

Elise went through Hungry Academy and has only been a professional developer for the past 6 months.

## How do we address the need for developers?
We could hire by lowering our standards. NOT
Instead, bring in and train willing people
Randomness can help break out of bad habits, too.
A small portion of our time is spent writing code anyway.
A group of similarly trained experts will have similar solutions and you will end up with global maximums.
A group of diverse backgrounds will bring different solutions.
Similar to the theory of hiring consultants (which sometimes works really well, but often ends up in horific places)

## Hungry Academy profiles
### Three profiles
Horace – former architect (REAL architect)
Jan – QA specialist
Mary – Customer Service rep at Living Social

Why beginners? You want novel problem solvers.
How do you find them?
Overcoming selection bias – you want functional diversity
Availability – you’ll look to your friends who are very much like you, usually
Appearance – impacts people’s perception no matter how much we try to avoid them (if you look smart you must be smart)

Pick a well-rounded team, not an expert team.

## Hungry Academy
LivingSocial decided it would be easier to find and train 24 people with potential than to find more ruby devs
24 students
5 months
40 hours classroom per week
20-30 hours homework per week
Took them from nothing to developer (like actually be able to go through the hiring process at LivingSocial)
LivingSocial paid them a salary while they were in training and we offered jobs at the end
No contract – they were expected to work for LS, but it wasn’t required (LS did not expect to hire everyone). They did actually hire all 24, though.
The intensity was such that they actually expected some to wash out (they weren’t trying to wash them out)
After 6 months all of them are still there
You can see a lot of the syllabus online still, too.

## How
Allow them to adapt – have a selection of criteria to grade by and give 1-5 scores. The categories are such that it is impossible for someone to get 5s on everything so they would focus on what they could do well. Also helped place developers at the end of the process.
Also forced students to do things they were bad at just to stretch them out.
Holds attention because they had things they could be good at.
As a teacher don’t spend a lot of time with “the kid that really gets it” because they will learn without you anyway. Focus on the people that aren’t quite getting it instead, even if you could have more fun challenging the overachiever.
Make sure to provide tight feedback loops so that they know how they are doing and can get corrected. Better than springing it on them after 6 months or a year. Just like development.
There is a 6 facets of understanding model – explain, interpret, apply, have perspective, empathize, have self-knowledge
Use that model to determine if someone is learning and understanding.

## In Practice
Autonomy – let individuals control their own destiny
How do you do that for newbies?
Mastery
Purpose – don’t just throw the crap work at them

Conflict is OK, but you can’t let it get out of control

Liking – you work better with people if you like them. Stupid icebreaker activities actually do help here, believe it or not.
Common Goal/Individual Ownership – so, give feedback so that they can own the project and will work towards the common goal.
Consistency – team leaders and mentors HAVE TO BUY IN – if they are not willing then any efforts to bring in newbies will fail

## Habits
0 – Must have a technical mentor, preferably on the same project
1 – Take nothing for granted and set expectations early
2 – Design a pairing schedule. Beware of the “expert” driving too much
3 – All code reviewed, especially via pull requests
4 – Set dedicated learning time with self-chosen objectives (during the workday)

CodeMash 2013 Day 3 Session 3

CodeMash

# Functional Testing with ASP.Net MVC
Jimmy Bogard

“If you’re writing unit tests for your controllers then you are wasting your time.”
“Ronald McDonald Screen” – an ASP.Net error page.
Unit tests don’t tell you that your application works.
Functional Tests – write tests as if your user were using the application.
Frees manual QA up for finding the edge cases – leave the computer to run the test scripts.
Selenium and WatiN are tools that automate your browser. Wrote NUnit tests to actually run the tests. Gallio can embed images in test reports and WatiN can take screenshots.
Do not use test recorders because they are extremely brittle.
The straightforward dumb UI test becomes very hard to maintain after time.

## Design for Testability
Because you own the application you can make changes to make it more testable.
Get your browser automation tool out pf your unit tests.
WatiN is COM based and requires STA (single apartment thread) attributes around it. If you don’t like it (and I think you should not like it) use Selenium instead.
You can use “rel” tags to define what you are controlling instead of the actual text or “id” attributes – less brittle.
Black box tests know nothing about your system. They are harder to use and maintain, so avoid them. It is OK for your tests to know how your application works.
It is OK to have your tests know about view models and strongly typed views. That’s how you keep them from being brittle – the shared knowledge.

CodeMash 2013 Day 3 Session 2

CodeMash

# Objective-C is not Java
Chris Adamson – @invalidname

Language is effectively owned by Apple now and tied to versions of XCode. gcc is rapidly getting out of date from XCode and should not really be used anymore.
Single inheritence model.
Method calls [object method];
[object method: param1 paramName2: param2];
Method calls are really message dispatches
Slides (from which he is pretty much reading) are available at his slideshare account, so I think it’s two feet time.

I did at least learn enough about Objective-C to see that no sane developer would ever willing use it. All those square braces are crazy. I do like the message-passing concept, though.

CodeMash 2013 Day 3, Session 1

CodeMash

# Puppet for Developers
Eric Hankinson

## Automating your infrastructure
If your infrastructure is code, you can make it testable and version control it. Automation ensures that it truly is repeatable.
Puppet isn’t just for *nix-based OSes – it works on Windows, too.
Removing manual processes removes the chances for errors.

## Puppet Model
There is a Configuration language.
Puppet master and nodes or standalone.
Resources are the parts of your system.
Facter is another piece that lets you define facts (OS version, ipaddresses, etc.)
Nodes are called agents.

## Puppet Language Basics
You can include other scripts and require dependencies
There is support for variables and conditionals
The language appears to be a DSL with some aspects stolen from Java, Ruby, and JavaScript. _I’ll need to research that further._
Lots of slides of code but the spoken words are more vague. The slides of code are mostly just wallpaper.
There are templating capabilties that you can use to pump out configuration files for your services.
You can use inheritence to define a general machine configuration and then specify specifics for each machine of that type (so a web server config with overrides for the ip addresses)
You can build custom parsers to do things like pulling your password and secrets from some other source (you wouldn’t want to check in a secret)

## Custom Modules
There is a Puppet Forge that has lots of already defined custom modules for a lot of existing tools. Not a lot of Windows content, though.
To create a module: puppet module generate leandog-fatcat
Term before the dash is the company name, term after is the module name. Company name is required, so you have to have a dash.
There is an expected folder structure generated that you can use to put the appropriate items in
There is a module file you need to create that has the metadata about the module.
rspec-puppet allows you to use rspec to test your puppet modules
puppet module build will build your module so that you can deploy and use it.
http://forge.puppetlabs.com is a repository of puppet modules – it does not contain the module code but provides a list. You are supposed to put a link to your github repo where the module lives

## Vagrant
Vagrant manages virtual machines
Can manage VMWare or VirtualBox VMs
Puppet and Vagrant work well together

CodeMash 2013 Precompiler Day 2, Session Two

CodeMash

This afternoon’s session is Real-world JavaScript Testing with Justin Searls. This is supposed to be fairly hands on so I apologize if my notes aren’t very good since I will be focusing on doing. 🙂

We will be using a tool that TestDouble (the presenter’s company) built called lineman. It will run tests upon the file being saved. The test framework we are using is Jasmine, which has it’s roots in RSpec. QUnit is also a reasonable alternative.

Jasmine has spies, which are test doubles. Invoked by calling spyOn(<object>, <methodname>) – so, spyOn(loading, ‘show’).

Inject HTML into your tests with jasmine-fixture to avoid your testing being too reliant on the DOM.

You can use JSLint or JSHint to do static analysis of your JavaScript. CoffeeScript code is guaranteed to pass JSLint.

jasmine-given gives you a given-when-then syntax for your tests which many people consider more readable and intuitive.

And then we started pairing and writing some code and tests. Good stuff!