SlideShare uma empresa Scribd logo
1 de 42
DIVE INTO ANGULAR,
PART 5: EXPERIENCE
_by Oleksii Prohonnyi
AGENDA
 Unit testing
 E2E testing
 Angular 2 testing
 SEO
 Which version to use
 Performance measurement
 Isolated scopes
 Watchers counter
 References
UNIT TESTING
UNIT TESTING
 Angular comes with dependency injection built-in, which makes
testing components much easier, because you can pass in a
component's dependencies and stub or mock them as you wish.
 Components that have their dependencies injected allow them to
be easily mocked on a test by test basis, without having to mess
with any global variables that could inadvertently affect another
test.
 See more: docs.angularjs.org
UNIT TESTING: Tools
 Karma is a JavaScript command line tool that can be used to
spawn a web server which loads your application's source code
and executes your tests.
 Jasmine is a behavior driven development framework for
JavaScript that has become the most popular choice for testing
Angular applications.
UNIT TESTING: Controller
UNIT TESTING: Filter
UNIT TESTING: Directive
angular-mocks
 Angular also provides the ngMock module, which provides
mocking for your tests.
 This is used to inject and mock Angular services within unit tests.
In addition, it is able to extend other modules so they are
synchronous.
 Having tests synchronous keeps them much cleaner and easier
to work with.
 One of the most useful parts of ngMock is $httpBackend,
which lets us mock XHR requests in tests, and return sample
data instead.
 See more: docs.angularjs.org
E2E TESTING
E2E TESTING
 As applications grow in size and complexity, it becomes
unrealistic to rely on manual testing to verify the correctness of
new features, catch bugs and notice regressions.
 Unit tests are the first line of defense for catching bugs, but
sometimes issues come up with integration between components
which can't be captured in a unit test.
 End-to-end tests are made to find these problems.
 See more: docs.angularjs.org
E2E TESTING: Tools
 Protractor is a Node.js program, and runs end-to-end tests that
are also written in JavaScript and run with node. Protractor uses
WebDriver to control browsers and simulate user actions.
 For more information on Protractor, view getting started or the api
docs.
 Protractor uses Jasmine for its test syntax.
 Note: In the past, end-to-end testing could be done with a
deprecated tool called Angular Scenario Runner. That tool is now
in maintenance mode.
E2E TESTING: Testing scenario
E2E TESTING: Example
angular-seed
 This project is an application skeleton for a typical AngularJS
web app. You can use it to quickly bootstrap your angular
webapp projects and dev environment for these projects.
 The seed contains a sample AngularJS application and is
preconfigured to install the Angular framework and a bunch of
development and testing tools for instant web development
gratification.
 See more: docs.angularjs.org
ANGULAR 2 TESTING
ANGULAR 2 TESTING
 The Angular Testing Platform (ATP)
 The Application Under Test
 First app test
 Test an Asynchronous Service
 The Angular Test Environment
 Test a Component
 Test a Component in the DOM
 Run the tests with karma
 See more: angular.io
SEO
SEO
 The Basics of JavaScript Framework SEO in AngularJS
 Ajax Crawl Directive
 Prerenderer.io
 Angular 2 optimization:
– Making an App Render Server Side
– Universal Header Template
– Universal Service
– Universal Model
See more: builtvisible.com
WHICH VERSION TO USE
WHICH VERSION TO USE:
Angular 1.x
 Application should be developed in short terms.
 Team doesn’t know Angular.js at all.
 CRUD application.
 Visualizations and advanced user actions handling.
 Coding guidelines/code review process exists.
 Not Big Data rendering.
 Not low performance devices support.
WHICH VERSION TO USE:
Angular 1.5.x
 Application should be developed in short terms.
 Team doesn’t know Angular.js at all.
 CRUD application.
 Visualizations and advanced user actions handling.
 Coding guidelines/code review process exists.
 Not Big Data rendering.
 Angular 2 upgrade will be done.
 Component architecture.
 Distributed team.
 Not Low performance devices support.
WHICH VERSION TO USE:
Angular 2
 Application should be developed in long terms.
 Team has experience with TypeScript, ES6.
 Mobile devices advanced support.
 Development investigation effort is presented.
 Experience with React.js
