Background Goal Unit Testing Regression Testing Automation
Total Page:16
File Type:pdf, Size:1020Kb
Streamlining a Workflow Jeffrey Falgout Daniel Wilkey [email protected] [email protected] Science, Discovery, and the Universe Bloomberg L.P. Computer Science and Mathematics Major Background Regression Testing Jenkins instance would begin running all Bloomberg L.P.'s main product is a Another useful tool to have in unit and regression tests. This Jenkins job desktop application which provides sufficiently complex systems is a suite would then report the results on the financial tools. Bloomberg L.P. of regression tests. Regression testing Phabricator review and signal the author employs many computer programmers allows you to test very high level in an appropriate way. The previous to maintain, update, and add new behavior which can detect low level workflow required manual intervention to features to this product. bugs. run tests. This new workflow only the The product the code base was developer to create his feature branch in implementing has a record/playback order for all tests to be run automatically. Goal feature. This was leveraged to create a Many of the tasks that a programmer regression testing framework. This has to perform as part of a team can be framework leveraged the unit testing automated. The goal of this project was framework wherever possible. to work with a team to automate tasks At various points during the playback, where possible and make them easier callback methods would be invoked. An example of the new workflow, where a Jenkins where impossible. These methods could have testing logic to instance will automatically run tests and update the make sure the application was in the peer review. Unit Testing correct state at the correct time and verify Impact The first task was to implement a expectations using the unit testing My work has helped several teams at unit testing framework for the team's framework. Bloomberg L.P. It has given them tools code base. The code was written in they can use to be more productive as well JavaScript, so several components were as write better code with fewer bugs. needed. This internship has helped me The first component needed was a understand what it is like to be a test runner. Since JavaScript code lives software developer. It also introduced on webpages, it needs a browser in me to many new technologies, people, order to run. Several browsers were and experiences. considered including Google Chrome, PhantomJS, and Node. Ultimately, an Future Work inhouse variant of Chrome's webkit There are always minutia of a was used. Phabricator reviews are updated every night and on programmer's day which can be The second component needed was every git update. automated and improved. One area of an actual unit testing framework. QUnit improvement would be to create a fully is a standard framework used by the fledged plugin for Jenkins instead of JavaScript community. A few Automation relying on separate scripts. modifications were made on top of Unit testing and regression testing QUnit to make it compatible for are useful tools, but they are not useful modular unit testing. if they are never used. A set of scripts References The third and last component needed were created to make it easy to run tests, [1]: bloomberg/phabricator-tools. (2015). Retrieved was a mocking framework. The code and even run them automatically. from https://github.com/bloomberg/phabricator- The team used Git to manage their tools base of the team was sufficiently code base. Their workflow involved the [2]: cjohansen/sinon-qunit. (2014). Retrieved from advanced that having the ability to https://github.com/cjohansen/sinon-qunit use of feature branches in addition to create mock objects with easily [3]: Jenkins. (2015). Retrieved March 31, 2015, from using Phabricator with arcyd for peer https://jenkins-ci.org/ scriptable behavior was a necessity. reviews. [4]: Phabricator. (2015). Retrieved March 31, 2015, SinonJS with Sinon-QUnit was used. from http://phabricator.org/ A new Git hook was added so that every [5]: QUnit. (2015). Retrieved from time a new feature branch was pushed, a https://qunitjs.com/ [6]: SinonJS. (2015). Retrieved March 31, 2015, from http://sinonjs.org/.