Makers Academy W7 D2:Emotionally Confusing Test Framework

TL;DR — In which we wrote error messages that walk the fine line between encouraging progress and encouraging self-loathing.

Man Vs Code (Nick Rupp)
4 min readApr 25, 2017
Team CrassWench in Action (Anagram of our initals-don’t ask) Courtesy of Euge!

Overall

Today we constructed what I like to call an ‘emotionally confusing’ coding test framework. The unique selling point? To both encourage and scold a coder in response to their errors. Think of it as the good-cop/bad-cop of test driven development (except awful). Normally, if a test fails you would expect to see a number of obtrusive red lines pop up to alert you to the irrefutably broken nature of your code. However, this was deemed too dull so, enter the Sonupp V1.0.0 test framework. Test failures will either send you brutal messages such as ‘Can’t tell the difference between a text box and a text field? …Give up’ or warm encouragement such as ‘You’re so close to achieving your goals try pointing to a text box!’. We’re shipping next week so get your pre-orders in now.

In other news, today was the first time I helped out a new mentee! He was asking for help on a project that I struggled on myself a while back and I gladly obliged! It’s kind of cool to think that the new bunch will know as much as we do in just 7 weeks! Or, on the flip-side, it’s unbelievable how much I’ve learnt in the last two months and for that I am immensely grateful!

Finally, I think I finally cracked the headstand today. 7 weeks down the yoga pipe line and I can now get into a headstand without a wall! How’s that for improvement? What’s next? Not what’s pictured below that’s for sure..

The sideways crow. 100% would rupture a ligament if I tried to do this.

Daily Podcast:

CodeNewbie was the audio sensation of choice today. However, it was on Wordpress and honestly felt like a 50 minute sales pitch. It probably wasn’t but I was plonked next to a chronic man-spreader on the commute today and was therefore in a slightly unreceptive mood. Don’t really have much more to add on that.

The most feral example of man spreading I’ve seen in hours.

Teamwork

Team Crasswench soared through the morning(See previous post for a more in info on the somewhat questionable name). Split into ‘back-end’ testing team and ‘front-end’ testing squad I felt like we really cracked the back of the small notepad project we were working on.

One thing I would note is that working in a team of 5 on quite a small project is a bit challenging the expression ‘too many cooks spoil the broth’ came to mind. There’s also an odd number of people so one person is always left to be a bit rogue on their own. It sort of shows that you need to break tasks down into small chunks so that everyone can be working on useful parts individually.

Ate at.

Brace yourself. KFC. I think Will was feeling a bit fragile after a 4 day long young farmer’s gathering in cornwall and was craving something a bit greasier than the regular food haunts. So, we took a gander over to visit the colnel near whitechapel. I had the full works zinger tower burger and it tasted, if anything, of nothing but fire sauce and self-loathing. A dreadful combo.

Learnt:

Var in javascript

If you don’t put var before a variable in javascript. It turns into a global variable. This is a code smell of the stinkiest order. Don’t forget those vars.

thisIsAGlobalVariable // Horrendousvar thisIsALocalVariable // Less Horrendous

How to write my own browser tests

Whilst creating web-apps it’s important to be able to test the functionality of the app on the live page. As well as the coding logic in the back end of your site. We were forced to construct tests that pulled information from live webpages and allowed us to run test expectations against the information.

IIFE — Immediately Invoked Function Expressions

Roi (our coach) lead a really useful workshop on Javascript module exporting. This is a bit of a niche topic and was, quite frankly, monstrously confusing. Luckily this was all cleared up. The crux of this was basically the two lines of code below. I don’t know if I have the capacity to fully explain this, so apologies but, hey, it looks nice. I think I’ve actually just included the code below because I just learnt to insert code snippets with a keyboard shortcut and am now just showing off.

function(){console.log(potato)} // Computer self implodes(function(){console.log(potato)})() //Runs it

If you’ve made it this far,

Rupp Love x

--

--

Man Vs Code (Nick Rupp)

Not unlike the popular TV show Man vs. Food but with a tighter budget and more concern for bytes rather than bites. (A record of my time with Makers Academy!)