Pages

Wednesday, 31 August 2016

How do QA Engineer perform Unit Testing?

Many of our readers ask question, how to perform unit testing while I don't know code or don't know how to code?

Usually testers don't perform unit testing. Developers write unit tests and ideally run them every time the software builds.

A unit is the smallest testable part of an application like functions, classes, procedures, interfaces. Unit testing is a method by which individual units of source code are tested to determine if they are fit for use. In other words, Unit test are small programs which call small units of code being developed and test if the call returns expected values (or makes expected changes). Unit testing is performed by program (which runs unit tests: test runner), not by a human. It's purpose is to test a single unit of code.

This means that they are not testing through the application user interface, but are running directly against the single unit they are testing and using stub/mock data to simulate the unit's dependencies. That' why it is written and executed by software developers to make sure that code meets its design and requirements behaves as expected.

Someone with no programming skills by definition is not able to write unit test. It also does not make sense for anyone else than a developer to write unit tests. To write them, you have to be extremely familiar with the minute details of the code, how code works from the inside. Only developers have such detailed knowledge (usually only of some parts of the whole system).

QA testers do not require such detailed knowledge of the code deep insides. They are focused on how different parts of the code fit together, and how they perform actions which user wants. It is very useful to perform such testing by someone who did not write the code, to flush out some unsaid assumptions.

Having said that it is beneficial for a tester to have some knowledge of the system insides, so tester can better develop test strategies to test parts of the system which were not directly changed by a code path tested, but can be affected by the changes. But such knowledge is in more general terms, not on level of the detailed function calls and parameters passed.