Upload
asutosh-dash
View
120
Download
6
Embed Size (px)
DESCRIPTION
This slide gives an idea of TDD(Test Driven Development), BDD(Behavioral Driven Development ) and the tools that you need for doing it in JavaScript
Citation preview
KEY BENEFITS OF TDDYAGNI You aren't gonna need itIt's an extreme programming methodology which is intendedto improve software quality
DRY Don't repeat yourselfSOLID Principles
BDDFeature driven approach to TDD
FEATURE DRIVEN APPROACH TO TDDWrite a test (Defining desired behaviors of the program)Write as much as code to make the test pass(implement thebehaviour)Refactor the codeTest again (Verify phase)
JASMINETo do BDD in JavaScriptCapability of test suite and test casesMocking capabilities are excellentSpying a function/methodIt does not require HTML/DOMRunning Jasmine (through Maven [Jasmine MavenPlugin]/Grunt [grunt jasmine]).
KARMA - TEST RUNNERCreates HTTP server to run your tests localy.Test your code on real browsers (Chrome. Safari, Firefox andIE)Can be easily integrated with AngularJs, BackboneJs, Emberjs,ReactJsHave good support for IDE WebStorm
KARMA CONFIGURATIONmodule.exports=function(config){ config.set({ frameworks:['jasmine'], files:['scripts/*.js','tests/*.js'], reporters: ['progress', 'coverage'], preprocessors:{ 'scripts/*.js':['coverage'] }, coverageReporter: { type : 'html', dir : 'coverage/' } }); };
ISATNBULA JS code coverage tool
Can run in command line and as well as libraryReport format: HTML, LCOV and CoberturaWell tested in node
RESOURCESJasmine Projectkarma RunnerIstanbul
THANK YOUBY ASUTOSH DASH