SlideShare a Scribd company logo
Efficient JavaScript Unit Testing
Hazem Saleh
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
About Me
• Staff Software Engineer / Consulting IT Specialist in IBM Egypt,
 Cairo Lab, SWG Services.
• Web 2.0 and WebSphere Portal Subject Matter Expert.
• Apache MyFaces committer.
• Founder of GMaps4JSF.
• Author of the definitive guide to Apache MyFaces book, and
 reviewer of many other books.
• DeveloperWorks Contributing Author.
• International Technical Speaker in both local and international
 conferences (such as JavaOne).

• Blog: http://www.technicaladvices.com
• Twitter: http://www.twitter.com/hazems
Developers Life without Unit testing

Complex integration between the system components.
Developers Life without Unit testing

Unmanaged number of new/regression defects especially when
the system complexity increases.
Developers Life without Unit testing


Low application quality.
Developers Life without Unit testing


Long testing cycle.
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
What is unit testing and why?


Unit testing means testing every component in the system in an
Independent way to ensure that it is working properly.


Unit testing helps in detecting BUGGY components in the early
stages of the project.


A test case is a set of steps and conditions to test the features
and functionalities of the application.
What is unit testing and why?

Integration is much simplified.

Defects are managed. Regression defects should not happen if the defect is
resolved by creating a new test case.

Test cases can be a good reference for system documentation.

Test cases can improve the system design and be the basis of code refactoring.

Application quality increases.

Testing cycle is reduced.
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
Current Complexities in testing JavaScript code



   Requires a lot of time to test on all the browsers.

   JavaScript code that runs on a specific browser does not
   necessarily mean that it will work on other browsers.




    Supporting a new browser means allocating a new budget for
    testing the system again on this new browser and for the
    new/regression defects fixes.
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
Requirements of a good JavaScript unit testing
                    tool

                            JavaScript unit
                              testing tool

Can execute across all                               Fast Test case
the browsers over                                    execution.
 all the platforms.



              Easy setup.                     Integration with
                                                   IDEs.



 Easy configuration.                             Integration with build
                                                 management tools.
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
What is JsTestDriver

  One of the best Open source JavaScript testing tools.

  Meets all of the previous requirements and more:

             Supports all the browsers / all platforms. ✓

             Easy setup and configuration. ✓

             Fast Test case execution. ✓

             Integration with IDEs and build management tools. ✓
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
                                Configuration.
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
JsTestDriver Architecture
JsTestDriver configuration


1   Run the test cases using the following command line
JsTestDriver configuration


1   2   Download the jsTestDriver latest jars from


         http://code.google.com/p/js-test-driver/downloads/list
JsTestDriver configuration

               Create the jsTestDriver.conf file (under the JS folder)
1   2   3      with the following initial content:



            server: http://localhost:9876
            load:
             - js-src/*.js
             - js-test/*.js
JsTestDriver configuration

                      Start the server using the following command
1    2    3    4      line




    java -jar JsTestDriver-1.3.2.jar
    Optional parameters
      [--port 9876]
      [--browser
      “{PATH}firefox.exe","{PATH}iexplore.exe","{P
      ATH}Safari.exe"]
JsTestDriver configuration

                               Run the test cases using the following
 1     2    3     4     5      command line



java -jar JsTestDriver-1.3.2.jar --tests all
.........
Total 9 tests (Passed: 9; Fails: 0; Errors: 0) (16.00 ms)
  Firefox 9.0.1 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0)
(3.00 ms)
  Safari 534.52.7 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors
0) (4.00 ms)
  Microsoft Internet Explorer 7.0 Windows: Run 3 tests (Passed: 3;
Fails: 0; Errors 0) (16.00 ms)
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
    JsTestDriver Eclipse plugin.
I
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
JsTestDriver Eclipse plugin


Instead of using command lines for starting the server and running the test
cases, you can directly use the jsTestDriver Eclipse plugin.



To install the JsTestDriver Eclipse plugin install the plugin from the following
URL : http://js-test-driver.googlecode.com/svn/update/
JsTestDriver Eclipse plugin
JsTestDriver Eclipse plugin
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E
    JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
Writing a JavaScript TestCase
ApplicationUtilTest = TestCase("ApplicationUtilTest");

ApplicationUtilTest.prototype.setUp = function () {
   /*:DOC += ...HTML fragment code goes here (single root) ...*/
};

