Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit tests by a QA Engineer

As I understood from some Q&A sessions (see this and this), unit tests should be written by developers.

At my previous workplace we tried to give this task to a QA Engineer, but it didn't work. May be because it was already a middle of a project and he didn't have a chance to do a significant code coverage or may be because of another reason.

Do you think it's a bad idea to free a developer from writing unit tests in a such way?

like image 313
legesh Avatar asked Jan 14 '09 11:01

legesh


People also ask

Do QA engineers do unit testing?

As the role of QA has evolved in the last few years, they not only perform functional and integration testing but also actively participating in unit testing.

Can testers do unit testing?

Unit testing is a type of white-box testing. Integration testing is a type of black-box testing. It is performed by software developers or even by testers. It is performed by testers.

Do software engineers write unit tests?

Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended.

Who is responsible for unit tests?

Unit Testing is typically performed by the developer. In SDLC or V Model, Unit testing is the first level of testing done before integration testing. Unit testing is such a type of testing technique that is usually performed by developers.


2 Answers

Generally, I think it is a bad idea. Unit tests guide the developer to write modular (and therefore useful, reusable) code because their code needs to work with both the production system and the test code.

like image 180
Jesse Pepper Avatar answered Oct 03 '22 15:10

Jesse Pepper


There's a subtle but important difference between the intent of unit tests and QA tests: QA testing validates functionality; unit testing validates design. That is, the outer view contrasted with the inner view of the product.

QA people are unfamiliar with the internal design of the product, which is intentional because they have to mimic the user's perspective. Developers, on the other hand, know intimately the inner workings and it is to them a mechanism to validate design would be meaningful, if at all.

Hence, it is absolutely natural that developers not the QA folks write unit tests.

like image 33
Frederick The Fool Avatar answered Oct 03 '22 15:10

Frederick The Fool