SlideShare a Scribd company logo
1 of 22
Download to read offline
BDD for RIAs with JavaScript
Carlos Ble
(www.carlosble.com - @carlosble)
Skills Matter - London - Sept 18, 2013
About me:
●
Self-employed
●
Software developer
●
Consultant
●
Trainer
●
Author
●
Speaker
●
Program chair for
the ADP conference
@carlosble
1
AgileDevPractices.com (#ADP)
@carlosble
2
What problem are you solving?
RIA > operations - collaboration:
Spreadsheet, accounting and billing systems, point of sale,
cad/diagramming, chat, games...
Traditional > displaying information:
Searching, shopping, publishing, discussing...
@carlosble
3
What do you really need?
RIA
(desktop app deployed in the browser)
●
UX (user experience)
●
Stateful
●
Scalability
●
Real-time
●
Off-line
●
Bandwidth
●
Access to local
hardware
@carlosble
Traditional Web
(UI always processed in the server side)
●
Stateless
●
SEO friendly
●
Synchronization
●
Learning curve
●
Security
●
Compatibility
4
Sometimes it's something in between
Listen to your
common sense
When it looks more like RIA:
Still take advantage of what
server side offers
When it looks more like
traditional:
Use progressive enhacement
@carlosble
No, everything does not look like a nail!
5
RIA: taking advantage of the traditional way
When it comes to GUI and appearance, you
might go “traditional” first:
- Technical debt on purpose, saves time (well thought out!).
- Changing/Improving that later is not a big deal.
Examples:
●
Server renders js files, js objects, json,... on page load, apart
from HTML and CSS.
●
Page reloads as view changes.
●
Page reloads to get an updated list of items when one of
them is changed.
@carlosble
6
Behavior-driven RIA
The business DSL in the step definitions lives in the
browser:
[Binding]
public class UpdateHealthRecords_Steps : RpsEnd2End
{
  [Given(@"Bob said his last glucose value was (.*)")]
  public void lastGlucoseValueWas(int lastValue)
  {
     scenarioFixture.lastGlucoseValue = lastValue;
     var jsdate = "new Date(2013, 1, 2)";
     ExecuteJavaScript(
        string.Format(
            "rps.Business.addNewGlucoseWith(
                   {{ value: {0}, date: {1} }})",        
        lastValue, jsdate));
  }
}
@carlosble
Note: Rps is the name of the sample project
7
Outside-in TDD starts in the browser
- Domain objects emerge as we test-drive the code.
- The server side becomes just an adapter*, a hub. In
fact, the server side would not be useful at all without the
JavaScript app.
- Risk: duplicated logic in the browser and the hub.
Possible solution: Use Node.js in the hub.
* see hexagonal architecture
@carlosble
8
Hub's features will emerge
- Don't start off test-driving it: YAGNI.
- Business rules concerning
security/data-consistency,
are added progressively.
@carlosble
- If you need a RESTful
web API, that might be
a separate application.
- Some data must be
changed by the hub
exclusively. Perhaps
invisible to the app.
9
Test-driving a JavaScript application
●
Absolutely everything is testable.
Even test-driving most of it, everytime I feel like testing the
app manually, I can add a test for it (integration tests typically).
●
Event Oriented Programming & Passive view.
Because low levels of abstraction should not know about higher levels.
●
Frameworks? you need widgets.
What do you need an IoC container for?
●
Don't mock what you don't own.
Use wrappers instead.
●
AOP can be implemented with CSS ;-)
Logic should not care about a “modal” window.
@carlosble
10
Event Oriented Programming
@carlosble
Coupling
Cohesion
Levels of
abstraction
11
Events: DOM level 0 – Traditional model
(one2one: simplicity – ideal for low level events)
    
@carlosble
12
Events: Observer
(one2many: most common – higher level events )
    
@carlosble
13
Events: Pub/Sub
(many2many: when different parts need the same info )
    
@carlosble
14
Passive view: Widgets are objects
    
