Intro to Unit Testing Concept with Concert Performance Analogy

Rawisglenn
4 min readJan 21, 2023

I. Why Automate Testing Of Software?

After writing new codes or refactoring existing codes, we (developers) would test out the software to ensure our new codes does not contains bugs, before shipping our codes to the git repo e.g. Github.

Manually test out features is feasible for an individual/small project but become insanely repetitive and time-wasting for a larger software. That is why testing is automated to save the day!

There are different levels of testing a software, from unit of codes (Unit Testing), across modules/systems (Integration Test) to whole software (End-to-End). Let’s kick-start our testing journey by diving into unit testing.

Different levels of Testing

II. What is Unit Testing?

As the name goes, unit testing is the testing of a unit of code in isolation! If you find yourself testing huge chunks of code which involving multiple components/ accessing database and etc., psst…whisper ~~~it may not be unit testing.

III. The 3 A’s Of Unit Testing

Unit Testing usually follows the magic 3A’s formula, which consists of Arrange > Act > Assert (see diagram below).

--

--

Rawisglenn

Please help to follow me, I will follow back! Tech is fun, join in the fun! Web Dev x Hackathon x Agile Project Management x Medium Writer Tips *no paywall