In this tutorial we learn how to use mocks when unit testing, why integration testing is sometimes just not enough, and how to save some trees. 🌳
Tag: code quality
Writing Good Unit Tests: A Step By Step Tutorial
A tutorial to help you write comprehensive unit test suites.
Let’s imagine we just wrote a method calculating distance between two points on our planet. And let’s imagine we want to test it as well as possible. How do we come up with test cases? And what exactly do we need to test?
Bonus: learn a surprising fact about the Fiji islands. 🇫🇯
Continue reading “Writing Good Unit Tests: A Step By Step Tutorial”
Code Reviews Are Awesome, Here Are 7 Reasons Why
Code reviews are a great practice to apply in software development. The approach is very simple: when you’re done with your code, give it to someone else to look at and leave comments.
Despite of its simplicity, it brings considerable advantages. Here are 7 reasons why this practice is useful.
Continue reading “Code Reviews Are Awesome, Here Are 7 Reasons Why”
Unit testing: best practices
I have been unit testing my code for many years.
While building a GIS-system, we really cared about our product quality. Our users’ needs demanded the app to work properly. I had all critical and/or complex parts of code 100% test-covered, with multiple paths and corner cases. It was such a pleasure to find a bug, fix it, write a couple of tests for this surprise scenario, and be sure it won’t break again. Ah, good times.
Little Geo Stories: Square Miles
How I sensed a bug while not seeing any, and what came of it.
Dear reader,
Today I found a place on our website where we display the size of a recreational area in square kilometers.
199 km²
I cannot fully explain what happened next, but I had a hunch something must be wrong with this feature.
Narrator: there was.
Modularization and dependency management: three steps to better code
If you ask me, what’s a single most important thing in writing good code, I’d reply: “Modularization and Dependency Management”.
Well, actually, that’s two things. Sorry about that! But they are two sides of the same coin, and you can’t have one without the other, if you want to your code to be nice and clean.
Continue reading “Modularization and dependency management: three steps to better code”
Prioritization for Perfectionists, or: How I Learned to Stop Worrying and Love the Non-Perfection
Are you a perfectionist? That kind of a person that can never say “I’m done”, “it’s ready” or “let’s ship it”? The one who can’t release the new feature unless it’s polished and perfect?
Refactoring: Luxury or Necessity?
You’re a manager, and your developer tells you they want to refactor something? You’re a developer, but don’t know if you should resist the sudden urge to refactor that ugly piece of code you just saw? Here’re true stories that will help you decide.
Design your code for readability
So, how do you usually code?