Anatoliy Kolesnick (@_TLK) header
Anatoliy Kolesnick (@_TLK) profile picture

✨ Making Unit Testing & Refactoring fun for developers 👨‍💻 20+ years .NET, Desktop/Web/Mobile/Game Dev 🌐 Ex-Microsoft consultant, advisor to UN & World Bank

Joined February 2010
Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)Photo by Anatoliy Kolesnick (@_TLK)
Replying to @viennality
@viennality hey, are there any news on 2027?
39
Replying to @DefTat67
@DefTat67 Hey, are you planning to attend Brussels Challenge this weekend?
1
1
95
Not so long ago, we explored TDD Kata—an exercise that allows you to improve refactoring and Unit Testing skills on a regular basis. Today, I’ll talk about its extended version. 🧵 1/15 👇
1
79
Let me remind you that the basic TDD Kata consists of 7 steps. We'll now delve into the extended version, but there is also an expanded version which I discuss separately. 🧵 2/15 👇
1
39
I enjoy analogies and metaphors. They always engage additional areas of the brain and help better assimilate the information. So today I will draw a parallel between Arrange Act Assert and Pre-Production Production Post-Production. 🧵 1/11 👇
1
68
This analogy came to mind when I was explaining why it is necessary to divide tests into Arrange Act Assert blocks. At that time, I chose not to elaborate it to avoid confusing you with excess information :) 🧵 2/11 👇
1
7
In 1984, I was just born. Yet, programming had already evolved to such an extent that various studies were being conducted on programmers. 🧵 1/8 👇
1
46
In particular, research from those times shows that adhering to a uniform coding style improves programmers' productivity by 15-20 percent. 🧵 2/8 👇
1
4
В моєму віці вже складно заводити нових друзів. Тому я заводжу собі друзів своїх друзів 🙃
31
Now I'll share a best practice that will help you avoid False Negative Tests when you test a data collection that is defined dynamically at the moment of test execution. 🧵 1/10 👇
1
1
30
This example concerns any test that "sifts" through certain elements to find the "bad" ones. Or a test that has test cases, which in turn are defined dynamically. To make it clear, let me provide a few examples: 🧵 2/10 👇
1
1
Matrix Resurrection now looks like it was all AI generated :/
2
59
So, you’re set to write tests for a certain Unit Under Test and realize that you can't cover all execution branches, and you're unsure which ones to pick? Say no more! I won't leave you in distress :) 🧵 1/10 👇
1
2
104
The most important branches for you are the ones that would cause the most damage to the business if they start malfunctioning. Therefore, those are the branches you should cover with tests first, gradually moving to others that have less business impact. 🧵 2/10 👇
1
9
In my first course on Unit Testing, one of the homework assignments required completing a TDD Kata and, optionally, recording a video of the process. Now, I'd like to discuss the most significant mistake that participants made. 🧵 1/11 👇
1
54
Surprisingly, the primary mistake was skipping the Refactor stage in most steps of the Kata. I even remember cases where no refactoring was done at the end of each stage, occurring only after all requirements were implemented. 🧵 2/11 👇
1
4
Analyzing the blocks Arrange, Act, and Assert, we paid a lot of attention to the meticulous details on which block each line of code should fall into. At first glance, it might seem that it does not matter much. So, let us explore why this distinction is significant. 🧵 1/6 👇
1
28
The fact is that modern Unit Test Runners display the stack trace of the fallen exception immediately after the error message. From it, you can directly navigate to the specific fallen line of the test. 🧵 2/6 👇
1
3
Let's talk about different ways you can improve the readability of your tests :) 🧵 1/9 👇
1
24
1️⃣ The first thing that catches the eye is the title of the test. Ideally, it should include the conditions in which the Unit Under Test finds itself and the expectations from it. 🧵 2/9 👇
1
2
How to effectively work with repository files in tests while remaining independent from the test runner? That's exactly what I'm about to tell you :) 🧵 1/14 👇
1
30
Let's say you're a game developer. You want to ensure that for efficient compression, all textures in your project are powers of two. You choose automated tests as your guarantee tool, as tests are already successfully integrated into your CI builds. 🧵 2/14 👇
1
1
You're starting a new project and want to begin writing Unit Tests right away. However, you're not confident that you can ensure complete test coverage. How should you prioritize? Let's discuss this :) 🧵 1/16 👇
1
2
96
Roughly speaking, all the code in an application can be divided into Units. Once such a Unit is covered by tests, it becomes a Unit Under Test. I delve deeper into this concept in a separate episode, but for now, this information is sufficient. 🧵 2/16 👇
1
6
This will be a very useful long-read, beneficial for those who want to enhance their skills in Unit Testing. I'm about to introduce you to an exercise called TDD Kata. 🧵 1/27 👇
1
90
This term was coined by Roy Osherove in his book The Art of Unit Testing in 2010. TDD Kata is an exercise which, by repetitive practice, sharpens your skills and increases your efficiency as a developer. 🧵 2/27 👇
1
15
Something is off 🤔
27
Ого, цей продукт реально закриває собою потребу!
сільпо — генії 🤌 тепер можна купити просто ті самі верхівки від пасок
1
62
It is now obvious that Value Assertions are better than Behavioral Assertions. However, there used to be an alternative to the Arrange Act Assert approach, which was tailored for behavior testing: Record / Playback. Let's talk about it. 🧵 1/10 👇
1
40
The essence of Record / Playback was as follows. In the first part of the test, we had to list a sequence of actions we expected from the method being tested. 🧵 2/10 👇
1
4
Читав по діагоналі та на автоматі скоротив Binary Classification до Bussification ☹️
2
43