Balancing Object-Functional Design Guided by Tests
-
Upload
naresh-jain -
Category
Software
-
view
1.602 -
download
1
Transcript of Balancing Object-Functional Design Guided by Tests
![Page 1: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/1.jpg)
Naresh Jain @nashjain
http://nareshjain.com
Balancing Object-Functional Design Guided by Tests
![Page 2: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/2.jpg)
OO= Modelling Real World
![Page 3: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/3.jpg)
…And soon
![Page 4: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/4.jpg)
![Page 5: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/5.jpg)
Classic Debate
![Page 6: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/6.jpg)
OO Gets A Bad Name
X
![Page 7: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/7.jpg)
O O + F P + T D DT H I S W O R K S H O P I S A B O U T …
![Page 8: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/8.jpg)
A G E N D A - 1 2 0 M I N S
• Basic Setup (WebStorm, NPM, Jasmine, Karma, …)
• Live Demo of Test Driving a Comments jQuery Plugin
• Moving towards a
• Monadic (MayBe) interface and
• MVVM design pattern
• Stubbing out AJAX calls
• Next Steps…
![Page 9: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/9.jpg)
W E P L A N T O B U I L D T H I S …
![Page 10: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/10.jpg)
Add a Test
Run the Test
Make a little change
Run the Test
Refactor
Fail
Pass
Fail
Pass
TDD Rhythm Test, Code, Refactor
![Page 11: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/11.jpg)
B A S I C S E T U P
• cd ~/projects
• git clone [email protected]:nashjain/jQCommentDemo.git
• cd jQCommentDemo
• npm update
• sudo npm install -g karma-cli
• karma init
• Create a Simple Jasmine Spec
• run Jasmine Spec via karma test runner
![Page 12: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/12.jpg)
Commercial Break!
![Page 13: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/13.jpg)
Copyright © 2012, AgileFAQs. All Rights
![Page 14: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/14.jpg)
Mumbai
![Page 15: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/15.jpg)
![Page 16: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/16.jpg)
![Page 17: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/17.jpg)
![Page 18: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/18.jpg)
Tech Talks!
![Page 19: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/19.jpg)
![Page 20: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/20.jpg)
O U R P L U G I N ’ S F E AT U R E S
• Should be able to accept a comments json or an URL to fetch the comments json from server
• Should display most recent comments on top
• Private comments should be displayed only to the author of the comment
• Others should be able to like your comment
• and so on…
![Page 21: Balancing Object-Functional Design Guided by Tests](https://reader030.fdocuments.in/reader030/viewer/2022020314/58a5b99d1a28ab0b068b5209/html5/thumbnails/21.jpg)
R E F E R E N C E S
• https://learn.jquery.com/plugins/basic-plugin-creation/
• http://jasmine.github.io/2.3/introduction.html
• https://github.com/velesin/jasmine-jquery
• https://github.com/jasmine/jasmine-ajax
• http://karma-runner.github.io/0.13/index.html