InterviewSolution
| 1. |
Define test pyramid with an example? |
|
Answer» Test pyramid is the pictorial representation of the RATIO of unit tests, integration tests and end-to-end tests required for developing a good quality node.js project.
Unit tests help to check the working of a single component or module. All dependencies are stubbed providing tests for exposed METHODS. Modules used for Node.js Unit Testing are:
Some of the above tools could also be used for integration tests for eg: SuperTest, Mocha and Chai that detects the defects in the early stage itself. Integration tests run FASTER than end-to-end tests. Testing your application through its user interface is the most popular end-to-end way of testing for any application. End-to-end tests provide us with confidence that our system works all well together. The main disadvantage of end to end testing is that it requires a lot of MAINTENANCE and run pretty slowly. |
|