A little late perhaps, my apologies, but as promised, here are my experiences of my very first GDCR. It is certainly not a technical story, for that we have Junilu, but I hope the impressions of a complete TDD Noob will encourage anyone reading it to attend to such a day whenever that is possible.
But before going of, let me say a big "Thank You" to the sponsors of this day, especially Bol.com, where the meeting was held. But having said that, I must say an even bigger "Thank You" to Thodoris Bais, a very friendly man from Greece, and to the two assistants Joost and Patrick, both working at Bol and who helped us enourmously in times of trouble.
Not to forget: the whole day we had plenty of food and drinks, all for free, we were nurished like babies. In the picture below, you can see the bananas in abundance.
So again, a very big "Thank You" to all that made this day possible.
But then it was time to do a little TDD.
Junilu had already told us what the subject would be that day (the well-known Conways Game of Life) and what form the day would have. In a short introduction we were being told about the principles behind TDD, the red-green-refactoring
pattern, the 4 elements of simple design, and some other things that I had never applied myself. One person was protesting: how on earth could you start with a test, if you did not know what it was that should be tested. Well, that actually was my problem too, and so I was very curious how round one should go!
I did not worry by the way: I had written Conways life already (albeit it was of the form 'main is a pain'), but now I would have a nice 2D boolean array, with streams, and as many Threads as possible to determine the next generation with the help of a CyclicBarrier, and two beautiful BufferedImages of which one was being drawn upon and the other to be used by paintComponent, so actually why on earth would I need something called TDD? But I was in for a big shock: we were to have an infinite 2D world! So mentally, I said goodbye to my 2d array...
There were four rounds in total, and the first round was simply to form teams of two, so you had to go and find a mate. We started off with a group of three, since we had an odd number of participants.
Roud one
We had Frans the Scalaman, Echedey from Spain, and me the amateur. Yes, how to start? Echedey wrote a test:
(yes, from round 2 we would be using meaningful names for these tests!). Hmm, that test failed miserably, but that should be the case as we were told. The penny dropped a little: if we had to make this test pass, we would need something called 'Cell' that had a method called 'isAlive()'. Ahhhhh, how simple! So we made a class calle 'Cell' and a method 'isAlive()' that returned 'true' for now, and indeed: the test passed!
Yeah, what was all this fuzz about TDD taking years to master! I managed to become an expert in 5 minutes! (well, the real noob speaking here...)
But hang on for a second: where does the method 'isAlive()' get its answer from? Hmm, another test that failed and we incorporated a boolean 'isAlive' that would be returned by that method. But that was only shifting the problem: what was it that set the value of 'isAlive'? And then it occurred to us: do we need that status in the first place? If you see a person walking on the street, would you ask that person whether he was alive or not? The mere fact of seeing that person would be enough information. So, out went the 'isAlive()' and we envisaged a List (well, I was thinking of a HashSet) of Cells that had all the living cells. It was time to come up with the World.
So, here came the World class, with an initially empty list of cells. Then we devised a test 'world.transaction()' that would deliver the next generation (I wasn't particularly pleased with this name, but that was something for later). Now, to get such a method up and running was a very interesting challenge of course, and I thought already about some algorithms. But we were taking a too big step. How did we get some cells into our world's list? We needed some suitable contructor for this. And what about out Cell class? What was it representing now that we removed the isAlive business? And how could we determine a cells neighbor?
And what on earth was left from my beautifull version of this game? Hmmm, I thought that we were on a very interesting path, and I looked very much forward to how this project would end, so I couldn't care less about my home made code. But as Junilu said, it is unbelievable how fast the time passes by, and we had to stop our eforts here, to go into the evaluation.
Well, it was an incredible experience, and I had the idea of getting a sense of what this TDD is all about. You solve a test, but then your head floods by the ideas you suddenly get.
Round two
I teamed up with Vinayak, a Big Data specialist if I interprete his "cv" on the website of JUG Utrecht.
This second round was titled 'ping pong' and for a good reason. One would start writing a test that failed, then the other one had to make this tesd pass and come up with another test that failed, et cetera. A very interesting idea! So the cell.isAlive() returned, and 30 minutes later, as a result of a test I put in, my partner totally disagreed with the idea behind my test, and so we had a very intense discussion about our ideas. And so the time went by, without producing any code any further. But that was okay, I felt very pleased with how things were going: speaking and discussing with some real professionals, that was completely new for me. So, no code but a very worthwile experience for me.
Lunch
We had a luxury lunch with many things to eat and drink, that was LazyDeliciousLand as we say in Holland ("luilekkerland"). And Joost told us much about his daily work at Bol.com, how they managed to get such a fluent website working. Very interesting.
Round three
They made it even more interesting. Again we would be doing the ping pong version, but this time any communication with your teammate was forbidden. Now, that was interesting. I formed a team with Ahmed, and that turned out to be a feast! He started off, but I found it suspicious that it took him so long to come up with a test. Hmmm. And when he gave me the laptop, I realized the reason: a pretty difficult test to get it passed! So that took me some time, but then I mumbled 'revenche' and since body language was not forbidden, I gave him the middle finger. Don't worry, both of us were so laughing out loud, that everyone stared at us. But I pointed out that the most important thing today was: have fun, and we certainly managed. As I said in the evaluation: two things became apparent: since no communication was allowed, I certainly had the feeling we were making more progress than in round two, where much time was spent on discussions. And, secondly, you had to be very careful not to make too big steps. If you devise a test that takes quite some methods to get it pass, then chances are your mate will be unable to get it pass, or even to get an idea of what your intentions were. So you certainly had to feel very responsible in what you were doing. Don't make the tests too easy, but don't make it too hard too. A very rewarding experience.
Round four
To my shame, I must confess this round was completely beyond me. It was even so bad, that at some point I asked for this big conic hat with the big donkey ears, to sit quietly in the corner. But they had just abolished this practice, and tarring and fethering was also a thing of the past.
It was about writing tests and solving it within two minutes, or else your partner should go along. If you did manage, then you were supposed to commit the code somewhere to GitHub. Well, I do have some code in my GitHub account, but since I never program in teams, I use it so seldom, that I always must have a look at the turorials again. So, this experiece taught me to start practising GitHub more. My partner was not very familiar with GitHuB too, so Patrick came to rescue, working from the Git Bash, typing in those commands that I could never remember.
The final evaluation
We had to answer three questions
1) what did you learn today?
2) what things surprised you most?
3) what would you take to the office, "tomorrow"?
When it was my turn, I answered
1) that this TDD was much more fun and made a lot more sense than I always thought, always thinking after reading one of Junilu's many posts about TDD, "yeah, sure, but I don't need TDD, my own way of doing is good enough'. It was certainly an eye opener. But nowhere did we get anywhere close to a working version of Conways Life.
2) What really surprised me was that I found it easy to get a hang of this TDD, and how it somehow worked miraculously. What also surprised me was that coming up with some sensible tests is not so easy as it looks. But what struck me most (and actually I found it a little shocking) was that after round 1 I hardly thought about my 'great OOP version' that I brought from home, and from round two I had completely forgotten my home made version.
3) now, that was not so easy to answer. The modelling part of my work (the coding of our models) has been trqnsferred to our 'Business Intelligence' department, and to be frank, I never heard any of these poeple ever mention TDD, and the actuaries at my department will certainly have never heard of TDD. One participant said that it was a beautiful opportunity to incorporate the TDD ideas into our monthly reporting. But the department delivering the reports is a huge department, with some 20 people, specialists on things like IFRS (2, 4, ... 17) and Solvency II, and to go to there people teling them to start using TDD starting tomorrow.... But being one of the very few not involved in daily programming, the question might not be relevant to me.
Conclusion
All in all, I had a wonderful time, and I really advise to go to such a meeting whenever you have the opportunity.
Pictures
One picture of me, and one from the location. I'm the person with his back to the camera, second from the left.