What, Why, and How to Write Unit Tests

Image for post
Image for post
I’m going to pass on this piece but thank you for submitting it!Photo by Agence Olloweb on Unsplash

What is a Unit Test

The unit test is the test category with the finest granularity based on the test pyramid. Usually, it is focused on the functionality of a class, function, or a UI component and isolated from the external system like databases and third-party API.

Why Bother to Write Unit Tests

The safety net of your software

Most of the time, the challenge of writing/refactoring code is to make sure that you do not break existing functionality. Prior to having unit tests, developers would need to tests the changed class/function manually in a black-box manner to make sure nothing goes wrong. Manual work is error-prone. Developers might forget some test cases and the buggy code is shipped to production. Having unit tests and having them configured properly on your deployment pipeline will save you from such scenarios. …

2 Cents From Me About Getting Tech Job Abroad

Flying with a plane
Flying with a plane
Photo by Ross Parmly on Unsplash

Hi, my name is Danang, and I am an Indonesian. For the past year, I’ve been living and working in Munich, Germany as a software developer. Before I moved here, I worked in a tech company in Jakarta and spend some time doing freelance jobs for about 1,5 years.

Pro and Cons Living and Working in Germany


  • Public transport
  • Good air quality
  • High-quality and diverse food option
  • Beautiful city (it depends on the city of course, but Munich is definitely beautiful)
  • Parks and city forest
  • Easy and quite cheap to travel to neighboring countries like Netherland, Italy, and Austria. …

Principles and practices for designing developer-friendly React components

Image for post
Image for post
Photo by Safar Safarov on Unsplash

Designing a reusable React component is definitely a challenge as, often, we work in a team and the user of our component is not only us but another developer as well.

Also, the bad abstraction would surely bite us back one day if not taken care of properly. I like to use word design here because the design process is the thinking and contemplating phase that happens before we do the actual coding part.

Ideally, we want to spend time designing before we do the actual coding.

This article will discuss common practices and principles we can apply to design a maintainable and developer-friendly React component. …

Practical guides to boost self-taught software developers’ early careers

Image for post
Image for post
Photo by NESA by Makers on Unsplash

I consider myself a self-taught developer, even though I had some programming courses back in college like basic algorithm and data structure, object-oriented programming, database, software engineering, and integrated programming. (I have a degree in Information System and Technology, by the way, not computer science.) Unfortunately, I didn’t pay attention back then because I used to hate programming so much, (guess what? Now I’m a front-end engineer, joke’s on me) so I had to learn everything from scratch.

The world of software development is vast and complex. I had a hard time at the beginning of my career because I didn’t have a clue about the essentials for software developers (I didn’t even know what to look for). …

Learn more about Redux middleware with examples

Image for post
Image for post
Photo by J. Kelly Brito on Unsplash

I was playing around with redux-saga, redux-thunk, and redux-observable, when I realized that Redux middleware could be a whole new topic because these libraries (especially redux-saga and redux-observable) rely on the implementation of Redux middleware.

Short Introduction to Redux

Redux is a predictable state container for JavaScript apps.

If you are not familiar with Redux, I would suggest taking a look at the official documentation and taking notes of Redux’s main concepts: store, reducer, actions, and actionCreator.

Please take a look a the sample code below:

In short, what happened here is that we’ve created the store using the createStore function from Redux which receives the reducer function as an argument. …

Simplify your React Component using React Hooks

Me trying hard to refactor react component IRL.

The Class Component 🧐

This is definitely the classic way of building a ToDo App in React.

The React Hooks Version 🎣

And this is how we do that using React Hooks.

Pretty neat, right? We can build the same App using only functional component.

Image for post
Image for post

The Caveat

Wait a second. This way, the onChange function will be re-created every time this component re-render right? Yep, that is totally right. I did a small experiment to prove this. Please check this code sandbox.

Try to type something into the input and take a look at the console. You can see that it will print false on the initial render, and then always print false each time re-render happen. In happens because javascript does referential equality, and savedOnChange and onChange refer to different function even if they are the “same” function. …

Things I learned after a year of mind exploration

Image for post
Image for post
Me facing toward the sunrise.

Who doesn’t want to be happy? Everybody wants to be happy and deserves to be happy. I was unhappy with my life, for quite a long time. Or maybe I think I was okay, I was fine, but the truth I was not. The past year had been quite adventurous for me. Please do not think that my adventure looks like Julia Roberts in Eat, Pray and Love, or doing backpacking and traveling around the world. Nope, it was nothing like that. It involved a lot of reading, self-reflection, thinking, and working. Sounds boring, but it works.

The Nature of Happiness

What is exactly the main source of our happiness? Is it gift? Affection? Money? Gift would definitely make me happy. Affection would also make me happy. Good food also made me happy. But the happiness would not last long. How about achievements? I got accepted in favourite college in Indonesia and graduated with a good GPA but I didn’t feel really happy about it. I was not sad tough. I wasn’t sad or happy at the same time. …

Writing sucks because like other skill, it need practice. I really wanna be good at writing something, but getting it out my mind is so difficult. Sometimes I think I got a great idea, but when I start to write it down I can only explain and elaborate it in no more than 3 paragraphs. I thought the idea was so shallow that I had difficulties in exploring it into interesting and mind challenging topic.

The other times, I just get the random idea, then I thought, let’s get over with it, just write it down!

Then it turns out didn’t very well, because it lacks of this depth and perspective in my opinion. Well, I read quite a lot of amazing article on medium and I think I still got a very very long way to go. …

  1. Being vulnerable is totally human.
  2. Listen to other with compassion, empathy.
  3. Sometimes helping other is a good way to help yourself.
  4. Focus on being helpful to other than to yourself. You will find yourself in a more passionate state during your work/duty.
  5. Making mistakes is a process. Failure is inevitable. They are precious gurus for you. But the only way to make mistakes is trying. If you not trying, then you have 0 chance of learning.
  6. Making mistakes didn’t make you a lesser human being. In fact, it will help shaping you to be a better individual.
  7. You might lose your…

Image for post
Image for post

This is my first writing in Medium, and I am going to share some of my most embarrassing mistakes in my life. What is important for me is that I just realize that those things are embarrassing and definitely not small mistakes recently. Here they are :

  1. Actually I am not a brave man. I am always seeking a way to hide from my responsibilities (maybe people that know me from same student organization as me know this very well). Not because I am lazy, but because I am afraid of critics. I don’t want people to judge me and finally understand that I am incapable. What an ass. Actually by doing this, I become the person I am afraid to be. Incapable. What a paradox. …

Danang Arbansa

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store