My first Unit Test

I know I know, this is not that big of a deal

BUT IT IS! For me at least. I have been doing coding for the last like, 7 or 8 years but I don’t really understand the concept behind testing, until today at least

Well not really actually, again

I did once try to do some kind of testing, it was on Hydrogen Project, maybe late 2016. The framework was still on native android and the programming language was still Java

The testing itself, I didn’t remember what kind of testing that I do. Nor that I remember the concept behind testing back then

You know what, lemme try to find that “my actual first testing code”

Really? Is that really my first unit testing? Well, it is not. Most likely it’s a template that automatically generated by Android Studio, so where’s that unit testing that I created?

Was it Project Aurora? No, it’s not

Well, I remember clearly it was Project Hydrogen… hmm, yeah, I remember, I once lost the source code of Project Hydrogen because my laptop’s hdd broke. I only had an older backup version

So probably that first “real unit testing” of mine was and is forever gone. Well, it was probably just a simple math testing, just like the snippet above, probably just a simple math calculation

Why? Because I simply didn’t understand the concept behind testing an app, back then at least

Now I know how complex an app can become, just like butterfly effect, just like rubic cube changing one aspect of the app maybe can affect other aspect of the app badly

To make sure our programming run as expected, we, therefore I am, need to make testing

And… this is the unit testing that I made

If you’re wondering, all this unit testing did is to check whetever my email and password validation logic is correct or not

I use it for my Project Riwallet, in the Login page and will be on Signup page once I implemented it

So, now is the real question

Why did I decide to make a unit testing, for the first time now?

Well, simple, nope, it’s actually quite complex

I am just tired today, I got a English National Exam this evening (2PM to 4PM) and it took some energy from me, especially because the test held in the evening

But, I want to do programming, I want to implement some stuff for Project Riwallet… basically I want to code

So yeah, I am too lazy to implement my TODOs (Implement total balance left in wallets) because it’s more of the backend thing, and it’s hard

Also, I did some gaming earlier this night, I played Sekiro Shadow Die Twice. It’s been a really really really long time since the last time I played a video games

Huft…

So yeah, I guess I need to get back to coding, not that I complain or anything… I just… tired, and there’s one more thing that I need to do

Wait…

Damn, I’ve been doing that one more thing that I need to do… writing an article for my blog 😂

Well, I’ve filled my writing quota for today, and there’s one hour left for today 🤣NICE

Wait, I got two more ideas of article… should I put it on hold?

Nah, let’s figure it out later, lemme drink some water now~

UPDATE: 11:07 PM, basically couple minutes after I published it

I probably need to attached the tutorial that I use, this is it


One Reply to “My first Unit Test”

Leave a Reply

Your email address will not be published. Required fields are marked *