PERFORMANCE
MEASUREMENT
PERFORMANCE MEASUREMENT:
AUTOMATION
 http://jsperf.com/
 https://code.google.com/archive/p/jslitmus/
 https://duzun.me/playground/js_speed
 Selenium autotests
 https://github.com/pkaminski/digest-hud
 http://github.hubspot.com/BuckyClient/
PERFORMANCE MEASUREMENT:
GENERAL
 Who should use the process:
– Developers - during dev. testing process to see performance
measurements changes;
– QA - at the beginning of the project, after performance optimization
features dev. done, at the end of the project.
 What should be measured:
– Scripting, rendering and painting time for scenario.
– $digest/$apply function calls number and execution time.
 What should be fixed during testing:
– Computer system requirements and resources.
– Application configuration, third-party modules configuration.
– Testing scenarios
PERFORMANCE MEASUREMENT:
Scripting, rendering and painting time
1. Open dev tools in Chrome
2. Go to Timeline tab
3. Uncheck all the options at the top panel (JS Profile, Memory, Paint,
Screenshots)
4. Click to start recording (or ctrl + E)
5. Click to finish (or ctrl + E)
6. Save timeline data (Open mouse context menu by right mouse button and
select "save timeline data" option)
7. Select all the timeline frame (you can do it with mouse scroll)
8. Chose Summary tab
9. Take a screenshot of Summary diagram
 See more: developer.chrome.com
PERFORMANCE MEASUREMENT:
$digest/$apply function calls
1. Open dev tools in Chrome
2. Go to Profiles tab
3. Chose "Collect JavaScript CPU Profile“ in "Select Profiling type" menu
4. Click start to start recording (or ctrl + E)
5. Click stop to stop recording (or ctrl + E)
6. Save Profile data (at the "CPU Profiles" menu click "Save" button near the
snapshot to save it, or use mouse context menu)
7. Sort functions by "Total" time of execution (click on 'Total' tab to sort desc)
8. Set "Heavy (Bottom up)" mode.
9. Take a screenshot of first several functions that includes $.digest and
$.apply (most probably in first 4 functions)
 See more: developer.chrome.com
PERFORMANCE MEASUREMENT:
3 snapshots technique
 There should be done at least 3 snapshots of the system load
during the testing to be sure all cases are covered.
 Each of them should be captured on fixed data and configuration
with fixed time limits.
 1st – Idle application state (minimum of user actions).
 2nd – Typical application flow (typical user actions).
 3rd – High-load application state (all the functionality should be
used, untypical user actions performed).
PERFORMANCE MEASUREMENT:
Testing plan – 1st snapshot
1. The application is loaded
2. Start capturing
3. No actions required from tester (fixed time)
4. Stop capturing
PERFORMANCE MEASUREMENT:
Testing plan – 2nd snapshot
1. The application is loaded
2. Start capturing
3. Buy 3 tickets manually, 3 through buy dialog
4. Open lobby, switch to another stream
5. Switch back
6. Wait for presentation
7. See whole presentation
8. Stop capturing
PERFORMANCE MEASUREMENT:
Testing plan – 3rd snapshot
1. The application is loaded
2. Start capturing
3. Buy tickets manually, buy tickets through buy dialog
4. Set autobuy
5. Open lobby, switch stream
6. Play in stream with all possible prizes
7. Switch tickets pages
8. Open minigame
9. Resize client
10. Stop capturing
PERFORMANCE MEASUREMENT:
Test report
 At the end of performance testing the test report should be
created to track results of measurements.
 It is propose to use some simple email structure for collecting the
results.
 It should include:
– Full testing scenarios (steps, time, used streams name and
configuration), if they have been changed.
– Results of measurements for each scenario.
– Saved snapshots and timelines for each scenario (as email
attachments). The place to store timeline and performance logs should
be provided separately.
ISOLATED SCOPES
ISOLATED SCOPES
ISOLATED SCOPES
WATCHERS COUNTER
WATCHERS COUNTER
REFERENCES
REFERENCES
 http://andyshora.com/unit-testing-best-practices-angularjs.html
 https://www.smashingmagazine.com/2014/10/introduction-to-
