test driven development in node.js apps

7
Test Driven Development in Node.js apps TechTalk by Ihor Yamshchykov

Upload: techmagic

Post on 22-Jan-2018

230 views

Category:

Technology


1 download

TRANSCRIPT

Test Driven Development in Node.js apps

TechTalk

by Ihor Yamshchykov

• “Unit tests” test individual units of code in isolation (for instance, individual functions). They are fast and you usually have a lot of them.

• “Integration tests” test the integrations between different units, for example the interaction between one module and its dependencies.

• “E2E (or end-to-end) tests” test the system as a whole, from the UI down to the data store, and back.

TDD Benefits

• Application stability • Easy refactoring • Easy improvements • Reusable code • Safe production

TDD Drawbacks

• Development speed delay • Bad test implementation • May require additional resources

When writing tests ?• Keep simple • Single responsibility • Separate by logic • Make test fast • Test more

Demo