Unit testing with Jasmine
Upcoming SlideShare
Loading in...5
×
 

Unit testing with Jasmine

on

  • 665 views

 

Statistics

Views

Total Views
665
Views on SlideShare
485
Embed Views
180

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 180

http://www.trisis.co.uk 180

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Unit testing with Jasmine Unit testing with Jasmine Presentation Transcript

  • Unit testing with
  •  Your probably already doing it (debugging) Prevents regression/allows REFACTORING Fastest form of quality feedback Allows you to work on other peoples code Improves the design of your code Is a form of living documentation
  •  “The smallest testable part of an application”  JavaScript public function === unit Utility Code Functional Code
  • Practical
  •  TDD – test driven development  Write a test  Run it (it’s red)  Write some code  Run it (it goes green)  Repeat.
  •  Testing after the fact  Boring  Harder to write test code  Tightly coupled test code  Miss ‘conceptual’ errors
  •  Test during development  New features ? Test driven development  Bug fixes ? write tests for the unit  Before refactor ? write tests before & modify
  •  Comprehensive suite of tests for your app Test lines ratio to code @3 : 1 Run on every commit by CI ‘Stop the line’ when a test fails
  •  Behavior driven development (bdd)  describe(”your module", function() { it(”should be unit tested", function() { expect(isUnitTested()).toBe(true); }); });