Koan: what is wrong if we want this test to be unit?
@carlosble
15
Promises
    
@carlosble
16
Testing Promises
    
@carlosble
17
JavaScript: the good parts
@carlosble
18
JavaScript: refactoring to combinators
@carlosble
19
Some references
●
Test-Driven JavaScript Development (book) – Christian Johansen
●
The Cucumber book (book) – Matt Wynne & Aslak Hellesoy
●
JavaScript the good parts (book) – Douglas Crockford
●
JavaScript Allongé (book) – Reginal Braithwaite
●
Enough with the JavaScript already(talk) – Nicholas Zakas:
- Hanselminutes interview.
- Talk.
●
Test-driving events and promises (blog posts) – Carlos Ble
- Promises
- Events
@carlosble
Thank you so much
Special thanks to Skills Matter's staff :-D
@carlosble

More Related Content

What's hot

Aspect oriented programming
Aspect oriented programmingAspect oriented programming
Aspect oriented programmingRobert MacLean
 
Designing a json/rest api for your mobile app
Designing a json/rest api for your mobile appDesigning a json/rest api for your mobile app
Designing a json/rest api for your mobile appOlivier Destrebecq
 
Skillwise corporate presentation
Skillwise corporate presentationSkillwise corporate presentation
Skillwise corporate presentationSkillwise Group
 
Unobtrusive js
Unobtrusive jsUnobtrusive js
Unobtrusive jsbretticus
 
Java script202
Java script202Java script202
Java script202Wasiq Zia
 
Headless Drupal, Singapore Drupal Meetup
Headless Drupal, Singapore Drupal MeetupHeadless Drupal, Singapore Drupal Meetup
Headless Drupal, Singapore Drupal MeetupPratomo Ardianto
 
Workflows - The Rise of the Machines
Workflows - The Rise of the MachinesWorkflows - The Rise of the Machines
Workflows - The Rise of the MachinesKevin Wenger
 
Sap abap course content
Sap abap course contentSap abap course content
Sap abap course contentshivasryit
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreadsIndicThreads
 
Hands-On With Reactive Web Design
Hands-On With Reactive Web DesignHands-On With Reactive Web Design
Hands-On With Reactive Web DesignOutSystems
 
You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...
You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...
You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...Carrie Bucko
 
Serverless meets GraphQL
Serverless meets GraphQLServerless meets GraphQL
Serverless meets GraphQLAssaf Gannon
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensOutSystems
 
JavaScript & CSS Development Workflow
JavaScript & CSS Development WorkflowJavaScript & CSS Development Workflow
JavaScript & CSS Development WorkflowOutSystems
 
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....Lohith Goudagere Nagaraj
 
Coolcats don't Use Customzing
Coolcats don't Use CustomzingCoolcats don't Use Customzing
Coolcats don't Use CustomzingTobias Trapp
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseOutSystems
 

What's hot (20)

Aspect oriented programming
Aspect oriented programmingAspect oriented programming
Aspect oriented programming
 
Designing a json/rest api for your mobile app
Designing a json/rest api for your mobile appDesigning a json/rest api for your mobile app
Designing a json/rest api for your mobile app
 
Skillwise corporate presentation
Skillwise corporate presentationSkillwise corporate presentation
Skillwise corporate presentation
 
Unobtrusive js
Unobtrusive jsUnobtrusive js
Unobtrusive js
 
Java script202
Java script202Java script202
Java script202
 
Headless Drupal, Singapore Drupal Meetup
Headless Drupal, Singapore Drupal MeetupHeadless Drupal, Singapore Drupal Meetup
Headless Drupal, Singapore Drupal Meetup
 
Visual resume
Visual resumeVisual resume
Visual resume
 
Javascript
JavascriptJavascript
Javascript
 
Workflows - The Rise of the Machines
Workflows - The Rise of the MachinesWorkflows - The Rise of the Machines
Workflows - The Rise of the Machines
 
Sap abap course content
Sap abap course contentSap abap course content
Sap abap course content
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreads
 