unit-testing-in-angularjs/
 http://stackoverflow.com/questions/13499040/how-do-search-
engines-deal-with-angularjs-applications
 http://stackoverflow.com/questions/33225335/angular-js-
beginner-what-version-should-i-use
 http://stackoverflow.com/questions/23066422/how-do-i-measure-
the-performance-of-my-angularjs-apps-digest-cycle
 https://egghead.io/lessons/angularjs-understanding-isolate-scope
Oleksii Prohonnyi
facebook.com/oprohonnyi
linkedin.com/in/oprohonnyi

Mais conteúdo relacionado

Mais procurados

Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Katy Slemon
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesMarios Fakiolas
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting startedHemant Mali
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorialRohit Gupta
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesMohamad Al Asmar
 
Start your journey with angular | Basic Angular
Start your journey with angular | Basic AngularStart your journey with angular | Basic Angular
Start your journey with angular | Basic AngularAnwarul Islam
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction TutorialScott Lee
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete GuideSam Dias
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSDavid Parsons
 

Mais procurados (20)

Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...
 
AngularJS
AngularJSAngularJS
AngularJS
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
 
Angular js
Angular jsAngular js
Angular js
 
Angular 9 New features
Angular 9 New featuresAngular 9 New features
Angular 9 New features
 
Angular js
Angular jsAngular js
Angular js
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting started
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
 
Angular 9
Angular 9 Angular 9
Angular 9
 
AngularJS 2.0
AngularJS 2.0AngularJS 2.0
AngularJS 2.0
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
 
Angular 4 - quick view
Angular 4 - quick viewAngular 4 - quick view
Angular 4 - quick view
 
Start your journey with angular | Basic Angular
Start your journey with angular | Basic AngularStart your journey with angular | Basic Angular
Start your journey with angular | Basic Angular
 
Angular 5
Angular 5Angular 5
Angular 5
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Angular 2 - An Introduction
Angular 2 - An IntroductionAngular 2 - An Introduction
Angular 2 - An Introduction
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 

Destaque

Conference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewConference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewOleksii Prohonnyi
 
Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)Oleksii Prohonnyi
 
Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)Oleksii Prohonnyi
 
Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?Oleksii Prohonnyi
 
Exploradores.caroes
Exploradores.caroesExploradores.caroes
Exploradores.caroesmaryespitia
 
Chorme devtools
Chorme devtoolsChorme devtools
Chorme devtools傑倫 鍾
 
Utility libraries to make your life easier
Utility libraries to make your life easierUtility libraries to make your life easier
Utility libraries to make your life easierOleksii Prohonnyi
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)Oleksii Prohonnyi
 
Chrome DevTools Awesome 10 Features +1
Chrome DevTools Awesome 10 Features +1Chrome DevTools Awesome 10 Features +1
Chrome DevTools Awesome 10 Features +1yoshikawa_t
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overviewOleksii Prohonnyi
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesOleksii Prohonnyi
 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSourceOleksii Prohonnyi
 

Destaque (18)

Conference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewConference DotJS 2015 Paris review
Conference DotJS 2015 Paris review
 
Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)
 
Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)
 
Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?
 
Cycle.js overview
Cycle.js overviewCycle.js overview
Cycle.js overview
 
Exploradores.caroes
Exploradores.caroesExploradores.caroes
Exploradores.caroes
 
Moment.js overview
Moment.js overviewMoment.js overview
Moment.js overview
 
Chorme devtools
Chorme devtoolsChorme devtools
Chorme devtools
 
Asm.js introduction
Asm.js introductionAsm.js introduction
Asm.js introduction
 
Utility libraries to make your life easier
Utility libraries to make your life easierUtility libraries to make your life easier
Utility libraries to make your life easier
 
OpenLayer's basics
OpenLayer's basicsOpenLayer's basics
OpenLayer's basics
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
 
Chrome DevTools Awesome 10 Features +1
Chrome DevTools Awesome 10 Features +1Chrome DevTools Awesome 10 Features +1
Chrome DevTools Awesome 10 Features +1
 
