Let’s talk about mentoring and apprenticeships

Yesterday i had a very pleasant afternoon with Sandro Mancuso from the London Software Craftsmanship Community. The timing was perfect: i had a free afternoon and Sandro had just left Valtech.

Among other things, we discussed the meaning of mentoring and apprenticing. We agreed that they take a range of different forms, with varying degrees of formality.

An informal mentor may be someone you call when you have a problem and want another opinion on how to solve it. Maybe close friend, someone whose advice you value, not necessarily a formal mentorship agreement.

At the other extreme might be an intense apprenticeship where the apprentice lives and works with the mentor. The apprentice’s every need is met by the mentor. Every waking moment together is an opportunity for the mentor to instill values and practices into the apprentice, and for the apprentice to observe and learn from the mentor.

There is plenty of room for varying models between these extremes. Sandro and i got talking about different models, both within a company as a formal apprenticeship program (like we used to have in eden) and externally to a company.

I could talk at length about my opinions of what an apprenticeship program looks like – and i will in a separate post – but i want to start off a discussion among other people who are engaged in apprenticeship programs. What are you trying? What works well? What are the difficulties? How do you work in a way that is mutually fair and beneficial to both the apprentice and the mentor? What payment or expenses does the apprentice receive? How does this differ according to the country’s employment law? What challenges and milestones is the apprentice expected to achieve? How do you determine when the apprenticeship is completed?

This goes beyond Apprenticeship Patterns and gets into implementation details. We need examples of individuals and companies conducting successful apprenticeship programs to see how they are working.

Sandro and i also discussed how we can get the word out to more people. How should we let people know that apprenticeship is a useful way to learn? How could we find people who want an apprentice, and people who want a mentor, and bring them together?

At the moment this seems to happen quite naturally (and i think we would be mistaken to impose much structure on the process) but, as anyone who knows me well is aware, i strive for equality in all situations. It troubles me to think that most people are unaware that apprenticeships exist. We must be missing a vast number of people who would be ideal apprentices but just don’t know that the option is available to them.

To start with, we could all talk a lot more about what is happening. Thank you to Sandro for the discussion that prompted this post. I hope to hear from others and see many more blog posts talking about apprenticeship models and how we can find a way to share these ideas with the software community as a whole.


Build and launch a web shop in a day

My day yesterday began at Winchester station at 05:19 in the morning, with a big ambition:

I arrived in Kent at 08:25 and was met by Alanna who owns Aphrodite’s Desire. We got straight to business. By 08:45 we were settled in with a cup of tea and signing up to Shopify.

Let me back-track a little. We had already had several email conversations and had met previously to discuss options, and decided that Shopify was the best solution. Alanna needed something that is easy to manage, looks good, and can handle orders and payments reliably.

Our first concern was that Alanna’s debit card might not be accepted as Shopify says it wants credit cards. According to two people i spoke to at Shopify, some debit cards work, but not all. Fortunately, Alanna’s Visa card was accepted.

I began by demonstrating how to add products. Alanna’s immediate reaction was, “Oh, it’s just like Facebook!” Alanna was already uploading product photos before i’d even pointed out the option! Huge props to Shopify! Fortunately, Alanna had done a lot of good preparation work writing up descriptions for the products and getting all the photos ready. This was a major advantage to launching in a day.

In the meantime i worked on installing and customising the theme that we’d previously chosen. I asked Alanna’s opinion on a few fonts and we chose some photos for the banner.

I installed the iPhone extension. Alanna had already downloaded the app, and it was cool to see products appearing on the iPhone. We were both impressed by Shopify’s handling of discounted products, and combinations of different variations, some being available and some out of stock. I was impressed at how easily i could extend the theme and add a message that invites people to contact Alanna to ask about unavailable items.

By lunch time we had a pretty good looking shop! We were admiring it on the iPad over lunch. We went out for a quick walk and fresh air before coming back like, “Right! we have a shop to launch! Let’s get to it!”

