This slide goes from an introduction to general software testing down to testing of javascript application, explaining why test, when to test and what to test in an application. Mocha framework was used to explain how testing works in JS.
Talk Presented at #forLoopKaduna Meetup on July 1st, 2017
4. “
Testing is the process of evaluating a
system or its component(s) with the intent
to find whether it satisfies the specified
requirements or not.
5. “
A process of analyzing a software item to
detect the differences between existing and
required conditions (that is
defects/errors/bugs) and to evaluate the
features of the software item.
- ANSI/IEEE 1059 standard
9. Writing Tests depends on:
◉what the test is expected to
achieve
◉the level and depth of the test
expectation
◉Non-Functional Testing
◉Functional Testing
13. Ensure tests are written for:
◉Areas where large users will be
accessing simultaneously such
◉Login/registration form
◉Bill/payment pages
◉Connection to DB
◉Expected response from database
◉Components interaction with each
others
14. Unit Test
The main aim is to isolate each part of a
program and show that the section of
code works correctly.
18. JavaScript does not natively supports
testing
It employs the good will of some of its
frameworks and library to achieve this fit
for testing in both Node and browsers
22. Why Mocha?
◉ a feature-rich JS testing framework
that runs on node and browser
◉ most used testing framework for
testing
◉ support usage of 3rd party library for
assertion, mocks, spy and others
23. Adding Mocha to
Project
//Mocha can be installed with npm, bower and available on cdnjs
//install globally with npm using
npm install -g mocha
//install as a dev dependency for your project
npm install --save-dev mocha
//installed using bower as
bower install mocha