0
Applying BDD and TDD                     practices, using Jasmine.js                                                      ...
Outline               Development Environment               What is TDD?               What is BDD?               Doma...
Development Environment          Eclipse           – Using Eclipse IDE for JavaScript Web             Developers         ...
Test Driven Development (TDD)?          Concept            – Add a test for each new feature/improvement            – Wri...
Behaviour Driven Development (BDD)?          Concept            – Write/Automate a desired behaviour first (in natural   ...
Domain Problem                                 Heat Map© Equal Experts UK Ltd 2011       www.equalexperts.com   6
Top 4 gainer?© Equal Experts UK Ltd 2011   www.equalexperts.com   7
Different representation - Heat Map© Equal Experts UK Ltd 2011   www.equalexperts.com   8
Another version© Equal Experts UK Ltd 2011   www.equalexperts.com   9
Stories – Identify?          Story 1 – As a trader, when I load application,           I want to see the instruments, so ...
Story 1          As a trader, when I load application, I want to           see the instruments, so that …          Scena...
Design Discussion – Story 1                                                       Connect to – ws://localhost:8081/       ...
Design Discussion – Story 1                                                Connect to – ws://localhost:8081/              ...
Story 2          As a trader, I want to see “price change”           updating in real time.          Scenario 1         ...
Design Discussion – Story 2                                                                         Connect to – ws://loca...
Story 3          As a trader, I should able to see instrument’s           performance visually.          Scenario 1     ...
Design Discussion – Story 3                                                                         Connect to – ws://loca...
Questions?© Equal Experts UK Ltd 2011      www.equalexperts.com   18
Upcoming SlideShare
Loading in...5
×

Applying BDD/TDD practices, using Jasmine.js

1,104

Published on

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,104
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Applying BDD/TDD practices, using Jasmine.js"

  1. 1. Applying BDD and TDD practices, using Jasmine.js - Anil Tarte© Equal Experts UK Ltd 2011 www.equalexperts.com 1
  2. 2. Outline  Development Environment  What is TDD?  What is BDD?  Domain problem  Stories  Demonstration  Questions?© Equal Experts UK Ltd 2011 www.equalexperts.com 2
  3. 3. Development Environment  Eclipse – Using Eclipse IDE for JavaScript Web Developers – Installed Jetty(Run-Jetty-Run) plugin. • Help -> Eclipse Marketplace -> type Jetty -> hit enter -> install Run-Jetty-Run  Backend Server(Streamer.jar), – URL to access it “ws://localhost:8081/” – It is a Streaming Engine and a Stub Exchange© Equal Experts UK Ltd 2011 www.equalexperts.com 3
  4. 4. Test Driven Development (TDD)?  Concept – Add a test for each new feature/improvement – Write production code, to pass test – Refactor  Aspect – KISS (Keep It Simple, Stupid) – YAGNI (You Ain’t Goona Need It) – Fake it till you make it  Benefits – Designs become more cleaner and clearer – Testable code – Focus only on what is important© Equal Experts UK Ltd 2011 www.equalexperts.com 4
  5. 5. Behaviour Driven Development (BDD)?  Concept – Write/Automate a desired behaviour first (in natural language) – Driven by business value  Aspect – Test method names should be sentence – It extends TDD  Benefits – Clear understanding of desired software behaviour – Starting point – Encourages more collaboration, Dev + QA + BA + Customer© Equal Experts UK Ltd 2011 www.equalexperts.com 5
  6. 6. Domain Problem Heat Map© Equal Experts UK Ltd 2011 www.equalexperts.com 6
  7. 7. Top 4 gainer?© Equal Experts UK Ltd 2011 www.equalexperts.com 7
  8. 8. Different representation - Heat Map© Equal Experts UK Ltd 2011 www.equalexperts.com 8
  9. 9. Another version© Equal Experts UK Ltd 2011 www.equalexperts.com 9
  10. 10. Stories – Identify?  Story 1 – As a trader, when I load application, I want to see the instruments, so that …  Story 2 – As a trader, I want to see “price change” updating in real time, so that …  Story 3 – As a trader, I should able to see instruments performance visually(color coded), so that I will get overview of the market in real time© Equal Experts UK Ltd 2011 www.equalexperts.com 10
  11. 11. Story 1  As a trader, when I load application, I want to see the instruments, so that …  Scenario 1 – When a trader starts the application – Then I will see the instruments with details • Instrument Symbol • Instrument Name • Price change in percentage© Equal Experts UK Ltd 2011 www.equalexperts.com 11
  12. 12. Design Discussion – Story 1 Connect to – ws://localhost:8081/ Knockout bindings Application Streamer Engine HTML document© Equal Experts UK Ltd 2011 www.equalexperts.com 12
  13. 13. Design Discussion – Story 1 Connect to – ws://localhost:8081/ Application /Instrument Streamer Channel Engine Instrument Container { messageType:"Snapshot", Knockout message : {[ bindings { "instrumentSymbol":"PL Z11", "instrumentName":"Platinum", "instrumentChange":"-3.9“ } ]} HTML document }© Equal Experts UK Ltd 2011 www.equalexperts.com 13
  14. 14. Story 2  As a trader, I want to see “price change” updating in real time.  Scenario 1 – Given I have launched Heat Map application – When I monitor the Heat Map – Then I will see the instrument’s “price change” updates in real time© Equal Experts UK Ltd 2011 www.equalexperts.com 14
  15. 15. Design Discussion – Story 2 Connect to – ws://localhost:8081/ Application /Instrument Streamer Channel Engine Instrument Instrument Container { Knockout messageType:“Update", bindings message : {[ { "instrumentName":"Platinum", "instrumentChange":"-3.9“ } ]} HTML documents }© Equal Experts UK Ltd 2011 www.equalexperts.com 15
  16. 16. Story 3  As a trader, I should able to see instrument’s performance visually.  Scenario 1 – Given I have launched Heat Map application – When I monitor the Heat Map – Then I will see the instrument’s tile color changing according to the “price change” in real time© Equal Experts UK Ltd 2011 www.equalexperts.com 16
  17. 17. Design Discussion – Story 3 Connect to – ws://localhost:8081/ Color Code /Instrument Application Calculator Streamer Channel Engine Instrument Instrument Container Knockout bindings HTML documents© Equal Experts UK Ltd 2011 www.equalexperts.com 17
  18. 18. Questions?© Equal Experts UK Ltd 2011 www.equalexperts.com 18
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×