It’s Sunday Shot 2
What’s up, programmer? It’s Sunday Shot- short read on the precise topic. Summary of important things I learned this week. This Saturday I want to write only about tests. I haven’t tested anything until a week ago so I will write my thoughts on it. Do you test your apps?
Testing And Time
If you are a self-taught developer like me, probably you think that test is a waste of time. Well, actually it is but only if you don’t do it well. Testing is important. It can save you a lot of time in mid or long-term if you use it properly. In the beginning, tests may take a lot of time but once you learn it you will be more efficient.
The BigBug Problem
As you may know, sometimes it’s hard to fix bugs in a big project. BigBug can be so rough that you spend the whole day fixing it. Or you even go to sleep pissed off because you wasted all day and haven’t fixed it at all. It kills momentum and morale but you can avoid it.
The BigBug Spot Theory
Usually, when I write a certain type of code, I know that at least one bug is going to happen. Bugs are not everywhere. They usually happen in places that are easy to predict. The toughest BigBugs happen because of the foundation of your app. Not your new variables. Those are easy to spot. BigBug means that you screwed something up a long time ago and covered it with more data. So now it’s harder to find. That’s why you should test the most buggy things when they are small.
For example, if you create simple MVP project, it’s really easy to screw it up without realizing it. When you add more things to the base pattern without testing it, BigBug is getting better camouflage. Fragments are also huge bug spots. It would be a lot easier if you tested them at the beginning.
I’m not the best Android Developer. I’m pretty new to testing but I’m here to point great things that I learned. And it’s Sunday Shot, not Sunday Long. But if you want to get into testing, I recommend you to learn JUnit usage on a new, simple project.
Then you can try Mockito. It automates a lot of testing for you. But it’s better to test first manually without using it. So you can understand how exactly Mockito works. It acts like another language so it’s definitely necessary to read documentation or full tutorial. For example, it dynamically creates classes on a runtime.
But it’s not so tough! Look, even I did it: MVPLearn. Thanks for reading!