-
HOW TO WRITE A UNIT TEST
Let’s start with making this one thing perfectly clear. Unit tests validate behaviour. NOT code. Sounds simple enough, but is it? To start with, the function you test is a black box. When you write the test, you don’t know what the code looks like. And that is important, because the reason unit tests exists is to tell you when your code stops doing what it is expected to do. It doesn’t matter how it does it, or how many times you change it, as long as it delivers the correct result. They are not a code review. Which means that you are free to refactor the s**t out of…
-
JUST DO IT!
Do you ever find yourself not doing things that you should? If you say no, I don’t believe you 🙂 Everybody does it. It’s even got its own word. Procrastination. The Cambridge Dictionary defines it as:“To keep delaying something that must be done, often because it is unpleasant or boring.” There are many reasons for why we procrastinate. I will talk about two common ones, and I will also try to show you a way around them that actually might work. THE FIRST ONE is a misconception we have of how mankind works. We often sit down and wait for inspiration to come, and then, then we will make miracles,…