Hello, guys! I'm back and we'll discuss about test it first, in short TDD or Test Driven Development.
It is a technique where the developer writes the test that function first before we write the actual implementation. Of course, it has a downside for some developer because—definitely—not all people like to write or, like me, not yet know how to write the proper test. But sometimes the situation makes you learn, right? Weeks ago I write the test for front-end thingy where I need to make sure that the function run properly and/or the component and container rendered at the right place with the right style. And this week, I write the test for API call function, which should handle a null value and some parameter option.
It is a technique where the developer writes the test that function first before we write the actual implementation. Of course, it has a downside for some developer because—definitely—not all people like to write or, like me, not yet know how to write the proper test. But sometimes the situation makes you learn, right? Weeks ago I write the test for front-end thingy where I need to make sure that the function run properly and/or the component and container rendered at the right place with the right style. And this week, I write the test for API call function, which should handle a null value and some parameter option.
But, imagine that we don't have the test and we should—because we don't have a quality assurance engineer at the time—know that this API or components work properly at any time, how can we do this without the test? We can definitely check the result at a different situation and debug if there's a wrong, but if we have 100 conditions, it will be so hard to debug every case if there's an error. It's one of the reasons why we need to test our program.
Here are others thing why should you take it into consideration. First, sure we spend more times code for a program when we write the test first, but we'll have a better quality code means we spend less time to debug a program. Second, when you refactored it, relaxed a bit because the case and condition already covered by the test. Last, the probability to get a repeated bug is so small, since every bug we could get, always get tested.
In this last section, the question comes down to, should you and your team test first? Make the choice by yourself because people have different situation and preference, and of course, there will always be an exception for a thing. Anyway, if someone actually wants to test first, yet not confident with it, I'll say, try it! There are so many benefits you get from it.
In this last section, the question comes down to, should you and your team test first? Make the choice by yourself because people have different situation and preference, and of course, there will always be an exception for a thing. Anyway, if someone actually wants to test first, yet not confident with it, I'll say, try it! There are so many benefits you get from it.
0 komentar:
Post a Comment