ApplicationUtilTest.prototype.testMethod1 = function () {
  … validate using the jsTestDriver constructs …
}

ApplicationUtilTest.prototype.testMethod2 = function () {
  … validate using the jsTestDriver constructs …
}

...
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E   JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
JsTestDriver common constructs

    fail("msg")

    assertTrue("msg", actual)

    assertFalse("msg", actual)

    assertSame("msg", expected, actual)

    assertNotSame("msg", expected, actual)

    assertNull("msg", actual)

    assertNotNull("msg", actual)
DEMO
Let’s write synchronous
    JS Test cases …
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E   JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility
    Generating reports from test cases.
Writing asynchronous JavaScript TestCase


JsTestDriver provides AsyncTestCase object for
performing asynchronous JavaScript unit testing.


In order to test the asynchronous operations, JSTD
provides queues.


Each queue contains set of callbacks for testing the
Asynchronous system.
Writing asynchronous JavaScript TestCase


There are two types of callbacks:
• Normal callback: MUST be called to verify the Ajax
  operation success
• Error callback: Represents the error path. If it is
  called, then the test should fail.


The test runner does not move to the next queue until
the current queue executes all of its normal callbacks. If
a specific normal callback is not called for a specific
amount of time (30 seconds), the test fails.
Writing asynchronous JavaScript TestCase
WeatherClientTest = AsyncTestCase("WeatherClientTest");


WeatherClientTest.prototype.setUp = function () {
     /*:DOC += <form><div id="weatherInformation"></div></form>*/
};
WeatherClientTest.prototype.testGetWeatherConditionForCairo = function(queue) {
     queue.call('Testing getting weather Information ...', function(callbacks) {
           var weatherClient = new appnamespace.WeatherClient();


           var successCallBack = callbacks.add(function(weatherClient) {
                       weatherClient.displayWeatherInformation(weatherClient);
             });


           var failureCallBack = callbacks.addErrback('Unable to retrieve weather information');
           // call asynchronous API
            weatherClient.getWeatherCondition("1521894", "weatherInformation",
                                   successCallBack,
                                   failureCallBack);
     });
};
WeatherClientTest.prototype.testGetWeatherConditionForParis = function(queue) {
//Step 2 …
};
DEMO
Let’s write Asynchronous JS
       Test cases …
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E   JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility

    Generating reports from test cases.
JsTestDriver Compatibility


JsTestDriver is not only a JavaScript unit testing
framework BUT it is a test runner for many other
JavaScript unit testing frameworks.

JsTestDriver is compatibility with the following
JavaScript unit testing frameworks through adapters:
   • Jasmine
   • Yahoo UI Test
   • QUnit
JsTestDriver Compatibility


In order to run the previous unit testing frameworks
on the top of the JSTD test runner. You need to
configure the framework adapter and source before
the test files as follows:

 server: http://localhost:9876

 load:
  - jasmine/lib/jasmine-1.1.0/jasmine.js
  - jasmine/lib/adapter/JasmineAdapter.js
  - js-src/Basics.js
  - js-test/BasicsSpec.js
DEMO
Running Jasmine Test cases
   on the top of JSTD
Developers Life without Unit testing.

    What is unit testing? and why?

    Current Complexities in testing JavaScript code.

    Requirements of a good JavaScript unit testing tool.
O
U   What is JsTestDriver.
T   JsTestDriver Architecture & Configuration
L
I   JsTestDriver Eclipse plugin.
N   Writing a JavaScript TestCase.
E   JsTestDriver common constructs.

    Writing asynchronous JavaScript TestCase.

    JsTestDriver Compatibility

    Generating reports from test cases.