Adding the facebook and twitter integration was fun. You can ‘like’ products and add comments and it all gets synchronized to facebook. Alanna can click a button to promote products on twitter and facebook. It’s great! Shopify extension apps are awesome!

We spent a bit of time doing the PayPal integration, and then a lot of time signing up for Sage Pay. A lesson learnt: if you want to accept credit/debit cards directly on day 1, you must apply for your Sage Pay merchant account in advance. But it wasn’t so bad to launch only with PayPal.

We had a dilemma when it came to shipping options. Because Alanna hadn’t weighed any of the products, we were leaving them all as weighing nothing. But this meant we couldn’t calculate the shipping. Alanna wanted to charge £5 for a single product, and £1 extra for every additional product. So we came up with the idea of making every product weigh 1lb just so that we can count them in the cart.

That being done, we just needed to tidy up the additional pages and navigation links. I was keen for Alanna to do this, so as to be able to do it again in the future. Shopify provides a very nice content management system which is simple to use. I did a little bit of graphics work on images for Alanna to use.

I think it was about 17:00 when we launched! We spent about half an hour tweeting and facebooking about it like crazy … and then an order came in! Alanna was just looking at the iPhone app and said something like, “Oh, is something wrong here? It says …” and it was an order from one of my friends!

Fantastic! A working web shop in one day! It is totally possible! The shop had 171 unique visitors on its first day.

My day ended with this from my mentor:

I went to bed feeling very satisfied and utterly amazed at knowing i get paid to have a lot of fun and do what i really love to do. It was a brilliant day!

Please visit aphroditesdesire.com to have a look at what we did. Kisses to shopify.com for making it all possible!

Welcome to Rohit, my new apprentice!

I have spent the last 8 weeks working at a consulting, design and development company in London. I’ve had a fantastic time, felt very welcome and i know that together we did some amazing work.

While i was there i had the pleasure of getting to know Rohit Gogna, who is employed there as a Quality Assurance Tester. Straight away i knew that there was something different about Rohit. In fact i commented early on that i’d never known such an enthusiastic tester. The following quote shows how Ro thinks of testing:

Software Testing is not a job … it’s a passion that turns into a career.

Rohit is keen to create a community of testers in London. LondonTester.com is Ro’s initiative to help testers find jobs and share knowledge. Ro is very keen to improve, learn new techniques and share with other people. In short, perfect apprenticeship material.

I encouraged Ro a lot over the 8 weeks. We spoke about my other apprentices, and what apprenticing and mentoring mean. I encouraged Ro to seek mentors who can guide and channel this enthusiasm, because i can see so much potential, provided Ro receives the right support.

I did not offer myself as a mentor; i waited for Ro to ask me, something like the moment in Avatar when Jake has become one of the Na’vi people and may choose a partner. Jake wants Neytiri but says “she must also choose me”. Neytiri says, “She already has”. If you are an apprentice and want a mentor, you should be the one to ask. Chances are that person might already want to mentor you but is waiting to see if you ask for it!

I take mentoring very seriously, so i made sure Ro knew exactly what would be involved, and knew that it would be hard work and painful at times. Ro understood and was still keen, so we shook hands to begin the formal arrangement, and went to skype call my mentor Enrique to share the great news!

Initially, i want to get Ro learning and blogging about automated test tools, starting with Selenium. I also want Ro to have a second mentor: someone who is more knowledgeable about testing and mentor Ro on these things that i don’t know so well. We’ll get networking and meeting people to see if we can find someone just right.

So please, follow Ro on twitter: Testerpedia, and watch with me, with pride, as we see Ro’s full potential begin to emerge!

How BDD focusses on the ‘why’

Today i got talking with somebody who was unconvinced of the benefits of behaviour driven development. I hope i’m not misquoting them, but they seemed to be saying that BDD doesn’t tell you why something happens, only what happens.

This person also said that BDD doesn’t encourage you to code correctly. That i agree with. You can code poorly with any test tools or development framework. The only thing that’s going to encourage you to code cleanly is your own standards, or those that are instilled into you by requirement, or pair programming, or code review.