Hands-On With Reactive Web Design
Hands-On With Reactive Web DesignHands-On With Reactive Web Design
Hands-On With Reactive Web Design
 
You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...
You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...
You Can Teach an Old Dog New Tricks -- My Journey from an ABAP Developer to a...
 
Beyond The Rails Way
Beyond The Rails WayBeyond The Rails Way
Beyond The Rails Way
 
Serverless meets GraphQL
Serverless meets GraphQLServerless meets GraphQL
Serverless meets GraphQL
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class Citizens
 
JavaScript & CSS Development Workflow
JavaScript & CSS Development WorkflowJavaScript & CSS Development Workflow
JavaScript & CSS Development Workflow
 
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
 
Coolcats don't Use Customzing
Coolcats don't Use CustomzingCoolcats don't Use Customzing
Coolcats don't Use Customzing
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
 

Similar to BDD for RIAs with JavaScript - Skills Matter

Proud to be polyglot
Proud to be polyglotProud to be polyglot
Proud to be polyglotTugdual Grall
 
Accelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoftAccelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoftNeerajKumar1965
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Beyond responsive design - UI for the modern web application
Beyond responsive design - UI for the modern web applicationBeyond responsive design - UI for the modern web application
Beyond responsive design - UI for the modern web applicationPete Smith
 
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherSashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherReact Conf Brasil
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeRadosław Scheibinger
 
Choosing the Right Database - Facebook DevC Malang Hackdays 2017
Choosing the Right Database - Facebook DevC Malang Hackdays 2017Choosing the Right Database - Facebook DevC Malang Hackdays 2017
Choosing the Right Database - Facebook DevC Malang Hackdays 2017Rendy Bambang Junior
 
Fighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFabio Pellegrini
 
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014Alexandre Morgaut
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010Olaseni Odebiyi
 
Lambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big dataLambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big dataTrieu Nguyen
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...SAP Cloud Platform
 
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to ProductionData Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to ProductionFormulatedby
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentThe Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentMike Taylor
 
GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0Tobias Meixner
 
Continuous integration with business intelligence and analytics
Continuous integration with business intelligence and analyticsContinuous integration with business intelligence and analytics
Continuous integration with business intelligence and analyticsAlex Meadows
 

Similar to BDD for RIAs with JavaScript - Skills Matter (20)

Proud to be polyglot
Proud to be polyglotProud to be polyglot
Proud to be polyglot
 
Accelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoftAccelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoft
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Beyond responsive design - UI for the modern web application
Beyond responsive design - UI for the modern web applicationBeyond responsive design - UI for the modern web application
Beyond responsive design - UI for the modern web application
 
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherSashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
Choosing the Right Database - Facebook DevC Malang Hackdays 2017
Choosing the Right Database - Facebook DevC Malang Hackdays 2017Choosing the Right Database - Facebook DevC Malang Hackdays 2017
Choosing the Right Database - Facebook DevC Malang Hackdays 2017
 
Fighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless php
 
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
 
Dust.js
Dust.jsDust.js
Dust.js
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010
 
Lambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big dataLambda Architecture and open source technology stack for real time big data
Lambda Architecture and open source technology stack for real time big data
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
 
DevOps Days Rockies MLOps
DevOps Days Rockies MLOpsDevOps Days Rockies MLOps
DevOps Days Rockies MLOps
 
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to ProductionData Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentThe Importance Things of Full Stack Development
The Importance Things of Full Stack Development
 
GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0
 
Continuous integration with business intelligence and analytics
Continuous integration with business intelligence and analyticsContinuous integration with business intelligence and analytics
Continuous integration with business intelligence and analytics
 

Recently uploaded

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