Generating reports from test cases


JSTD can generate code coverage files.


Code coverage describes how much the source code is tested.


Coverage Criteria:

                     Function coverage


                                 statement coverage

                                            Branch
                                                 coverage
JsTestDriver
  can generate code coverage
for your JavaScript code using the
      code coverage plugin.
Generating reports from test cases
Generating reports from test cases


Unfortunately   JsTestDriver does not generate HTML reports directly,

                       JsTestDriver generates the test coverage files in LCOV
                       format.

                You can generate the test reports using the LCOV
                visualizer tool:

                       http://ltp.sourceforge.net/coverage/lcov.php
Generating reports from test cases


       The JsTestDriver LCOV file name is usually:

              <config filename>-coverage.dat
              (jsTestDriver.conf-coverage.dat)

       To generate the report from the LCOV file using the
       LCOV visualizer tool:

              genhtml jsTestDriver.conf-coverage.dat
Conclusion
Conclusion

  Testing JavaScript code is important for increasing the
  application quality and for speeding up fixing defects and
  minimizing the number of regression defects.


  Good JavaScript tool should be configurable, easy to use,
  and working with all the browsers.


  JsTestDriver is one of the most powerful JavaScript unit
  testing tools that can be used for testing both synchronous
  and asynchronous JavaScript code on all the browsers.
Efficient JavaScript Unit Testing, May 2012

More Related Content

What's hot (20)

Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
Neil Crosby
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
Seth McLaughlin
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test Runner
Applitools
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Cogapp
 
Nightwatch JS for End to End Tests
Nightwatch JS for End to End TestsNightwatch JS for End to End Tests
Nightwatch JS for End to End Tests
Sriram Angajala
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
IlPeach
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
Adam Štipák
 
Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015
Andrew Eisenberg
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
Tudor Barbu
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
Sam Becker
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Ondřej Machulda
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Ondřej Machulda
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and Protractor
Filipe Falcão
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
Oren Farhi
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
IlPeach
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java side
Mek Srunyu Stittri
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
Neil Crosby
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
Seth McLaughlin
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test Runner
Applitools
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Cogapp
 
Nightwatch JS for End to End Tests
Nightwatch JS for End to End TestsNightwatch JS for End to End Tests
Nightwatch JS for End to End Tests
Sriram Angajala
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
IlPeach
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
Adam Štipák
 
Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015
Andrew Eisenberg
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
Tudor Barbu
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
Sam Becker
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Ondřej Machulda
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Ondřej Machulda
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and Protractor
Filipe Falcão
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
Oren Farhi
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
IlPeach
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java side
Mek Srunyu Stittri
 

Viewers also liked (20)

Agile JavaScript Testing
Agile JavaScript TestingAgile JavaScript Testing
Agile JavaScript Testing
Scott Becker
 
Maintainable JavaScript 2011
Maintainable JavaScript 2011Maintainable JavaScript 2011
Maintainable JavaScript 2011
Nicholas Zakas
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
Nicholas Zakas
 
AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
React in Native Apps - Meetup React - 20150409
React in Native Apps - Meetup React - 20150409React in Native Apps - Meetup React - 20150409
React in Native Apps - Meetup React - 20150409
Minko3D
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014
Matt Raible
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
Andrew Hull
 
Unit testing js
Unit testing jsUnit testing js
Unit testing js
Alexandra Morozova
 
Intro To Sammy
Intro To SammyIntro To Sammy
Intro To Sammy
Brandon Aaron
 
All About Sammy
All About SammyAll About Sammy
All About Sammy
Scott Becker
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
Hazem Saleh
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013
Hazem Saleh
 
모바일 컨버전스 5가지 패러다임 업로드용
모바일 컨버전스 5가지 패러다임 업로드용모바일 컨버전스 5가지 패러다임 업로드용
모바일 컨버전스 5가지 패러다임 업로드용
misia85
 
