SlideShare a Scribd company logo
1 of 50
Download to read offline
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

Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend TestingNeil Crosby
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web ApplicationsSeth McLaughlin
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerApplitools
 
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.jsSeth 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 TestsSriram Angajala
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in YiiIlPeach
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8nagpalprachi
 
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 2015Andrew Eisenberg
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular SlidesJim Lynch
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ CodeceptionTudor 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 8Sam 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 ProtractorFilipe 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 JourneyOren 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 2015Codemotion
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in YiiIlPeach
 
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 sideMek Srunyu Stittri
 

What's hot (20)

Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test Runner
 
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
 
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)
 
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
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
 
Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
 
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
 
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,...
 
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)
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and Protractor
 
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
 
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
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
 
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
 

Viewers also liked

Agile JavaScript Testing
Agile JavaScript TestingAgile JavaScript Testing
Agile JavaScript TestingScott Becker
 
Maintainable JavaScript 2011
Maintainable JavaScript 2011Maintainable JavaScript 2011
Maintainable JavaScript 2011Nicholas Zakas
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureNicholas 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 - 20150409Minko3D
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014Matt 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 awesomeAndrew Hull
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for AndroidHazem 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 2013Hazem 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 FoundryRaja Rao DV
 
Meteor 0.3.6 Preview
Meteor 0.3.6 PreviewMeteor 0.3.6 Preview
Meteor 0.3.6 PreviewJuntai 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 yamoo9yamoo9
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 MinutesPatrick Crowley
 

Viewers also liked (20)

Agile JavaScript Testing
Agile JavaScript TestingAgile JavaScript Testing
Agile JavaScript Testing
 
Maintainable JavaScript 2011
Maintainable JavaScript 2011Maintainable JavaScript 2011
Maintainable JavaScript 2011
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
 
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)
 
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
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014
 
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
 
Unit testing js
Unit testing jsUnit testing js
Unit testing js
 
Intro To Sammy
Intro To SammyIntro To Sammy
Intro To Sammy
 
All About Sammy
All About SammyAll About Sammy
All About Sammy
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
 
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
 
모바일 컨버전스 5가지 패러다임 업로드용
모바일 컨버전스 5가지 패러다임 업로드용모바일 컨버전스 5가지 패러다임 업로드용
모바일 컨버전스 5가지 패러다임 업로드용
 
Unit Testing TypeScript
Unit Testing TypeScriptUnit Testing TypeScript
Unit Testing TypeScript
 
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)
 
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
 
Meteor 0.3.6 Preview
Meteor 0.3.6 PreviewMeteor 0.3.6 Preview
Meteor 0.3.6 Preview
 
제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트
 
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
다이내믹 스타일시트 언어 Less framework 활용 by yamoo9
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 Minutes
 

Similar to Efficient JavaScript Unit Testing, May 2012

Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Hazem Saleh
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
S313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discoveringS313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discoveringromanovfedor
 
[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 JavaScriptHazem Saleh
 
Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...Rachid Kherrazi
 
Angular Unit testing.pptx
Angular Unit testing.pptxAngular Unit testing.pptx
Angular Unit testing.pptxRiyaBangera
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testingMats Bryntse
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseUTC Fire & Security
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web developmentalice yang
 
Introduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsIntroduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsHabilelabs
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Enhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfEnhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfAnanthReddy38
 

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
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
S313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discoveringS313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discovering
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
[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
 
Qa process
Qa processQa process
Qa process
 
Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...Quest to the best test automation for low code development platform kherrazi ...
Quest to the best test automation for low code development platform kherrazi ...
 
Qa process
Qa processQa process
Qa process
 
Testing Angular
Testing AngularTesting Angular
Testing Angular
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 
Angular Unit testing.pptx
Angular Unit testing.pptxAngular Unit testing.pptx
Angular Unit testing.pptx
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
Protractor
Protractor Protractor
Protractor
 
Introduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsIntroduction to Protractor - Habilelabs
Introduction to Protractor - Habilelabs
 
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Enhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfEnhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdf
 

More from 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 2018Hazem 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 101Hazem Saleh
 
[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache CordovaHazem 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 ActionHazem Saleh
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In ActionHazem 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 CordovaHazem 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 CordovaHazem 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 2014Hazem Saleh
 
Dojo >= 1.7 Kickstart
Dojo >= 1.7  KickstartDojo >= 1.7  Kickstart
Dojo >= 1.7 KickstartHazem 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 2013Hazem Saleh
 
JSF Mashups in Action
JSF Mashups in ActionJSF Mashups in Action
JSF Mashups in ActionHazem Saleh
 
JavaScript tools
JavaScript toolsJavaScript tools
JavaScript toolsHazem 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 JavaHazem Saleh
 

More from Hazem Saleh (14)

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
 
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
 
[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova
 
[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
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 
[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
 
[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
 
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
 
Dojo >= 1.7 Kickstart
Dojo >= 1.7  KickstartDojo >= 1.7  Kickstart
Dojo >= 1.7 Kickstart
 
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
 
JSF Mashups in Action
JSF Mashups in ActionJSF Mashups in Action
JSF Mashups in Action
 
JavaScript tools
JavaScript toolsJavaScript tools
JavaScript tools
 
[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
 
GMaps4JSF
GMaps4JSFGMaps4JSF
GMaps4JSF
 

Recently uploaded

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

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.