BDD for RIAs with JavaScript - Skills Matter

  • 1. BDD for RIAs with JavaScript Carlos Ble (www.carlosble.com - @carlosble) Skills Matter - London - Sept 18, 2013
  • 4. What problem are you solving? RIA > operations - collaboration: Spreadsheet, accounting and billing systems, point of sale, cad/diagramming, chat, games... Traditional > displaying information: Searching, shopping, publishing, discussing... @carlosble 3
  • 5. What do you really need? RIA (desktop app deployed in the browser) ● UX (user experience) ● Stateful ● Scalability ● Real-time ● Off-line ● Bandwidth ● Access to local hardware @carlosble Traditional Web (UI always processed in the server side) ● Stateless ● SEO friendly ● Synchronization ● Learning curve ● Security ● Compatibility 4
  • 6. Sometimes it's something in between Listen to your common sense When it looks more like RIA: Still take advantage of what server side offers When it looks more like traditional: Use progressive enhacement @carlosble No, everything does not look like a nail! 5
  • 7. RIA: taking advantage of the traditional way When it comes to GUI and appearance, you might go “traditional” first: - Technical debt on purpose, saves time (well thought out!). - Changing/Improving that later is not a big deal. Examples: ● Server renders js files, js objects, json,... on page load, apart from HTML and CSS. ● Page reloads as view changes. ● Page reloads to get an updated list of items when one of them is changed. @carlosble 6
  • 8. Behavior-driven RIA The business DSL in the step definitions lives in the browser: [Binding] public class UpdateHealthRecords_Steps : RpsEnd2End {   [Given(@"Bob said his last glucose value was (.*)")]   public void lastGlucoseValueWas(int lastValue)   {      scenarioFixture.lastGlucoseValue = lastValue;      var jsdate = "new Date(2013, 1, 2)";      ExecuteJavaScript(         string.Format(             "rps.Business.addNewGlucoseWith(                    {{ value: {0}, date: {1} }})",                 lastValue, jsdate));   } } @carlosble Note: Rps is the name of the sample project 7
  • 9. Outside-in TDD starts in the browser - Domain objects emerge as we test-drive the code. - The server side becomes just an adapter*, a hub. In fact, the server side would not be useful at all without the JavaScript app. - Risk: duplicated logic in the browser and the hub. Possible solution: Use Node.js in the hub. * see hexagonal architecture @carlosble 8
  • 10. Hub's features will emerge - Don't start off test-driving it: YAGNI. - Business rules concerning security/data-consistency, are added progressively. @carlosble - If you need a RESTful web API, that might be a separate application. - Some data must be changed by the hub exclusively. Perhaps invisible to the app. 9
  • 11. Test-driving a JavaScript application ● Absolutely everything is testable. Even test-driving most of it, everytime I feel like testing the app manually, I can add a test for it (integration tests typically). ● Event Oriented Programming & Passive view. Because low levels of abstraction should not know about higher levels. ● Frameworks? you need widgets. What do you need an IoC container for? ● Don't mock what you don't own. Use wrappers instead. ● AOP can be implemented with CSS ;-) Logic should not care about a “modal” window. @carlosble 10
  • 13. Events: DOM level 0 – Traditional model (one2one: simplicity – ideal for low level events)      @carlosble 12
  • 14. Events: Observer (one2many: most common – higher level events )      @carlosble 13
  • 15. Events: Pub/Sub (many2many: when different parts need the same info )      @carlosble 14
  • 16. Passive view: Widgets are objects      Koan: what is wrong if we want this test to be unit? @carlosble 15
  • 19. JavaScript: the good parts @carlosble 18
  • 20. JavaScript: refactoring to combinators @carlosble 19
  • 21. Some references ● Test-Driven JavaScript Development (book) – Christian Johansen ● The Cucumber book (book) – Matt Wynne & Aslak Hellesoy ● JavaScript the good parts (book) – Douglas Crockford ● JavaScript Allongé (book) – Reginal Braithwaite ● Enough with the JavaScript already(talk) – Nicholas Zakas: - Hanselminutes interview. - Talk. ● Test-driving events and promises (blog posts) – Carlos Ble - Promises - Events @carlosble
  • 22. Thank you so much Special thanks to Skills Matter's staff :-D @carlosble