Skip to main content

Posts

Coaching is a transferable skill

It's been interesting over the last year for me as I explore where coaching for software teams and  coaching for sports people overlaps. This year I got to be coach for a Roller Derby team which is the first time I've called myself a coach for more than a brief workshop. In my day job I'm involved in many activities that have nothing to do with coaching so I rarely call myself an Agile Coach. But to that sports team I am the  coach. And while  I've been involved with Roller Derby for 5 years I have very little training in coaching sports teams so I started applying all the things I've learned coaching software teams. The Empire - Roller Derby team We built a manifest of shared goals I can't take all the credit for this one as the team created one before I joined them as coach. But I couldn't be more happy with it as that was one of my first goals. I wanted something that helped defined who we are as a team distinct from other skaters and teams. I als...

What role are your tests serving.

We had a discussion at work after watching the excellent Kelvin Henney talk about good unit tests . And it helped me clarify the many roles tests play and why people get a habit of complaining about their tests getting in the way. So here is the four categories a test is trying to balance: Requirements Regression Documentation Refactoring guide Most test today are written as requirements . And this is a huge improvement over the past when we'd write tests later and try and get code coverage. Those 'later' tests are useless. The requirement tests happen for high level acceptance tests and in low level TDD too. Your test defines a behaviour you want. Once your test passes you don't go back to change it at all beyond some obvious cleanups like code duplication. These tests allow rapid development and reliable progress. But they can hinder refactoring, provide poor feedback on failures for regression and may be too implementation focused to be readable. And eas...

When Agile is not common sense

It's been about 8 years since I got my Agile training from James Grenning and started an Agile Pilot with my team. Right from the start I was super keen and got people practising TDD and Pair Programming even though I didn't really know if that effort would pay off. I just knew we had lots of problems with the old way so I wanted to embrace the new. So I'd run my own little sessions with the broader team in Sydney sharing Agile concepts and ideas. Giving us a chance to discuss things and keep learning long after James had left. But often I would present new ideas and a few people in the group would respond "oh of course, that's just common sense". Initially I thought it was great as they were embracing these ideas as valuable even though it was not what we were doing before. But after a while I started to get frustrated because they we're not really listening. If some small part of a concept fit nicely with their "common sense" then they took ...

Applying the Toyota Kata

Last year I got to attend a workshop on the Toyota Kata by Hakan Forss  and I could immediately see how it could be useful but I didn't have an obvious place to apply it until recently. So what is the Toyota Kata? I see it as an alternative to retrospectives. It lets you define a collection of goals and run experiments to see if you can get progress towards that goal. Unlike retrospectives you can define goals that may seem distant (release to customers on every passing commit), may be simply something you want to maintain (have zero bugs in production) or be impossible (have zero wait time in moving a story from backlog to done). Once you've built this collection of measurable goals you decide what you're going to try and your expected outcome (we will to TDD and have 50% less bugs in production). You can define what the period is before you check in again and decide on the next step. But as with anything Agile; shorter is better. You can work it into a normal two week ...

So I've been advised to create a Coaching Manual

I'm trying to build up my skills as an Agile Coach. In a way I've been doing this already now for about 8 years. But it's getting a bit more structure and organisation. The way I see it learning is part of software development. It always has been. Some people get comfortable with their knowledge and workload and stop learning but that has never been me. When I get too comfortable I start looking for something else to do. But my learnings are just a jumble in my brain. Sometimes it impresses me as I can pull out a name, a quote or apply a process to something specific. And sometimes it lets me down so I have to revisit and revise like I'm doing right now. I'm listening to Esther Derby talk about her Six Rules of Change and writing this at the same time. Not something I recommend but I just want a refresher as I've studied it before. I'll probably grab the slides later and use it as part of a mini-presentation. Sorry you just ran into my jumble. What I...

Things I’ve learned from running lean coffee and why you should organise one too

I’ve been running a 30 minute lean coffee session in my workplace every two weeks for 18 months now. Our first meeting for this year is tomorrow. I started the sessions when a bunch of people from work went to the Agile Australia conference and we wanted people to keep sharing ideas and other learnings. Now I invite any software developer in the building so my invite list has grown to 99 people but I typically only get about 10. How lean coffee works: A few people from work got to take part in one at Agile Australia but I missed it myself. So I just got online and read everything at http://leancoffee.org/ I grabbed a bunch of index cards and texters and was ready to go. I feel it’s super important to my company as it’s the only time people from all the software development teams can meet each other and discuss things. It’s helping break down walls between teams and helping ensure learnings can spread to other teams quicker. Location matters. I started off in the building’s ...

