Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between feature test and integration testing [duplicate]

I am currently developing a Project using Laravel5.7 and now am doing testing part. I have written code for unit testing in tests/unit directory. Next thing I see is a test/Feature directory. So my question is whether feature testing and integration testing are the same or do they have any difference.

Any help is appreciated

like image 604
Harinath R Avatar asked Dec 20 '18 05:12

Harinath R


People also ask

Are feature tests integration tests?

The integration test is done when any new unit is integrated with the system or if the already existing unit case is updated. Feature test is an end to end testing and is done when a new feature is added to the software or any existing feature is modified. Integration testing is done by the tester.

What is the difference between integration testing and functional testing?

Functional testing is performed to validate all functionalities of an application, while integration testing is performed to validate the interaction across modules and verify that they work well when compiled.

What is the difference between integration testing and acceptance testing?

Integration testing focuses on ensuring various components within a program or system can function together well. Acceptance testing focuses on the client's use of the system and how it functions as a whole unit, rather than on the specific interaction between different aspects.

What is the main difference between unit testing and integration testing?

Unit Testing is a kind of white box testing, whereas Integration Testing is a kind of black-box testing. For Unit Testing, accessibility of code is required, as it tests the written code, while for Integration Testing, access to code is not required, since it tests the interactions and interfaces between modules.

What is the difference between integration testing and end to end testing?

As a rule, integration testing targets two modules that need to interact to fulfill some function stipulated by the requirements. In practice, this effort boils down to checking if the query delivers the expected result. Unlike integration testing, E2E testing immediately checks how the entire system works.


1 Answers

by definition feature and integration testing are not necessarily the same.

Unit tests usually test the smallest unit in your code which is most likely a method or function. Integration tests should make sure that more than one unit or one or more modules work together as expected. A feature test is usually an end to end test, e.g. you test an API endpoint via HTTP request and assert its response. The API request will go through all layers of your application, for instance controller, models, DBAL, DBMS.

We run quite a big, multi-tenanted Laravel application in my company and we have the following test suites: * Unit tests * Http tests for API endpoints (end to end, without DB mocks) * Browser tests w/ Dusk (end to end, without DB mocks)

All external / 3rd party calls (i.e. Facebook API, email service provider) are mocked in the tests.

like image 80
user1720258 Avatar answered Sep 20 '22 12:09

user1720258