Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Large angular apps

Avatar for stuisme stuisme
February 20, 2016

Building Large angular apps

Presentation given at Dude Technology Day 2016.

Avatar for stuisme

stuisme

February 20, 2016
Tweet

Other Decks in Programming

Transcript

  1. The First Iteration, All-in-one One Module Controllers Services Directives app.js

    + + Build tools + package management Visual Studio and nuget JavaScript framework + control set Angular and Kendo UI CSS framework + CSS preprocessor Bootstrap with less + + E2E Testing Ruby with cucumber
  2. The problems • Code maintainability • Lots of areas of

    contention (merge conflicts frequently) • Growing team size • Hard to create multiple products • Low re-use, and lack of standard user experience • 1 module • Hard to test • Slow automation • Large mocks due to 1 module
  3. Create Goals… • Reduce contention in the code • Increase

    developer efficiency • Isolate code better • Increase Quality • Strategy for testing (unit and end-to-end) • Focus on feedback cycles • Organizational scale • Multiple products are coming • More squads are coming
  4. Ideas behind a module • Isolated • Reduce contention •

    Minimal dependencies • Easy to work with • Smaller is better • Route modules are called how we talk (i.e. workOrderList) • Easy to test • Code agility • Low cost of change • “Easy to move”
  5. What does that look like Smallest unit of work Each

    angular registration is its own file (i.e. module, service, run, etc..) Unit tests live next to code
  6. Current Attempt: Bower Components dude-api Access to Dude Platform (API

    client) ngResource dude-base ui-router Auth Core modules for multiple products dude-controls directives ui-bootstrap dude-less Framework Styles Based on Bootstrap / material Mobile
  7. Second Iteration - All the small things Package management bower

    and npm Build tools node with Gulp JavaScript framework + control set bower and npm CSS framework + CSS preprocessor Bootstrap with less + + + + + E2E Testing node with protractor
  8. Quality – The <3 of Angular • unit tests •

    dependency injection • End to End • protractor
  9. Quality - It’s a Team Sport • Collaborate on approach

    – Kickoff meetings • Pair Programming – 2 > 1 • Unit Testing – Lock in the spec • Peer Reviews – Get feedback from others (early and often) • E2E testing – Focus on the user. Lock in the AC • Run test suites often – Regression
  10. End to End (e2e) Testing • E2e (end-to-end) • Run

    concurrently • Split tests for faster feedback • Page objects • Multiple test runners / multiCapabilities • SauceLabs • Home-grown
  11. Test efficiency - VS - 705 Total 72.56 minutes total

    = 6.17 seconds per test 326 Unit tests* 8.49 seconds = 0.026 seconds per test End to End Tests Unit Tests