Can Programmers Test?

I spend a lot of time working closely with programmers on the software testing process. Much of my career mission is to get more people embracing techniques like Test Driven Development. As I push more and more of the testing demands onto the developers I sometimes run into people who say they need a tester for "independent testing". It's a concept I'm familiar with from early days in my career. A tester can look at the system and requirements with fresh eyes and find all those cases the programmer didn't consider. If the programmer does all the testing they'll be too tempted to just test the cases they know the code is handling and not discover any new areas where bugs may be hiding. The problem I have with this idea is I never was that type of programmer. As a programmer if I didn't test something it was purely out of laziness and arrogance. I'm a big supporter of Larry Wall's  three great virtues of a programmer. A lazy programmer will d...

How to Write Code Fast

Start with a clean slate with simple goals Starting from scratch is such a rarely privilege in professional programming. We get to do it all the time when we’re learning and trying things out. In our early years getting stuck and stumbled on the most trivial challenges. And later being proud of the frameworks and architectures we can build in days (sometimes hours). But there is rarely any money to be made in building something from scratch. There is no value in doing something trivial because it likely has already been done a thousand times before. So we need to add something to existing code. Maybe it’s something we already developed ourselves or something we bought. If we’re lucky the existing code is modular enough that the new feature can feel like starting with a clean slate and give us that burst of speed. So you will often hear the cries from programmers that are working with that monolithic and aging code; “please, please let us rewrite this code from scratch”. I’ve mad...

What to test when testing Javascript

Part two in the series  Test Driven Development with Javascript. By now you've probably read and heard a lot warning you off testing through the UI and testing the user interface generally. Those still holds true for Javascript so you may be wondering if there is anything left to test. Time for some code! Not very testable code function validate() {     if(document.simple_form.name.value == "" ||         document.simple_form.email.value == "")     {         alert("Please fill out all fields before clicking submit!");         return false;     } } In this there is some logic that is not directly tied to the UI. So there is something we can test. But it’ll need a bit of a rework to make it testable function isFormValid(formElement) {     return (formElement.name.value != "" && formElement.email.value != ""); } function validate() {   ...

Test Driven Development with Javascript

I've had a few opportunities to put my TDD skills to use in this brave new frontier. So I wanted to share what I've learned, what pitfalls to avoid and where the low hanging fruit is. Why use TDD in Javascript? We've reached a point where few people can develop an application without there being a web interface included. And now it's not enough to build a website with a few forms and buttons it has to be a "web application" with the detailed user interface and responsiveness we would expect of a desktop application. Javascript is serious business. Clients are not going to compliment you on your stable and fully tested backend if the UI is painful. When should you  not  use TDD in Javascript? Javascript has a strange distinction. It is the most widely used programming language in the world. It is also the most disliked programming language in the world. It can be hard to get programmers to  learn  Javascript before they dive into writing Javascript. S...

Place to discuss Agile topics

I haven't been completely idle. Appart from my rambings on twitter and google+ I've also been making regular posts to a new facebook group on Agile Software Development . I will return to talk about RestScriptFixture, fun with NodeJS and are games (like movies) out of new ideas?

RestFixture

So most of the tests I'm writing now in Fitnesse are using RestFixture . Being able to do all this black box style testing has helped me get a lot of tests up and running without having to change the existing code base. Now I've taken a step future with my own little fork  so I can use scenarios and build nice BDD style scripts. But first I want to give me own quick guide to using RestFixture Step 1: Installing You can dive straight in by grabbing the latest jar files for RestFixture here  https://github.com/smartrics/RestFixture/downloads If you know what you're doing can get the nodep version to work nicely along side other libraries you may be including in Fitnesse. But I grabbed the 'full' version and unzipped it into a RestFixture folder alongside my FitNesseRoot folder. Step 2: Write your first test I took advantage of the built in Fitnesse api as a basic test and wrote a page called RestFixture with the following contents !define TEST_SYSTEM {slim} !...

JDBC Fixture

I created this class so I can run basic database commands from within Fitnesse. Dropping SQL into a Fitnesse page not recommended but it can still be a useful tool for a few reasons: It is reusable so you can drop it into lots of tests without making new classes all the time It's a good bridging tool in trying to get developers using fitnesse who are not used to creating an abstraction layer for their tests It's handy to combine with RestFixture when you need to adjust or validate the data but cannot do it through a rest command But again it's not recommended. Better to create a new fixture with a function like public void createNewUser(String name, String password) Here is what running the JDBCFixture looks like in the fitnesse !path lib/*.jar !|import | |com.warmage.util.fixtures| !|script|DBQueryFixture|mydatabase |user |pass | |check |statement |UPDATE users SET city='New York...

