Difference between functional test and end-to-end test

Brian picture Brian · Feb 13, 2018 · Viewed 7.4k times · Source

What is the difference between functional test and end-to-end test?

Techopedia says that end-to-end test is

a methodology used to test whether the flow of an application is performing as designed from start to finish. The purpose of carrying out end-to-end tests is to identify system dependencies and to ensure that the right information is passed between various system components and systems.

Techopedia also says the following about functional test:

Functional testing is a software testing process used within software development in which software is tested to ensure that it conforms with all requirements. Functional testing is a way of checking software to ensure that it has all the required functionality that's specified within its functional requirements.

After reading the above two paragraphs, I'm still confused about the difference between them.

I have a node.js application which accepts requests, then parses the request, then sends the parsed data to a Database.

        requests               parse requests and send data to the database  

Client ---------> node.js app --------------------------------------------> Database

How can I write end-to-end test and functional test for the node.js app I mentioned?

I think in both types of the tests, I should treat the node.js app as a black box. And send requests to it. Then check if the output of the black box is correct or not.

It seems that in my case, there's no difference between functional test and end-to-end test.

Answer

Kraylog picture Kraylog · Feb 13, 2018

As I understand it, the biggest difference between the two is that an end-to-end test requires the test to setup the system components as they are in production. Real database, services, queues, etc. The reason for this is to see that your system is wired correctly (database connections, configuration and such).

A functional test can setup the system with in-memory implementations of your application ports, which would make the test run faster and perhaps allow tests to run in parallel (in some cases). The only thing the test cares about is that a feature works as expected. This can reduce the overhead of setting up certain tests, since preparing 3rd party systems with data can be difficult or time consuming.