-
Notifications
You must be signed in to change notification settings - Fork 9
Testing
(todo: this document is in need of updating, contact smcgregor on IRC for details)
Before jumping to Privly Testing architecture lets get some basics in order. Consider a car analogy. A car is a big system made up of smaller components. Before that car is manufactured each component of the car like engine, fuel tank, exhaust, steering wheel, gear, etc is tested. Each component is tested in isolation. After all the components are used to manufacture the car you would want to test that the car works by testing whether pressing the accelerator makes it move forward, turning the steering wheel turns the car, ignition turns the car engine on, etc.
Privly like a car is a multi-component system. We want to make sure that each component works correctly and also make sure Privly works as a whole. In Privly we have a content server that the application interacts with. So the 2 broad category of components that make up Privly:
- The content-server
- Individual Applications
Now remember the engine, fuel-tank, etc in that car being tested. Each of these components is further made up of smaller components. E.g. The material used to manufacture the fuel tank, the shafts, etc used to make the engine. Those smaller components might have also been tested at some stage in the manufacturing process. Similarly, in Privly we need to look deeper and identify subcomponents. The smallest component that deserves testing is called a unit. In the case of Privly, units are usually javascript functions. Unit tests are code that test these units. Overall keep in mind that, Tests are nothing but code. Just say this line 5 times to yourself: “Test code tests source code"
Unit tests: Makes sure that the individual javascript functions (units) that make up the privly codebase are running properly across all browsers.
Integration tests: Makes sure Privly application and content server are able to work in harmony.
Content server tests: Makes sure content server is working as expected.
Application tests: Make sure each application is working correctly.
-
Karma (Tool): It is a Test runner It does so by spawning a web server that executes source Javascript code against test Javascript code for each of the browsers connected to it. The karma web server watches for changes in all files to be tested (specified in the configuration) and if any change happens triggers the tests for that file to be run.
-
Jasmine (Tool): A behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. It simplifies the way you wrote your javascript tests.
-
Sauce Labs (Service): [TODO]
Last Modified: by [pramttl](https://github.com/pramttl), Feb 28, 2015 1:28am
Foundation Home
Repository List
Development Mailing List
Testing Mailing List
Announcement Mailing List
Central Wiki
Submit a Bug
IRC
Download Extension
These documents are under active development and discussion.
Credit: This Google Summer of Code content is licensed under the CC Attribution-Noncommercial-Share Alike 3.0 Unported license furnished by the Sahana Software Foundation.