Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Are there more unit tests or automated tests?


Asked by Victor Jackson on Nov 29, 2021 FAQ



In essence, the pyramid prescribes that there are many more unit tests than higher level integration, service or UI automated tests. The natural instinct of someone who is new to test automation is to attempt to cover every single scenario that they would test manually.
Thereof,
In general unit testing is meant for the developers. When a developer writes the code he should ensure it is working in most common scenario. In .NET we use NUnit, MSUnit etc to test the code and the logic. Automated testing usually happens on top of unit tested on the continuous integrated environments.
Also, There are a few different types of testing, and each has its place in the testing process. For instance, unit testing is used to test a small part of the intended application. To test a certain piece of the application’s UI, you would use functional or GUI testing.
Keeping this in consideration,
Strange question - unit testing is supposed to be automatic, thus repeatable and easy to run. For many (including me) "manual unit test" is a contradiction in terms. Manual testing may be useful in those cases when one can't make automated tests. These typically are not at the unit test level, but higher - e.g. integration, GUI, stress etc. tests.
Next,
For instance, a server action could be tested with a unit test or with an integration test (because the server action invokes many other functionalities) or with both (because it is possible to skip “external” functionality for unit testing and because it is tested in a business process). A screen must be tested by a UI test.