Everyday Software Development
Everyday Software Development
TDD är en vana man behöver etablera. Första hindret är ofta när man återvänder efter kurs att omsätta teori i praktik. I detta avsnitt berätta jag om hur man isolerar en enhet så att man kan testa den.
Del 6 är i serien “TDD på svenska” handlar alltså om detta och har precis nu publicerats på vår YouTube-kanal “Crisp Agile Academy”.
Du hittar som vanligt de tidigare delarna i serien och mycket annat producerat av mina kollegor. Speciellt tack till Jimmy Janlén för foto, regi och klipp
Låt oss säga det direkt: att kombinera pm³ och någon agil metod, som t ex Scrum, är en dålig idé. Varför?
Därför att du kommer inte kunna dra nytta av det agila arbetssättet. pm³ är baserat på en helt annan världsbild. pm³ bygger på årsplaner och att verksamheten beställer från en leverantör, typiskt den egna IT-avdelningen. Agilt har som en grundläggande värdering att reagera på förändringar i stället för att följa en plan. Det agila arbetssättet drivs proaktivt genom utforskande i motsats till att vara en mottagare av beställningar.
Vi har sett flera försök att implementera pm³ och de har ofta misslyckats på grund av att pm³ bygger på tankar om att verkligheten kan förutsägas 18 månader i förväg, att användarna vet vad de vill ha och att det är viktigt att ha en skarp linje mellan verksamhet och IT. Vi hävdar (och flera med oss törs vi lova) att inget av detta är varken sant eller bra.
Some things are too small for the overhead of a user story, still they must be handled during the sprint effectively. I suggest a small taxonomy to classify them and also what to do with them.
What makes good code? Many things but whatever the qualities are, readability is a cornerstone. If you can’t read the code, you can’t fix it. So how do you write readable code? I’ll give you my view but it’s like books, what I find enjoyable may be different from you.
Borde du inte programmera snabbare? Varför tar det så lång tid att mata in kraven i datan? Har du hört den frågan förut?
Del 5 är i serien “TDD på svenska” handlar alltså om detta och har precis nu publicerats på vår YouTube-kanal “Crisp Agile Academy”.
Du hittar som vanligt de tidigare delarna i serien och mycket annat producerat av mina kollegor. Speciellt tack till Jimmy Janlén för foto, regi och klipp.
At my current assignment, I needed to get my fellow developers up to speed with Wicket. So I put together a one day course that taught them enough to join in on the work of a current application. Everything is publicly available on GitHub here: https://github.com/perty/wicket-kurs.
You get a starting plate for a complete web application with database backend accessed through Spring Data JPA. Also, there is a Power Point presentation that guides you through the exercises. Very little is spent on Wicket philosophy and concepts to the benefit of hands on coding.
One of the most common questions we get is whether to estimate in time or points. It seems like points are used only “to avoid thinking about time” and they are essentially the same. Wrong.
Let us give you the travel metaphor to give you an idea about how we are thinking.
Hur mycket testtäckning ska man ha? Vad är skillnaden på line coverage och branch coverage? Vad är komplex kod? Hur undviker man att få fejkade mätvärden (gaming)? Vad är “förtroende” i det här sammanhanget? Hur kan man kombinera flera mätvärden?
Det och lite till försöker jag svara på i den här videon.
Testdriven utveckling, TDD, är en vana och för att skaffa sig en vana, behöver man träna. I den här videon gör jag en rolig övning i att bryta ner ett tal i primtal. Jag vill också trycka på att du ska träna dig att använda utvecklingsmiljön genom att skriva koden “baklänges”, använd en variabel och låt din IDE fråga efter typen. Lär dig kortkommandon och lär dig refaktoringfunktioner som “extract method” för ett lättare liv som programmerare.
Det går fort i videon men det är bara för att det inte ska bli så tråkigt att titta på. Jag skriver inte så där snabbt.
Den andra delen handlar om TDD-processen. Se alla våra video på YouTube-kanalen Crisp Agile Academy.
Den första delen om TDD på svenska på Crisp Agile Academy är en motivering om varför det lönar sig med TDD. Jag funderar över vad som händer om man inte skriver tester alls, skriver dem efteråt eller skriver dem innan.
Den här serien är tänkt att bestå av korta avsnitt där något inom TDD gås igenom på ett jordnära och personligt sätt.
Whenever you have a domain object, data transfer object, parameter object or any other object that can’t be instantiated with constructor parameters only, you need to create a builder for its class.
The great thing about Java is that it is statically typed so a builder can give you compiler errors if you forget to set the compulsory parameters. If you use the builder in this pattern, you also get a very fluent interface that imposes order on the parameters. When using the builder, your IDE will suggest the next parameter to set.
Most of you have a relational database involved in your persistence. As soon as your first version has been set in use, you can’t change the database schema as easy anymore or you might lose valuable production data.
At the same time, continuous delivery demands that there should be as few manual steps as possible. See here for motivation on continuous delivery.
You no longer have a few database instance, there are numerous for different levels of testing and every developer nowadays run a personal database. To keep track of all database instances and keep them updated becomes a steep task.
To tackle this, we started using Flyway as a tool to manage our database scripts. Our applications migrates the database automatically on startup so we get a hands-free solution that will guarantee that the code and database schema is in sync.
Yesterday we ended our second two-week sprint and on the demo, besides showing the system, we could do some bragging about test coverage using our Sonar dashboard. We also could show Fitnesse tests at system level that implements the specification by example technique, or like some say, executable requirements.
What is the purpose of the @Ignore annotation in unit testing?
Either a test will be green and everything is fine or it is red so you fix it before commit. So if there is an ignored test, it is the same thing as dead code and we know what to do with that: delete it! Keep the code clean! read more »
I had taken on to facilitate a retrospective for my colleagues’ team. They wanted a different retrospective than the usual. So we borrowed Crisp’s office and used Jimmy Cards!
The group was around 15 persons from two teams. They all knew each other well which I believe is crucial as the questions on the cards can be challenging.
In this post I’ll give you the recipe which Jimmy and I came up with for this particular retrospective.
Have not all of us been in a spot where we feel an urgent need to fix some quality such as performance or availability, which takes a change in the architecture for effect? And yet we are pushed to work on new features instead?
There is a chasm between the tech side and business side that has to be bridged before a sound dialogue about system architecture can take place.
Today I decided to update my canned wicket test examples to the latest version of Wicket.
I still think Wicket is a really nice web framework for the following reasons, primarly.
We are doing a course called “Certified Scrum Developer”. We are of course proud of being one of the few eligible by the Scrum Alliance to hold such a course. But what matters most to us is teaching some modern development practices. The certificate bit is more of a bonus.
Crisp had recently its fifth installment of a code camp, the “Crisp Hack Summit”. It is an occasion for everyone at Crisp to go bananas on some project of their liking. We took the chance to work on the technical platform for the CSD course. We know from experience that you can loose a lot of valuable lecture time if the technical environment decides to hassle. Murphy, will you be there?
What makes the difference between a star developer and a day coder? First of all, with a star developer I don’t mean star as in ”famous”, rather as in ”elite”. And, a day coder is OK to be, no disrespect here. We need you as much as we need the elite.
My point here is that if you wish to hire a real star, you need to know what to look for.
Here is an illustration on how the coordinate systems of the screen and JavaFX objects relate to each other. It is a great thing with JavaFX that you seldom bother about screen coordinates. Instead you rely on layout managers to position your nodes on screen. A node has its own coordinate system, should you like to do some positioning, e.g. in a game.
read more »
JavaFX is great fun but there are so many ways of doing things. You can use FXML, you can use images to build things piecewise or you can write code for a live, scalable design. The latter is the case here where I show how I created an analog clock using Java code.
The clock is designed with the clockwork in a separate class and the face in another.
This text shows some example JavaFX code in Java slightly above introductory level. You should have your development set up and done at least a first program.
This a picture of me used on our front web page. If you don’t see it there, try reloading.
What’s the matter with me on the picture? What am I trying to say?
My mother’s sister is past 80 and still running her own company. Naturally, I do her IT-support since -95 when she realised that it was important to utilise a computer for her business.
The other day I was installing an invoice program for her. She has been using an Excel template, designed by my wife. But new regulations on VAT made her go for specialised software. She choose a well established product. It turned into a lesson for me.
read more »
This is just a blog post to point to my presentation of the aforementioned subject. Or should I say, “prezi”, because there are no slides, just a big picture with a path through it. That’s is the way of Prezi presentations and as a first timer, I felt liberated. Slides are so dull!
The content of my presentation is aimed at those with some experience of unit testing that would like a dose of philosophy on testing styles. Classical or Mockist? State or Behavior? Also, if you are not that familiar with Mockito, take this prezi for a spin!
Here is the link to the prezi! That’s all for now.
The team has its Scrum board as an information radiator. It is an excellent way of getting an overview of the sprint. But what about us, the product owners, don’t we need that too? Of course we do, we too have a need for an overview of our work and to radiate information. The stakeholders pass by and ask “what’s in next sprint”, “when will we migrate”. We’d like to just answer with a light gesture towards the wall. It is all there for everyone to see.
Let me tell you how our project owner board works, as an example. read more »
What makes a group of good people a great team? I believe that shared values and experiences are fundamental. While there are many team-building activities available, such as paint ball and boule, I’d like to think that software development teams need more than that.
The TDD Tetrahedron, or if you wish, pyramid, has reached 2.0. Like cars, the new model is bigger and comes with new technology.
By pure coincidence, I ran into somebody willing to print this. So here it is, the version 2.0 of the TDD Tetrahedron. The new version has sides of 100 mm and it is made of plastic.
Well, if you didn’t use the older version, you may be wondering what’s so great about this. It is all about mental focus.
Here is part 2, a week has past. I think as I write so it is a bit different in style and content than my other posts here.
It has been a hectic week, this first week as PO/SM. First of all, it was only four days thanks to national day. Then there were two new developers from Russia which meant twice as many developers as we had before, not counting me. Simple, you just tell people to pair program. That works out if they are well enough to come to work. Which they weren’t. So they russians were left a bit hanging. I had a lot to do just to keep the team running, at least according to my standards.
I am programmer and Scrum Master but has been offered to become Product Owner for the same part of the product I am currently working on. I decided to accept the offer and this is my live story, written as I go. Perhaps this will be of interest to you.
First of all, to me, this was not a decision I took lighthearted. However, I do have the fortune of peer coaching at Crisp and the offer came the same morning we had our last coaching. That was a timing like there was a meaning behind.
It is not supposed to be full-time either, so I need to choose what I shall do the rest of my day. It turned out that initially there was no choice. It was not possibly to find a Scrum Master to fill in my gap. The next sprint I will be both PO and SM. Hua! read more »