A
A
Alex Kheben2015-04-20 20:42:32
Software testing
Alex Kheben, 2015-04-20 20:42:32

Who Should Write Unit Tests?

There was an argument with a colleague. There are 2 options: "the tester should write them" and "the one who writes the code to be tested should write them."
Resolve the dispute please :)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yuri Shikanov, 2015-04-20
@dizballanze

It is the UNIT tests that the developer should write, the tester simply cannot competently write tests for some class, write mocks, and so on.
Functional tests can be written by both the tester and the developer.

K
Konstantin Kitmanov, 2015-04-20
@k12th

There are many different automated tests.
Unit tests are written by a developer (ideally, the same one who writes the code covered by these tests, and BEFORE writing the code). Unit tests help to make sure that each individual piece (therefore - unit) in the program individually works correctly. With working unit tests in hand, you can safely do refactoring.
Integration tests help to make sure that all these pieces together produce meaningful results. From these tests, it becomes clear that you can log in to the site, and the software writes to a file in the correct format. They are also often written by programmers.
Acceptance tests help to make sure that the program meets the requirements laid down in the TOR / design document.
Regression tests - that nothing broke after the last update. These last two are made by testers using various tools - for the web, for example, this is Selenium.
All these tests, ideally, are run for each commit on a special Continuos Integration server, and if the programmer "has coded in the corner again", he receives a letter that his code did not pass such and such a test and it needs to be fixed.

P
Puma Thailand, 2015-04-20
@opium

, Unit tests are automated tests, and here, as it were, a tester, the programmer wrote the code and tests, the system itself drives them at each commit and sends a letter to the developer, you are a dunce, your unit test does not pass, and there is no tester in this chain, there is an option of course with very large projects, but it seems to me that this is not your option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question