Development on the other hand is a little more complex. It is more of a team work. • It is more of how a desired behavior should be specified. • In this concept, Business Analysts and Developers should specify behaviors in terms of “User Stories”. • Involving the stake holders in the implementation process through outside-in Software Development. • Now we have our own “Jasmine” which helps us test our JavaScript code in a more TDD way of style. • For more information on BDD learn here (Wiki is the best!)http://en.wikipedia.org/wiki/Behavior- driven_development
see Jasmine Framework very similar. describe('JavaScript addition operator', function () { it('adds two numbers together', function () { expect(1 + 2).toEqual(3); }); }); • “Describe” and “it” functions – Take two parameters a string and a function. • Inside “it” block – Write setup code you need for your test. • Ready to write the actual test – Start with the “expect” function.
(TDD) have so many hidden and personal benefits as well as the obvious ones, you just can't really explain to somebody until they're doing it themselves. • Unit tests allows you to make big changes to code quickly. • You know it works now for sure (because you’ve run the tests!) • When you follow TDD no code is considered as bad/buggy/annoying. • Unit test helps you to understand the design of the code that you’re working on.
something is supposed to do • Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again. • Writing unit tests can consume a lot of time in the beginning but it’s so much worth it. Sold! You know it’s good for you, then why not start testing your code.
something is supposed to do • Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again. • Writing unit tests can consume a lot of time in the beginning but it’s so much worth it. Sold! You know it’s good for you, then why not start testing your code.