To me, the focus on the why is a key difference of BDD as opposed to TDD. Here’s an example for comparison:

Test First Development tells you that you’re going to use an Array of names and it’s going to receive the shuffle method. You write the test because you’ve already decided that’s what you’re going to do. It is brittle because a change in the code will require you to rewrite the test.

Test Driven Development says that somehow some names are going to be input, and after the process they’ll come out in a random order. It doesn’t necessarily mind whether you use an Array, Hash, a shuffle method or write your own randomising function. You let the tests drive you to make those decisions when you need to.

Behaviour Driven Development tells you about me as a key stakeholder, and that i want to draw names in a random order, so that i can assign prizes fairly. It tells a story about the people entering, explaining in natural language that the names are drawn out of a hat, and when they are, the first randomly chosen person picked gets the first prize, and their name is put aside so that they don’t win another prize. How you implement the details to achieve this behaviour is entirely up to you as a developer. But you should understand quite well what you’re expecting to achieve, and why.

Okay, i know, it’s a horrible example because it’s quite difficult to test for randomness. Given an unbiased coin / When i flip the coin / Then i should get … either heads or tails … Anyway, hopefully those examples show how i consider the test methodologies to differ.

My mentor Enrique recently helped me to understand BDD, particularly Cucumber scenarios, as documentation of the understanding between the client and the developer. It just so happens that you can execute this documentation to help you write your code, and continue to use it for regression testing.

Now i pass over to you, my readers! Are your opinions different from mine? What have i missed out, misunderstood, or misrepresented? I’m not an expert here! Fortunately, you don’t need to be a BDD expert to benefit from using it! :)

Celebrating a fantastic Code Retreat day

Today, Saturday 7th May 2011, there were six code retreats around the world! They were in Belgium, Spain, UK, USA, and two in Romania! We all did the same challenge: implementing Conway’s Game of Life in pairs, using test-driven development, in iterations of 45 minutes, discarding code at the end of every iteration and pairing with somebody different for the next iteration. We introduced a few extra challenges in every session! ;)

I co-facilitated the code retreat at Sheffield University. We had 18 participants: a good mix of computer science students, professional programmers, people who code for fun, and someone who seemed to have been dragged along but got thoroughly stuck into solving the problem along with everyone else! :)

Tom Crayford co-facilitated with me, and Chris Murray ran around making sure everything went extremely smoothly.

Code Retreat Sheffield - Coding

In iteration 1 we gave everyone chance to explore the problem without heckling to see how they would do. The only special challenge was to pair with someone they didn’t know. In the retrospective we talked about the languages and classes used.

For iteration 2 we talked about TDD as in, letting the tests really drive the code in the direction they want to go. We challenged people to do the very simplest thing they could possibly do at each stage. Many people found themselves writing unnecessary code, so we kept bringing them back to the rules of the game. The retrospective brought up questions of where to start, and whether a cell should be responsible for its own state, or whether a separate entity should know where all the cells are.

In iteration 3 we encouraged people to try a different starting point, to see how that worked. We stipulated that the code could not contain any booleans, like true or false or strings or numbers representing boolean states. The third iteration was sneakily only 30 minutes long, which we didn’t tell anyone until after the retrospective! There was a good discussion about using a grid to hold the cells, versus having an array of cells who know their coordinate position.

Code Retreat Sheffield - Skype link to Timisoara

Throughout the day, at various points, we were able to have Skype video calls with other code retreats. We found this very enjoyable: we discussed the different implementation options with other people who were also tackling the same problems. During the day, Sheffield managed to communicate with all the other code retreats: Valladolid in Spain, Cronos in Belgium, Bucharest and Timisoara in Romania, and finally, towards the end of our day, Pittsburgh in Pennsylvania, USA, just as they were at the end of their second iteration.

Code Retreat Sheffield - live updates!

We also had two projectors constantly showing the twitter #coderetreat hashtag on tweetviz.com and a slideshow of pictures on hashalbum.com. These things really helped us to feel connected to a bigger community of people sharing a similar experience at the same time.

