Generasi Gigih Intermediate Class Reflection — Week 4

Ilham S
2 min readAug 2, 2021

Time for another generasi gigih weekly reflection. This time, I want to explain quickly about the week 4 module.

Week 4 — Unit Test & Test Driven Development

So, what is a unit test? Before answering that question, let's start with the automated testing concept. An automated test is a separate program that executes components of the main program and verifies the requirement as planned. Despite writing manual tests for the application that we developed, there's a more efficient way to save a lot of time to test the program behavior from top to bottom, automatically.

There are several types of automated tests like unit tests, integration tests, and perfomance tests. Unit tests run an individual unit of the program, usually methods to test its behavior. Integration test more focused to run the entire program and ensure that all its methods, classes, and other component integrate together successfully. The last one is the performance test, this type of testing measures the speed, efficiency, and overall performance of the program.

The most common cycle that is usually heard when doing automated testing is the Red-Green-Refactor Cycle. In general, the cycle tells about the common way to do unit testing. Start with red that represents an error, so we need to create a failing test first before starting writing the program code. Why bother to write failing tests? Why we don't just code and then test the program? That is my question before knowing about this cycle, but after listening to the explanation from generasi gigih mentor. This cycle really helps the coding process in general, especially in the refactor phase. Because there is always something that can be improved, whether we realize it or not.

After discussing the cycle next, we need to discuss the principles that must be known before starting testing. F.I.R.S.T principle stands for fast, independent, repeatable, self-validating, and timely thorough. In short, this principle told about the rules of making a unit testing that works efficiently. Make it work and then make it better.

My Reflection In Module 4

Because it's my first time learning about the concept of unit testing and TDD. So it's really like I’m in the middle of a storm, in this past week. I try to learn about Unit testing & TDD implementation, even outside the generasi gigih class. This kind of knowledge needed experience and routine practice to understand it, impossible to understand the whole unit testing and TDD in only 1 week if you're a beginner. So routine practice is my answer to catch up with the lesson, especially if I felt left behind in the class. Because I believe that everyone must pass through this storm to be better in the future

--

--