Date post: | 06-May-2015 |
Category: |
Technology |
Upload: | luca-grulla |
View: | 1,059 times |
Download: | 1 times |
The secret art of Agile Javascripting
Luca Grulla
Italian Agile Day, Genova, 19/11/10
Our background
Large public facing websitesSignificant javascript codebasewith complex DOM interactionHeavy use of Ajax Large amount of business logic
Long life expectancy
Disclaimer
This presentation is technology agnosticEach tool used is replaceableIt is not about how to use jQuery
Technology Stack• JQuery• JSTestDriver• Ewloe• JavascriptLint
It used to be so simple…
Rich clients
We want unit tests
Scenario
Login formNeed to validate user credentialsNeed to execute a server call via ajax POSTBased on the result we need to show a
welcome or an error message
So what is wrong with this code ?
We want to test it!
Domain abstraction
Abstraction around integration points
HTTP
DOMPresentation Logic
Business Logic
Our approachJavascript is a first class language
create abstractions:business logicpresentation logicintegrations…but not limited to a specific pattern !!
Keep your presentation logic class as skinny as possible in order to express intents
Favour interaction tests over integration tests
Tools Considerations
….whatever you like but has to be pluggable in your Continuous Integration !!
Questions ?
References
Ewloe http://github.com/gurrie/ewloe