Code Retreat Sheffield - Lunch

After lunch we introduced Keith Braithwaite’s TDD as if you meant it and for iteration 4 we challenged people to obey the strict structure given. The purpose of this was to really break everyone’s normal processes to avoid mental shortcuts. It really ensures that the solution is exactly what the tests require, and nothing more. It was a tough challenge but it was taken well. A lot of people found they came to a better solution when these restrictions were applied.

In iteration 5 nobody was allowed to use if statements. (Or case statements, ternary operators, etc.) We also focussed on ping pong pair programming. This is where one person writes the test, the other person writes just enough code to make it pass, then writes the next test and hands back. During the day i had seen a lot of rather uneven pairing, where one person was doing most of the work, and the other was mostly just watching and commenting. Ping pong helps to address that by bouncing back equally between the two. Comments in the retrospective were that you had to concentrate harder, and felt more engaged because of it. I was surprised that many people had not paired that way before.

Iteration 6 was the last one for us. (Unlike Valladolid who went on to 8 iterations!) We gave people a bit longer and told them to just enjoy this one. The restrictions were that no method could be more than 3 lines long, and the code you wrote had to be the best you could possibly do. You had to write something you could be totally proud of. For most people, they said their code wasn’t the best they could possibly do, but they were definitely proud of it! :)

Code Retreat Sheffield - Retrospective

At the end of the day we did a raffle. Entry to the raffle was by way of a donation to Bletchley Park, for which we raised £200. Names were shuffled in a Ruby array and winners received either a copy of Apprenticeship Patterns or a software craftsmanship motivational calendar.

With that done, all that was left was a trip to the pub to relax after a good day’s work! :D

Thanks and kisses

I thank Tom for being a fantastic co-facilitator, and Chris for doing an excellent job of organising everything: food, refreshments, sponsorship, venue, my hotel last night, and probably a whole lot more that went so smoothly it was unnoticed.

Thank you very much indeed to the sponsors and supporters: epiGenesys, University of Sheffield Enterprise, O’Reilly UK and The GIST Foundation. It would have not been nearly as awesome without your help.

Thanks to all the people around the world who talked to us over Skype – it was great to feel part of something so much bigger than just us.

Thank you so very much to everybody who participated today. You really made it a great day for everyone.

Why i’m voting YES to AV

This time last year i got an MP who i didn’t vote for. An MP that more than half of Winchester did not vote for. I was very upset at the result across the country: the number of MPs was thoroughly disproportionate to the number of votes cast. Here’s a reminder:

UK General Election 2010

I went on a march in Trafalgar Square, i got a tshirt for Unlock Democracy, i led a debate on why First Past The Post is an undemocratic system (and won the debate!), i blogged and tweeted, and i talked to lots of people about how the system could be better.

In my opinion, the Alternative Vote, while not perfect, is certainly a vast improvement on FPTP. With AV, in Winchester last year, we could have found out the second preference of the people who voted for the smaller parties. It’s possible they may have supported the winning candidate, pushing the support up past 50%. Or they may have preferred the runner-up. But we would know that the winner under AV had support from at least half of the constituency.

I just voted #Yes2AV! on Twitpic

So … tomorrow is our chance. A once-in-a-lifetime opportunity to make a significant difference. I have absolutely no idea how the referendum will turn out, but i want to encourage everyone who has the opportunity to vote, to do so. When do we ever get to help make a big decision like this?! I find it awesome to think that – hey – it’s up to us! For once, we’re not going to have the decision made for us by politicians.

I’m voting yes because i want a fairer voting system. I want an end to tactical voting. I want to know that my MP has a majority support. I want to be able to vote honestly. I want to help establish a better democracy for generations to come.

To be clear: A vote yes to AV is not a vote for Nick Clegg. A vote no to AV is not a vote for David Cameron. This is simply a vote on whether we want to fix the flawed voting system that produces results that don’t represent us.