Bower introduction
Bower introductionBower introduction
Bower introduction
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overview
 
Introduction to D3.js
Introduction to D3.jsIntroduction to D3.js
Introduction to D3.js
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSource
 

Semelhante a Experience Angular, Part 5

Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
 
Selenium and JMeter Testing
Selenium and JMeter TestingSelenium and JMeter Testing
Selenium and JMeter TestingArchanaKalapgar
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfpCloudy
 
The 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web FrameworksThe 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web FrameworksKunal Ashar
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosFlutter Agency
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakayaMbakaya Kwatukha
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppKaty Slemon
 
IRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET Journal
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...DicodingEvent
 
B4usolution performance testing
B4usolution performance testingB4usolution performance testing
B4usolution performance testingHoa Le
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrumSyam Sasi
 
Qtp Training Deepti 1 Of 4187
Qtp Training Deepti 1 Of 4187Qtp Training Deepti 1 Of 4187
Qtp Training Deepti 1 Of 4187Azhar Satti
 
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...Journal For Research
 
Priyanka Singh_testing_resume
Priyanka Singh_testing_resumePriyanka Singh_testing_resume
Priyanka Singh_testing_resumePriyanka Singh
 
Automation testing
Automation testingAutomation testing
Automation testingTomy Rhymond
 

Semelhante a Experience Angular, Part 5 (20)

jDriver Presentation
jDriver PresentationjDriver Presentation
jDriver Presentation
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Selenium and JMeter Testing
Selenium and JMeter TestingSelenium and JMeter Testing
Selenium and JMeter Testing
 
Selenium and JMeter
Selenium and JMeterSelenium and JMeter
Selenium and JMeter
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
 
The 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web FrameworksThe 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web Frameworks
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
Qa process
Qa processQa process
Qa process
 
Qa process
Qa processQa process
Qa process
 
Ashish Baraiya
Ashish BaraiyaAshish Baraiya
Ashish Baraiya
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
 
IRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional Testing
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
B4usolution performance testing
B4usolution performance testingB4usolution performance testing
B4usolution performance testing
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrum
 
Qtp Training Deepti 1 Of 4187
Qtp Training Deepti 1 Of 4187Qtp Training Deepti 1 Of 4187
Qtp Training Deepti 1 Of 4187
 
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
 
Priyanka Singh_testing_resume
Priyanka Singh_testing_resumePriyanka Singh_testing_resume
Priyanka Singh_testing_resume
 
Automation testing
Automation testingAutomation testing
Automation testing
 

Mais de Oleksii Prohonnyi

Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Oleksii Prohonnyi
 
Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Oleksii Prohonnyi
 
Test-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basicsTest-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basicsOleksii Prohonnyi
 
JavaScript Coding Guidelines
JavaScript Coding GuidelinesJavaScript Coding Guidelines
JavaScript Coding GuidelinesOleksii Prohonnyi
 
Database Optimization (MySQL)
Database Optimization (MySQL)Database Optimization (MySQL)
Database Optimization (MySQL)Oleksii Prohonnyi
 
Usability of UI Design (motivation, heuristics, tools)
Usability of UI Design (motivation, heuristics, tools)Usability of UI Design (motivation, heuristics, tools)
Usability of UI Design (motivation, heuristics, tools)Oleksii Prohonnyi
 

Mais de Oleksii Prohonnyi (8)

BEM methodology overview
BEM methodology overviewBEM methodology overview
BEM methodology overview
 
Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2
 
Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1
 
Test-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basicsTest-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basics
 
JavaScript Coding Guidelines
JavaScript Coding GuidelinesJavaScript Coding Guidelines
JavaScript Coding Guidelines
 
Database Optimization (MySQL)
Database Optimization (MySQL)Database Optimization (MySQL)
Database Optimization (MySQL)
 
PHPCS (PHP Code Sniffer)
PHPCS (PHP Code Sniffer)PHPCS (PHP Code Sniffer)
PHPCS (PHP Code Sniffer)
 