Unit Testing TypeScript
Unit Testing TypeScriptUnit Testing TypeScript
Unit Testing TypeScript
Daniel Jimenez Garcia
 
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Nicholas Zakas
 
Becoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryBecoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud Foundry
Raja Rao DV
 
Meteor 0.3.6 Preview
Meteor 0.3.6 PreviewMeteor 0.3.6 Preview
Meteor 0.3.6 Preview
Juntai Park
 
제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트
NAVER D2
 
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
yamoo9
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 Minutes
Patrick Crowley
 
Agile JavaScript Testing
Agile JavaScript TestingAgile JavaScript Testing
Agile JavaScript Testing
Scott Becker
 
Maintainable JavaScript 2011
Maintainable JavaScript 2011Maintainable JavaScript 2011
Maintainable JavaScript 2011
Nicholas Zakas
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
Nicholas Zakas
 
AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
React in Native Apps - Meetup React - 20150409
React in Native Apps - Meetup React - 20150409React in Native Apps - Meetup React - 20150409
React in Native Apps - Meetup React - 20150409
Minko3D
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014
Matt Raible
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
Andrew Hull
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
Hazem Saleh
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013
Hazem Saleh
 
모바일 컨버전스 5가지 패러다임 업로드용
모바일 컨버전스 5가지 패러다임 업로드용모바일 컨버전스 5가지 패러다임 업로드용
모바일 컨버전스 5가지 패러다임 업로드용
misia85
 
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Nicholas Zakas
 
Becoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryBecoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud Foundry
Raja Rao DV
 
Meteor 0.3.6 Preview
Meteor 0.3.6 PreviewMeteor 0.3.6 Preview
Meteor 0.3.6 Preview
Juntai Park
 
제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트
NAVER D2
 
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
yamoo9
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 Minutes
Patrick Crowley
 
Ad

Similar to Efficient JavaScript Unit Testing, May 2012 (20)

Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
Hazem Saleh
 
Quick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmineQuick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmine
Gil Fink
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Ortus Solutions, Corp
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
Simon Guest
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
Troy Miles
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
Christian Johansen
 
Testacular
TestacularTestacular
Testacular
James Ford
 
Quick Tour to Front-End Unit Testing Using Jasmine
Quick Tour to Front-End Unit Testing Using JasmineQuick Tour to Front-End Unit Testing Using Jasmine
Quick Tour to Front-End Unit Testing Using Jasmine
Gil Fink
 
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
Gavin Pickin
 
3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API - 3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API -
Ortus Solutions, Corp
 
Front end unit testing using jasmine
Front end unit testing using jasmineFront end unit testing using jasmine
Front end unit testing using jasmine
Gil Fink
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
Andrii Trybynenko
 
Javascript Unit Testing
Javascript Unit TestingJavascript Unit Testing
Javascript Unit Testing
Tom Van Herreweghe
 
How to write Testable Javascript
How to write Testable JavascriptHow to write Testable Javascript
How to write Testable Javascript
ColdFusionConference
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
Mats Bryntse
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
Simon Guest
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
Mihai-Cristian Fratila
 
Quick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmineQuick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmine
Gil Fink
 
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
Sencha
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
Hazem Saleh
 
Quick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmineQuick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmine
Gil Fink
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Ortus Solutions, Corp
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
Simon Guest
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
Troy Miles
 
Quick Tour to Front-End Unit Testing Using Jasmine
Quick Tour to Front-End Unit Testing Using JasmineQuick Tour to Front-End Unit Testing Using Jasmine
Quick Tour to Front-End Unit Testing Using Jasmine
Gil Fink
 
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
Gavin Pickin
 
3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API - 3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API -
Ortus Solutions, Corp
 
Front end unit testing using jasmine
Front end unit testing using jasmineFront end unit testing using jasmine
Front end unit testing using jasmine
Gil Fink
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
Mats Bryntse
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
Simon Guest
 
Quick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmineQuick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmine
Gil Fink
 
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
Sencha
 
Ad

More from Hazem Saleh (15)

