-
Notifications
You must be signed in to change notification settings - Fork 1
Testing framework
To me the greatest challenge of software engineering is the ever changing requirement. After all, software is built to solve real world problem, which is constantly evolving over time. So flexibility and maintainability become key design goals. I believe the best approach towards these goals are the Unix philosophy: make tools that focus on small tasks, then assemble them together to solve a particular problem.
This testing framework is more like a toolbox than a framework. Its goal is to provide a bunch of small tools so that user can build test scripts with those tools to achieve very different testing requirements.
Tools are under test/lib/. Testing scripts are under test/.
(test/lib/testRunner.js)
It helps organize tests. Tests are divided into suites. Each suite and test is associated with a name. Test results are stored in runner.results, which is a plain Javascript object.
(test/lib/testReporter.js)
Test reporter is responsible for processing runner.results generated by test runner. We can implement different test reporters. One can translate the result into a human readable format and print it to the console. Another can send email notification if there is any failing test.
Unlike most testing framework, test runner itself doesn't provide any flow control. This is intended so that user can choose to run tests sequentially or concurrently. I recommend the Async library for flow control. (https://github.com/caolan/async)
(test/lib/util.js, test/lib/logger.js)
See scripts under test/.