Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are unit tests and acceptance tests enough?

If I have unit tests for each class and/or member function and acceptance tests for every user story do I have enough tests to ensure the project functions as expected?

For instance if I have unit tests and acceptance tests for a feature do I still need integration tests or should the unit and acceptance tests cover the same ground? Is there overlap between test types?

I'm talking about automated tests here. I know manual testing is still needed for things like ease of use, etc.

like image 438
Kenneth Cochran Avatar asked May 18 '09 13:05

Kenneth Cochran


People also ask

Is unit testing really necessary?

One of the benefits of unit tests is that they isolate a function, class or method and only test that piece of code. Higher quality individual components create overall system resiliency. Thus, the result is reliable code. Unit tests also change the nature of the debugging process.

What is the major disadvantage of unit testing?

Unit testing cannot detect integration or interfacing issues between two modules. It cannot catch complex errors in the system ranging from multiple modules. It cannot test non-functional attributes like usability, scalability, the overall performance of the system, etc.

Are integration tests enough?

Integration tests are slow and can not be executed very often. In most cases integration tests do not indicate the source of the problem. it's more difficult to create test environment with integration tests. it's more difficult to ensure high coverage (e.g. simulating special cases, unexpected failures etc)

When should you run acceptance tests?

User-acceptance testing in Waterfall takes place at the final stage of development, right before the launch. It can be conducted only after the system is considered code and function ready, after achieving the following benchmarks. Product business requirements have been met.


1 Answers

The idea of multiple testing cycles is to catch problems as early as possible when things change.

Unit tests should be done by the developers to ensure the units work in isolation.

Acceptance tests should be done by the client to ensure the system meets the requirements.

However, something has changed between those two points that should also be tested. That's the integration of units into a product before being given to the client.

That's something that should first be tested by the product creator, not the client. The minute you invlove the client, things slow down so the more fixes you can do before they get their grubby little hands on it, the better.

In a big shop (like ours), there are unit tests, integration tests, globalization tests, master-build tests and so on at each point where the deliverable product changes. Only once all high severity bugs are fixed (and a plan for fixing low priority bugs is in place) do we unleash the product to our beta clients.

We do not want to give them a dodgy product simply because fixing a bug at that stage is a lot more expensive (especially in terms of administrivia) than anything we do in-house.

like image 126
paxdiablo Avatar answered Oct 24 '22 02:10

paxdiablo