Skipping over fitnesse tutorial

I was thinking of writing a short bit on writing tests in Fitnesse . But instead I'm going to recommend the tutorials by Brett L. Schuchert http://schuchert.wikispaces.com/FitNesse.Tutorials as they skip straight into using SLIM. The guides on fitnesse.org (and with the install) are good but explain everything with FIT first before racing though what is different with SLIM. That's just the nature of how Fitnesse was developed but it's worth skipping straight to SLIM as it has less requirements and can be more flexable.

Setting up Fitnesse on Ubuntu in 7 steps

Some pretty basic steps but just to make sure it's here for everyone to see. Setting up fitnesse and running the jar is easy enough. Just go to http://fitnesse.org/ and get started and do it on your desktop just to see it in action. But for me that wasn't good enough I wanted it to run as service on ubuntu. I stole a few tricks from how ubuntu runs jenkins and setup fitnesse a similar way. 1. Create a user and group for fitnesse (optional) I didn't do this because I wanted tomcat, jenkins and fitnesse all running as the same user. Call it laziness to avoid any permissions classing but it doesn't change the process that you need to create or choose what user you're going to make it run as. Don't make it run as your user or root! 2. Download the jar file and place it in /usr/share/fitnesse Make the folder too of course. It can belong to root as long as the fitnesse user has read access 3. Create the folder to run in at /var/lib/fitnesse Fitnesse user needs...

Fitnesse

Anyone who has worked with me in the last 3 years knows I have a programmer crush on Uncle Bob and I got most of my initial training on Agile development from James Grenning . So it was just a matter of time until I started using Fitnesse . Now fitnesse (and fit originally) is an interesting tool to try and get acceptance tests OUT of code. After all why should programmers (or programmer-ish testers) be the only ones to write, read and review these tests? Acceptance testing is about making sure you deliver what the customer wanted so shouldn't the customer and other management people be reading them too? So fitnesse meets them in a middle ground. A wiki. A wiki is a good place to go because you can get a manager or customer to read a wiki. You can, with a bit of a push, even get them to start contributing to a wiki. Good luck trying to get them using jmeter or read what you created in cucumber ! Those are great tools but they don't scratch the itch that fitnesse was written...

Test value is in running them

Have you seen a build flag that states "no tests". What's the point building code without running all your tests? What's the harm in running them one last time? Tests are there to be run. A LOT! Settings that allow you to run tests every time you save a file in your IDE help ensure your unit tests are fast and passing all the time. Unit tests are there to catch you when you break something unexpected. You may think your fixing a bug with a date-time object but maybe that fix breaks something else down the line. The tests are there to tell you. If you never run your tests then why bother having them? Why not just delete them all? When should tests be run? As often as possible. Especially fast unit tests Every time you build Before committing changes to production code to version control Before  committing changes to test code to version control After committing code to version control (via Continuous Integration)

Bad Programmer Habits

Do you do any of these? Do you see these habits in others. Clean code is when you look at code and think "of course you would do it that way". It's simple, elegant, and straight forward. Once you look at it you can't think of a better way to do it. It seems 'obvious' but only with the power of hindsight. But it's not something you'll get much of from these programmers The Hoarder - "I’ll add/leave this function because it may come in useful" litters your code with commented code and unused functions that rot and bloat your code Over-Complicator - "I've built an xml like nested config value loader to read in my three values instead of using a constant" yeah thanks. And when it turns out to have a bug we'll spend weeks trying to figure out how it all works and why you wasted company time (and money) writing it. Rewriter - "This 3D library doesn't quite fit my needs. I think I'll write my own and call it Di...

Grumpy programmers

Have you ever had to work with that guy. The one who hates going to meetings. Ridicules the other developers. Sits by themselves rarely talking with anyone while "working". Sometimes they swear a lot, sometimes they often show up late to work and often they have little interest in showing someone else how their code works. Have I been that guy? Honestly I can't say for sure I never have been. My programming idol Uncle Bob admits to being that guy once in his book Clean Coder . There's a lot of old stereotypes around programming and computers in general. I've been told once to put up with a grumpy programmer on the promise he would work twice as fast as any other (if not faster). Turned out he was pretty clever but he wasn't any faster than the average for the team. And when he got really grumpy he got sloppy and produced some of the worst programming I've ever seen. So I've since resolved to never endure such behaviour and that any anti-social beha...