DevTeams.AT

Training and Technical Coaching for Teams & Individuals

TDD: Red-Green Part 4: List of Goals

2019-03-25

How do you know which test to write next? How do you make sure you make progress towards your goal, that is, towards implementing a feature that is useful to your customers?

Read More...

TDD: Red-Green Part 3: Why Red

2019-03-18

The pair of programmers wrote a test. They ran it, and it was “green”. They started to write the next test.

I said: “Wait, stop it! Your test was green!” They were like: “So what?”

Today I want to talk about why “red” is so important in test driven development - Why you must see a test fail first.

Read More...

TDD: Red-Green Part 2: Wrong Code

2019-03-11

“Why do you want me to write wong code?” an attendee asked me in the break of one of my test driven development trainings.

At first, I did not understand the question: “No, in an ideal world, I only want you to write correct code! That’s why I teach these trainings.”

Then he explained…

Read More...

Red-Green Part 1: Introduction

2019-03-04

One of the first things you must learn when starting with test driven development - or TDD - is how to write a good, “red” test and how to make this test green.

And this is already harder than you might think.

A good red test constrains the implementation you are about to write in just the right way - not too little and not too much. It takes you one step closer to your overall design goal; that might still be pretty far away. It enables you to write an implementation that will allow you to make the next test red again.

To make the test green, you must write the smallest possible implementation that will pass the test. And most people I know were surprised - schocked! - how small is sometimes necessary.

Read More...

Refactoring: Move to Value Object

2019-02-25

Let’s talk about refactoring again: How can you move some code to different value objects using small, safe steps? In this video, I want to show you exactly which refactoring steps I take to extract a factory method, move it to one value object and move some code around it to another value object.

In my last video about “Refactoring Primitive Obsession”, I did all that very quickly to give you an overview about the whole process. I have added a link to that video in the description.

Today I want to show you a small step from this process and explain exactly what I did.

Read More...

Red, Green, ... Part 0: All Posts

2019-02-23

I sometimes teach test-driven development, or TDD, to developers who have never done it before. And at the beginning of those trainings, most of them struggle a lot with the first two steps of the “Red, Green, Refactor” cycle: How to write a failing test correctly and how to make this test pass correctly.

In this series of blog posts and videos, I want to focus on those first two steps: “Red” and “Green”. You can find all the parts of the series here:

Read More...

Refactoring: Primitive Obsession

2019-02-18

“How did you refactor that?”

After my video about “Primitive Obsession”, a viwer asked me on Twitter how exaclty I refactored the code towards the final result.

Which steps did I take? Which transformations did I perform in the code?

In this video, I want to show you how I would refactor this piece of code to get rid of the primitive obsession.

Read More...

Improve Retrospectives

2019-02-11

Quick show of hands: Who here likes retrospectives? Who loves them?

Many people I have met so far would have kept their hands down. They would rather work on the next feature than sit in a retrospective.

That’s because, in many teams, retrospectives are boring and ineffective.

Read More...

Primitive Obsession

2019-02-04

Did you ever see some piece of code that uses primitive data types, like Strings or integers, in it’s public API? I am sure you have, because most code is written like that.

But that can cause problems. Today, I want to talk about a code smell called “Primitive Obsession”. And I want to show you how code often becomes easier to understand and “nicer” by eliminating primitive data types - especially, but not only, from it’s public API.

Read More...

Object-Oriented Design Pitfalls

2019-01-28

Do you remember how you first learned about object-oriented software design? How they teach it at University?

You probably looked at objects from the real world and their is-a or extends relationships. A circle is-a shape, and it extends shape. A cat is-an animal, and it extends animal.

Today I want to re-visit this kind of approach to learning object-oriented design and discuss it’s advantages and shortcomings.

Read More...