[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript
Hazem Saleh
 
Mockito 2.x Migration - Droidcon UK 2018
Mockito 2.x Migration - Droidcon UK 2018Mockito 2.x Migration - Droidcon UK 2018
Mockito 2.x Migration - Droidcon UK 2018
Hazem Saleh
 
JavaScript Unit Testing with an Angular 5.x Use Case 101
JavaScript Unit Testing with an Angular 5.x Use Case 101JavaScript Unit Testing with an Angular 5.x Use Case 101
JavaScript Unit Testing with an Angular 5.x Use Case 101
Hazem Saleh
 
[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova
Hazem Saleh
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
Hazem Saleh
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
Hazem Saleh
 
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Hazem Saleh
 
Dojo >= 1.7 Kickstart
Dojo >= 1.7  KickstartDojo >= 1.7  Kickstart
Dojo >= 1.7 Kickstart
Hazem Saleh
 
Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013
Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013
Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013
Hazem Saleh
 
JSF Mashups in Action
JSF Mashups in ActionJSF Mashups in Action
JSF Mashups in Action
Hazem Saleh
 
JavaScript tools
JavaScript toolsJavaScript tools
JavaScript tools
Hazem Saleh
 
[JavaOne 2010] Abstract Mashups for Enterprise Java
[JavaOne 2010] Abstract Mashups for Enterprise Java[JavaOne 2010] Abstract Mashups for Enterprise Java
[JavaOne 2010] Abstract Mashups for Enterprise Java
Hazem Saleh
 
GMaps4JSF
GMaps4JSFGMaps4JSF
GMaps4JSF
Hazem Saleh
 
[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript
Hazem Saleh
 
Mockito 2.x Migration - Droidcon UK 2018
Mockito 2.x Migration - Droidcon UK 2018Mockito 2.x Migration - Droidcon UK 2018
Mockito 2.x Migration - Droidcon UK 2018
Hazem Saleh
 
JavaScript Unit Testing with an Angular 5.x Use Case 101
JavaScript Unit Testing with an Angular 5.x Use Case 101JavaScript Unit Testing with an Angular 5.x Use Case 101
JavaScript Unit Testing with an Angular 5.x Use Case 101
Hazem Saleh
 
[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova
Hazem Saleh
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
Hazem Saleh
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
Hazem Saleh
 
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Hazem Saleh
 
Dojo >= 1.7 Kickstart
Dojo >= 1.7  KickstartDojo >= 1.7  Kickstart
Dojo >= 1.7 Kickstart
Hazem Saleh
 
Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013
Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013
Efficient JavaScript Unit Testing (Chinese Version), JavaOne China 2013
Hazem Saleh
 
JSF Mashups in Action
JSF Mashups in ActionJSF Mashups in Action
JSF Mashups in Action
Hazem Saleh
 
JavaScript tools
JavaScript toolsJavaScript tools
JavaScript tools
Hazem Saleh
 
[JavaOne 2010] Abstract Mashups for Enterprise Java
[JavaOne 2010] Abstract Mashups for Enterprise Java[JavaOne 2010] Abstract Mashups for Enterprise Java
[JavaOne 2010] Abstract Mashups for Enterprise Java
Hazem Saleh
 

Recently uploaded (20)

vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdfWar_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Data Validation and System Interoperability
Data Validation and System InteroperabilityData Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdfWar_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Data Validation and System Interoperability
Data Validation and System InteroperabilityData Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 

Efficient JavaScript Unit Testing, May 2012

  • 1. Efficient JavaScript Unit Testing Hazem Saleh
  • 2. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 3. About Me • Staff Software Engineer / Consulting IT Specialist in IBM Egypt, Cairo Lab, SWG Services. • Web 2.0 and WebSphere Portal Subject Matter Expert. • Apache MyFaces committer. • Founder of GMaps4JSF. • Author of the definitive guide to Apache MyFaces book, and reviewer of many other books. • DeveloperWorks Contributing Author. • International Technical Speaker in both local and international conferences (such as JavaOne). • Blog: http://www.technicaladvices.com • Twitter: http://www.twitter.com/hazems
  • 4. Developers Life without Unit testing Complex integration between the system components.
  • 5. Developers Life without Unit testing Unmanaged number of new/regression defects especially when the system complexity increases.
  • 6. Developers Life without Unit testing Low application quality.
  • 7. Developers Life without Unit testing Long testing cycle.
  • 8. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 9. What is unit testing and why? Unit testing means testing every component in the system in an Independent way to ensure that it is working properly. Unit testing helps in detecting BUGGY components in the early stages of the project. A test case is a set of steps and conditions to test the features and functionalities of the application.
  • 10. What is unit testing and why? Integration is much simplified. Defects are managed. Regression defects should not happen if the defect is resolved by creating a new test case. Test cases can be a good reference for system documentation. Test cases can improve the system design and be the basis of code refactoring. Application quality increases. Testing cycle is reduced.
  • 11. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 12. Current Complexities in testing JavaScript code Requires a lot of time to test on all the browsers. JavaScript code that runs on a specific browser does not necessarily mean that it will work on other browsers. Supporting a new browser means allocating a new budget for testing the system again on this new browser and for the new/regression defects fixes.
  • 13. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 14. Requirements of a good JavaScript unit testing tool JavaScript unit testing tool Can execute across all Fast Test case the browsers over execution. all the platforms. Easy setup. Integration with IDEs. Easy configuration. Integration with build management tools.
  • 15. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 16. What is JsTestDriver One of the best Open source JavaScript testing tools. Meets all of the previous requirements and more: Supports all the browsers / all platforms. ✓ Easy setup and configuration. ✓ Fast Test case execution. ✓ Integration with IDEs and build management tools. ✓
  • 17. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration Configuration. L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 19. JsTestDriver configuration 1 Run the test cases using the following command line
  • 20. JsTestDriver configuration 1 2 Download the jsTestDriver latest jars from http://code.google.com/p/js-test-driver/downloads/list
  • 21. JsTestDriver configuration Create the jsTestDriver.conf file (under the JS folder) 1 2 3 with the following initial content: server: http://localhost:9876 load: - js-src/*.js - js-test/*.js
  • 22. JsTestDriver configuration Start the server using the following command 1 2 3 4 line java -jar JsTestDriver-1.3.2.jar Optional parameters [--port 9876] [--browser “{PATH}firefox.exe","{PATH}iexplore.exe","{P ATH}Safari.exe"]
  • 23. JsTestDriver configuration Run the test cases using the following 1 2 3 4 5 command line java -jar JsTestDriver-1.3.2.jar --tests all ......... Total 9 tests (Passed: 9; Fails: 0; Errors: 0) (16.00 ms) Firefox 9.0.1 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (3.00 ms) Safari 534.52.7 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (4.00 ms) Microsoft Internet Explorer 7.0 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (16.00 ms)
  • 24. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L JsTestDriver Eclipse plugin. I N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 25. JsTestDriver Eclipse plugin Instead of using command lines for starting the server and running the test cases, you can directly use the jsTestDriver Eclipse plugin. To install the JsTestDriver Eclipse plugin install the plugin from the following URL : http://js-test-driver.googlecode.com/svn/update/
  • 28. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 29. Writing a JavaScript TestCase ApplicationUtilTest = TestCase("ApplicationUtilTest"); ApplicationUtilTest.prototype.setUp = function () { /*:DOC += ...HTML fragment code goes here (single root) ...*/ }; ApplicationUtilTest.prototype.testMethod1 = function () { … validate using the jsTestDriver constructs … } ApplicationUtilTest.prototype.testMethod2 = function () { … validate using the jsTestDriver constructs … } ...
  • 30. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 31. JsTestDriver common constructs fail("msg") assertTrue("msg", actual) assertFalse("msg", actual) assertSame("msg", expected, actual) assertNotSame("msg", expected, actual) assertNull("msg", actual) assertNotNull("msg", actual)
  • 32. DEMO Let’s write synchronous JS Test cases …
  • 33. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 34. Writing asynchronous JavaScript TestCase JsTestDriver provides AsyncTestCase object for performing asynchronous JavaScript unit testing. In order to test the asynchronous operations, JSTD provides queues. Each queue contains set of callbacks for testing the Asynchronous system.
  • 35. Writing asynchronous JavaScript TestCase There are two types of callbacks: • Normal callback: MUST be called to verify the Ajax operation success • Error callback: Represents the error path. If it is called, then the test should fail. The test runner does not move to the next queue until the current queue executes all of its normal callbacks. If a specific normal callback is not called for a specific amount of time (30 seconds), the test fails.
  • 36. Writing asynchronous JavaScript TestCase WeatherClientTest = AsyncTestCase("WeatherClientTest"); WeatherClientTest.prototype.setUp = function () { /*:DOC += <form><div id="weatherInformation"></div></form>*/ }; WeatherClientTest.prototype.testGetWeatherConditionForCairo = function(queue) { queue.call('Testing getting weather Information ...', function(callbacks) { var weatherClient = new appnamespace.WeatherClient(); var successCallBack = callbacks.add(function(weatherClient) { weatherClient.displayWeatherInformation(weatherClient); }); var failureCallBack = callbacks.addErrback('Unable to retrieve weather information'); // call asynchronous API weatherClient.getWeatherCondition("1521894", "weatherInformation", successCallBack, failureCallBack); }); }; WeatherClientTest.prototype.testGetWeatherConditionForParis = function(queue) { //Step 2 … };
  • 37. DEMO Let’s write Asynchronous JS Test cases …
  • 38. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 39. JsTestDriver Compatibility JsTestDriver is not only a JavaScript unit testing framework BUT it is a test runner for many other JavaScript unit testing frameworks. JsTestDriver is compatibility with the following JavaScript unit testing frameworks through adapters: • Jasmine • Yahoo UI Test • QUnit
  • 40. JsTestDriver Compatibility In order to run the previous unit testing frameworks on the top of the JSTD test runner. You need to configure the framework adapter and source before the test files as follows: server: http://localhost:9876 load: - jasmine/lib/jasmine-1.1.0/jasmine.js - jasmine/lib/adapter/JasmineAdapter.js - js-src/Basics.js - js-test/BasicsSpec.js
  • 41. DEMO Running Jasmine Test cases on the top of JSTD
  • 42. Developers Life without Unit testing. What is unit testing? and why? Current Complexities in testing JavaScript code. Requirements of a good JavaScript unit testing tool. O U What is JsTestDriver. T JsTestDriver Architecture & Configuration L I JsTestDriver Eclipse plugin. N Writing a JavaScript TestCase. E JsTestDriver common constructs. Writing asynchronous JavaScript TestCase. JsTestDriver Compatibility Generating reports from test cases.
  • 43. Generating reports from test cases JSTD can generate code coverage files. Code coverage describes how much the source code is tested. Coverage Criteria: Function coverage statement coverage Branch coverage
  • 44. JsTestDriver can generate code coverage for your JavaScript code using the code coverage plugin.
  • 46. Generating reports from test cases Unfortunately JsTestDriver does not generate HTML reports directly, JsTestDriver generates the test coverage files in LCOV format. You can generate the test reports using the LCOV visualizer tool: http://ltp.sourceforge.net/coverage/lcov.php
  • 47. Generating reports from test cases The JsTestDriver LCOV file name is usually: <config filename>-coverage.dat (jsTestDriver.conf-coverage.dat) To generate the report from the LCOV file using the LCOV visualizer tool: genhtml jsTestDriver.conf-coverage.dat
  • 49. Conclusion Testing JavaScript code is important for increasing the application quality and for speeding up fixing defects and minimizing the number of regression defects. Good JavaScript tool should be configurable, easy to use, and working with all the browsers. JsTestDriver is one of the most powerful JavaScript unit testing tools that can be used for testing both synchronous and asynchronous JavaScript code on all the browsers.