Usability of UI Design (motivation, heuristics, tools)
Usability of UI Design (motivation, heuristics, tools)Usability of UI Design (motivation, heuristics, tools)
Usability of UI Design (motivation, heuristics, tools)
 

Último

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Experience Angular, Part 5

  • 1. DIVE INTO ANGULAR, PART 5: EXPERIENCE _by Oleksii Prohonnyi
  • 2. AGENDA  Unit testing  E2E testing  Angular 2 testing  SEO  Which version to use  Performance measurement  Isolated scopes  Watchers counter  References
  • 4. UNIT TESTING  Angular comes with dependency injection built-in, which makes testing components much easier, because you can pass in a component's dependencies and stub or mock them as you wish.  Components that have their dependencies injected allow them to be easily mocked on a test by test basis, without having to mess with any global variables that could inadvertently affect another test.  See more: docs.angularjs.org
  • 5. UNIT TESTING: Tools  Karma is a JavaScript command line tool that can be used to spawn a web server which loads your application's source code and executes your tests.  Jasmine is a behavior driven development framework for JavaScript that has become the most popular choice for testing Angular applications.
  • 9. angular-mocks  Angular also provides the ngMock module, which provides mocking for your tests.  This is used to inject and mock Angular services within unit tests. In addition, it is able to extend other modules so they are synchronous.  Having tests synchronous keeps them much cleaner and easier to work with.  One of the most useful parts of ngMock is $httpBackend, which lets us mock XHR requests in tests, and return sample data instead.  See more: docs.angularjs.org
  • 11. E2E TESTING  As applications grow in size and complexity, it becomes unrealistic to rely on manual testing to verify the correctness of new features, catch bugs and notice regressions.  Unit tests are the first line of defense for catching bugs, but sometimes issues come up with integration between components which can't be captured in a unit test.  End-to-end tests are made to find these problems.  See more: docs.angularjs.org
  • 12. E2E TESTING: Tools  Protractor is a Node.js program, and runs end-to-end tests that are also written in JavaScript and run with node. Protractor uses WebDriver to control browsers and simulate user actions.  For more information on Protractor, view getting started or the api docs.  Protractor uses Jasmine for its test syntax.  Note: In the past, end-to-end testing could be done with a deprecated tool called Angular Scenario Runner. That tool is now in maintenance mode.
  • 15. angular-seed  This project is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects and dev environment for these projects.  The seed contains a sample AngularJS application and is preconfigured to install the Angular framework and a bunch of development and testing tools for instant web development gratification.  See more: docs.angularjs.org
  • 17. ANGULAR 2 TESTING  The Angular Testing Platform (ATP)  The Application Under Test  First app test  Test an Asynchronous Service  The Angular Test Environment  Test a Component  Test a Component in the DOM  Run the tests with karma  See more: angular.io
  • 18. SEO
  • 19. SEO  The Basics of JavaScript Framework SEO in AngularJS  Ajax Crawl Directive  Prerenderer.io  Angular 2 optimization: – Making an App Render Server Side – Universal Header Template – Universal Service – Universal Model See more: builtvisible.com
  • 21. WHICH VERSION TO USE: Angular 1.x  Application should be developed in short terms.  Team doesn’t know Angular.js at all.  CRUD application.  Visualizations and advanced user actions handling.  Coding guidelines/code review process exists.  Not Big Data rendering.  Not low performance devices support.
  • 22. WHICH VERSION TO USE: Angular 1.5.x  Application should be developed in short terms.  Team doesn’t know Angular.js at all.  CRUD application.  Visualizations and advanced user actions handling.  Coding guidelines/code review process exists.  Not Big Data rendering.  Angular 2 upgrade will be done.  Component architecture.  Distributed team.  Not Low performance devices support.
  • 23. WHICH VERSION TO USE: Angular 2  Application should be developed in long terms.  Team has experience with TypeScript, ES6.  Mobile devices advanced support.  Development investigation effort is presented.  Experience with React.js
  • 25. PERFORMANCE MEASUREMENT: AUTOMATION  http://jsperf.com/  https://code.google.com/archive/p/jslitmus/  https://duzun.me/playground/js_speed  Selenium autotests  https://github.com/pkaminski/digest-hud  http://github.hubspot.com/BuckyClient/
  • 26. PERFORMANCE MEASUREMENT: GENERAL  Who should use the process: – Developers - during dev. testing process to see performance measurements changes; – QA - at the beginning of the project, after performance optimization features dev. done, at the end of the project.  What should be measured: – Scripting, rendering and painting time for scenario. – $digest/$apply function calls number and execution time.  What should be fixed during testing: – Computer system requirements and resources. – Application configuration, third-party modules configuration. – Testing scenarios
  • 27. PERFORMANCE MEASUREMENT: Scripting, rendering and painting time 1. Open dev tools in Chrome 2. Go to Timeline tab 3. Uncheck all the options at the top panel (JS Profile, Memory, Paint, Screenshots) 4. Click to start recording (or ctrl + E) 5. Click to finish (or ctrl + E) 6. Save timeline data (Open mouse context menu by right mouse button and select "save timeline data" option) 7. Select all the timeline frame (you can do it with mouse scroll) 8. Chose Summary tab 9. Take a screenshot of Summary diagram  See more: developer.chrome.com
  • 28. PERFORMANCE MEASUREMENT: $digest/$apply function calls 1. Open dev tools in Chrome 2. Go to Profiles tab 3. Chose "Collect JavaScript CPU Profile“ in "Select Profiling type" menu 4. Click start to start recording (or ctrl + E) 5. Click stop to stop recording (or ctrl + E) 6. Save Profile data (at the "CPU Profiles" menu click "Save" button near the snapshot to save it, or use mouse context menu) 7. Sort functions by "Total" time of execution (click on 'Total' tab to sort desc) 8. Set "Heavy (Bottom up)" mode. 9. Take a screenshot of first several functions that includes $.digest and $.apply (most probably in first 4 functions)  See more: developer.chrome.com
  • 29. PERFORMANCE MEASUREMENT: 3 snapshots technique  There should be done at least 3 snapshots of the system load during the testing to be sure all cases are covered.  Each of them should be captured on fixed data and configuration with fixed time limits.  1st – Idle application state (minimum of user actions).  2nd – Typical application flow (typical user actions).  3rd – High-load application state (all the functionality should be used, untypical user actions performed).
  • 30. PERFORMANCE MEASUREMENT: Testing plan – 1st snapshot 1. The application is loaded 2. Start capturing 3. No actions required from tester (fixed time) 4. Stop capturing
  • 31. PERFORMANCE MEASUREMENT: Testing plan – 2nd snapshot 1. The application is loaded 2. Start capturing 3. Buy 3 tickets manually, 3 through buy dialog 4. Open lobby, switch to another stream 5. Switch back 6. Wait for presentation 7. See whole presentation 8. Stop capturing
  • 32. PERFORMANCE MEASUREMENT: Testing plan – 3rd snapshot 1. The application is loaded 2. Start capturing 3. Buy tickets manually, buy tickets through buy dialog 4. Set autobuy 5. Open lobby, switch stream 6. Play in stream with all possible prizes 7. Switch tickets pages 8. Open minigame 9. Resize client 10. Stop capturing
  • 33. PERFORMANCE MEASUREMENT: Test report  At the end of performance testing the test report should be created to track results of measurements.  It is propose to use some simple email structure for collecting the results.  It should include: – Full testing scenarios (steps, time, used streams name and configuration), if they have been changed. – Results of measurements for each scenario. – Saved snapshots and timelines for each scenario (as email attachments). The place to store timeline and performance logs should be provided separately.
  • 40. REFERENCES  http://andyshora.com/unit-testing-best-practices-angularjs.html  https://www.smashingmagazine.com/2014/10/introduction-to- unit-testing-in-angularjs/  http://stackoverflow.com/questions/13499040/how-do-search- engines-deal-with-angularjs-applications  http://stackoverflow.com/questions/33225335/angular-js- beginner-what-version-should-i-use  http://stackoverflow.com/questions/23066422/how-do-i-measure- the-performance-of-my-angularjs-apps-digest-cycle  https://egghead.io/lessons/angularjs-understanding-isolate-scope
  • 41.