Devops for Growth
112.1K views | +2 today
Follow
Devops for Growth
For Product Owners/Product Managers and Scrum Teams: Growth Hacking, Devops, Agile, Lean for IT, Lean Startup, customer centric, software quality...
Curated by Mickael Ruau
Your new post is loading...
Your new post is loading...

Popular Tags

Current selected tag: 'javascript'. Clear
Scooped by Mickael Ruau
October 25, 2013 4:37 PM
Scoop.it!

JSDB.io - Intern

A next-generation code testing stack for JavaScript.
Mickael Ruau's insight:
ComparisonFeatureInternQUnitMochaJasmineBusterJSKarmaCode coverage analysisYesNoYesNoExtensionYesTrue1 browser eventsYesNoNoNoNoNoNative AMD supportYesNoNoNoExtensionExtensionStand-alone2 browser supportYesYesBuild requiredBuild requiredExperimentalNoNode.js supportYesNo3YesYesYesYesAny4 assertion libraryYesNoYesNoYesN/ADefault test interfaceTDD, BDD, objectTDDTDD, BDD, objectBDDTDD, BDDN/AExtensible test interfacesYesNoYesNoYesN/AExtensible reportersYesNoYesNoYesN/AAsynchronous supportPromisesGlobalsCallbacksPollingCallbacks, PromisesCallbacksSelenium supportYesNoNoNoNoNoBuilt-in CI supportYesNoNoNoYesYesBuilt-in Sauce Labs integrationYesNoNoNoNoNoBuilt-in Travis CI integrationYesNoNoNoNoYesGrunt supportYes3rd party3rd party3rd party3rd party3rd party

No comment yet.
Scooped by Mickael Ruau
October 24, 2013 3:01 AM
Scoop.it!

Analysis: Just how complex is your JavaScript code?

Analysis: Just how complex is your JavaScript code? | Devops for Growth | Scoop.it
Want to know how complex your JavaScript code really is? Run it through Analysis and see for yourself.
No comment yet.
Scooped by Mickael Ruau
October 22, 2013 10:46 AM
Scoop.it!

Continuous Monitoring of JavaScript Code Complexity

Continuous Monitoring of JavaScript Code Complexity | Devops for Growth | Scoop.it
Complicated code is difficult to digest and hard to maintain. The best way to avoid it is by not having it at the first place. For web applications written in JavaScript, fortunately we have enough...
Mickael Ruau's insight:

Analyzing code complexity is rather easy these days with the project like JSComplexity. Even better, the complexity metrics can be visualized in a good-looking and interactive report showing different metrics from McCabes cyclomatic complexity to Halstead complexity measures. Both these tools are easy to setup, they run quite well on the command-line (using Node.js).

No comment yet.
Scooped by Mickael Ruau
October 22, 2013 10:36 AM
Scoop.it!

Code Coverage of QUnit Tests using Istanbul and Karma

Code Coverage of QUnit Tests using Istanbul and Karma | Devops for Growth | Scoop.it

QUnit, used by projects like jQuery and jQuery Mobile, is a rather popular JavaScript testing framework. For tests written using QUnit, how do we measure its code coverage? A possible solution which is quite easy to setup is to leverage the deadly combination of Karma and Istanbul.

Mickael Ruau's insight:

Now that code coverage is tracker, perhaps you are ready for the next level? It is about setting the hard threshold so that future coverage regression will never happen. Protect yourself and your team from carelessness, overconfidence, or honest mistakes!

No comment yet.
Scooped by Mickael Ruau
October 21, 2013 9:22 AM
Scoop.it!

Introduction to Unit Testing | QUnit

Introduction to Unit Testing | QUnit | Devops for Growth | Scoop.it

You probably know that testing is good, but the first hurdle to overcome when trying to write unit tests for client-side code is the lack of any actual units; JavaScript code is written for each page of a website or each module of an application and is closely intermixed with back-end logic and related HTML. In the worst case, the code is completely mixed with HTML, as inline events handlers.

 

This is likely the case when no JavaScript library for some DOM abstraction is being used; writing inline event handlers is much easier than using the DOM APIs to bind those events. More and more developers are picking up a library such as jQuery to handle the DOM abstraction, allowing them to move those inline events to distinct scripts, either on the same page or even in a separate JavaScript file. However, putting the code into separate files doesn’t mean that it is ready to be tested as a unit.

 

What is a unit anyway? In the best case, it is a pure function that you can deal with in some way — a function that always gives you the same result for a given input. This makes unit testing pretty easy, but most of the time you need to deal with side effects, which here means DOM manipulations. It’s still useful to figure out which units we can structure our code into and to build unit tests accordingly.

 

 

 

Mickael Ruau's insight:

Testing JavaScript code is not just a matter of using some test runner and writing a few tests; it usually requires some heavy structural changes when applied to code that has been tested only manually before. We’ve walked through an example of how to change the code structure of an existing module to run some tests using an ad-hoc testing framework, then replacing that with a more full-featured framework to get useful visual results.

QUnit itself has a lot more to offer, with specific support for testing asynchronous code such as timeouts, AJAX and events. Its visual test runner helps to debug code by making it easy to rerun specific tests and by providing stack traces for failed assertions and caught exceptions. For further reading, check out the QUnit Cookbook.

Originally published on Smashing Magazine, June 2012

No comment yet.
Scooped by Mickael Ruau
October 21, 2013 9:17 AM
Scoop.it!

JavaScript Code Coverage with Istanbul

JavaScript Code Coverage with Istanbul | Devops for Growth | Scoop.it
Achieving a good code coverage is a useful practice in today's software craftsmanship. For JavaScript applications, whether it is for the browser or for the server, many tools to check the statemen...
Mickael Ruau's insight:

Istanbul is pure JavaScript, there is no native code or other kind of native libraries wrapper involved.

Istanbul requires Node.js, the package can be installed as:

npm install istanbul

Using Istanbul with command-line Node.js application is fairly straightforward. Assuming you have test.js like this:

x =42; if(false) x =-1;

We can analyze the coverage by running:

istanbul cover test.js

which gives the following outcome:

=============================== Coverage summary =============================== Statements : 66.67% ( 2/3 ) Branches : 50% ( 1/2 ) Functions : 100% ( 0/0 ) Lines : 66.67% ( 2/3 ) ================================================================================

Even if you put all the above code in just one line, Istanbul can still give the correct coverage result. This is because Istanbul does not work based on line-by-line coverage, it does fully understands JavaScript syntax. Beside the quick text-based report, Istanbul also produces the coverage report in LCOV format. This way, the coverage report can be nicely shown, with color coding and other fancy features:

 
No comment yet.
Scooped by Mickael Ruau
October 18, 2013 6:00 PM
Scoop.it!

BlueDuck AutoIt driver for Selenium

BlueDuck AutoIt driver for Selenium | Devops for Growth | Scoop.it

BlueDuck SDA combining automation for Win32 and Web in a single script. The perfect combination for developing automated cases, AutoIt and Selenium together

Mickael Ruau's insight:
FeaturesData provider - in BlueDuck SDA as a bridge between a Test and a data source. A data provider is used to retrieve data from a data source (xls,ini,xml) and to reconcile changes to hat data back to the data source.Object Repositories (Test Object Model) - When you create a test, you need to set the resources that will be used by that test.Test objects are stored representations of the actual elements in your application.Data generator - is an automatic data generator for testing. It helps testers to automatically generate test data in test script with logically correct and realistic test data.Page Object pattern - native support for Page Object pattern.Record screen - native support for records screen activity from the Windows desktop into standard AVI movie files.Handles popup - native support forHandles popup dialogs like alert, confirm, login etc..Scripts can be Into standalone executables compiledis also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!
No comment yet.
Scooped by Mickael Ruau
October 15, 2013 4:35 PM
Scoop.it!

Introduction aux tests unitaires en javascript. | Blog Xebia France

Introduction aux tests unitaires en javascript. | Blog Xebia France | Devops for Growth | Scoop.it
Les tests unitaires sont aujourd’hui une norme dans le développement des applications Java.
Mickael Ruau's insight:

Nous allons voir dans cet article la logique des tests unitaires en javascript pur afin de mieux appréhender le fonctionnement des frameworks de tests automatisés tel que Jasmine, mocha ou QUnit. Nous montrerons d’ailleurs une version de ces tests avecQUnit afin de commencer à voir les possibilités que peuvent nous offrir ces frameworks.

No comment yet.
Scooped by Mickael Ruau
October 9, 2013 9:52 AM
Scoop.it!

JSLint, The JavaScript Code Quality Tool

Un outil standard d'audit de qualité de code.

No comment yet.
Scooped by Mickael Ruau
August 31, 2013 8:16 AM
Scoop.it!

Grunt : le JavaScript se “build”

Grunt : le JavaScript se “build” | Devops for Growth | Scoop.it
Grunt se présente aujourd’hui comme l’outil indispensable du build JavaScript. Il apporte de la structure et une harmonisation qui donne du crédit à tout l’écosystème JavaScript.
Mickael Ruau's insight:

Il est très fédérateur puisqu’il rassemble des mondes très différents tels que celui du Web et de NodeJS, mais aussi celui du build, de l’intégration continue, des tests unitaires ou encore de la qualité de code.

Le projet Grunt représente, à lui seul, de nombreuses particularités des projets JavaScript. Simplicité, jeunesse, adoption exponentielle, efficacité... Le détailler permet d’avoir un bon aperçu d’un écosystème en plein essor.

No comment yet.
Scooped by Mickael Ruau
October 24, 2013 4:31 AM
Scoop.it!

DailyJS: Hosting Node Apps

DailyJS: Hosting Node Apps | Devops for Growth | Scoop.it

This tutorial walks you through setting up a server that can host node.js apps for server-side JavaScript applications. Right now, the node.js hosting options boil down to running node daemon processes that talk to a web server. Most web servers can proxy connections to a different port, so you’ll be able to use Apache or nginx to do this.

Mickael Ruau's insight:

I hope you’ve gone from 0 to node hosting without any major hassle. It’s still a slightly awkward process, and I haven’t said anything about running multiple node instances and load balancing them. It might feel a little bit hackish to use a proxy and monit, but all my production servers end up running monit anyway, so not having a one-click mod_nodejs style solution isn’t a great barrier to deployment.

Deploying Node.js With Upstart and MonitRun Node.js as a Service on Ubuntu Karmicnginx proxy loadbalacing
No comment yet.
Scooped by Mickael Ruau
October 22, 2013 10:56 AM
Scoop.it!

Complexity Analysis of JavaScript Code

Complexity Analysis of JavaScript Code | Devops for Growth | Scoop.it
Nobody likes to read complex code, especially if it's someone's else code. A preventive approach to block any complex code entering the application is by watching its complexity carefully. There ar...
Mickael Ruau's insight:

There are many measures of code complexity, the popular ones are McCabes cyclomatic complexity and Halsteads complexity. For JavaScript applications, there is a new tool from Phil Booth called JSComplexity which can be used to analyze your code and find out the complexity measures. Besides the above two code metrics, JSComplexity also produces the logical line of code (LOC) and the overall maintainability index. There is a whole page dedicated to explain the definition of these metrics and how they are computed.

No comment yet.
Scooped by Mickael Ruau
October 22, 2013 10:45 AM
Scoop.it!

JavaScript Code Complexity Visualization

JavaScript Code Complexity Visualization | Devops for Growth | Scoop.it
I have written about the concept and the tool for complexity analysis of JavaScript code before. In addition to that complexity monitoring strategy, apparently it is also useful to produce the so-c...
Mickael Ruau's insight:

Plato is very easy to use. Just install the plato package(you need Node.js) and you are ready to analyze your own code.

Who says code analysis can’t be fun?

No comment yet.
Scooped by Mickael Ruau
October 22, 2013 10:34 AM
Scoop.it!

Scope Analysis for JavaScript Code

Scope Analysis for JavaScript Code | Devops for Growth | Scoop.it
Walking the syntax tree of a JavaScript code is often the first step towards building a specialized static analyzer. In some cases however, when the analysis involves variables and functions within...
Mickael Ruau's insight:

Fortunately, these days you can use a microlibrary called Escope (GitHub: Constellation/escope) which can analyze the scope of the entire code.

This adds another useful library to the existing family of Esprima (for parsing), Estraverse (syntax traversal tool), and Escodegen (code regeneration). This arsenal of tools can be quite deadly.

No comment yet.
Scooped by Mickael Ruau
October 21, 2013 9:20 AM
Scoop.it!

QUnit

QUnit is a powerful, easy-to-use JavaScript unit testing framework. It's used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code, including itself!

 

 

Mickael Ruau's insight:

A minimal QUnit test setup:

1234567891011121314<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>QUnit Example</title> <link rel="stylesheet" href="/resources/qunit.css"></head><body> <div id="qunit"></div> <div id="qunit-fixture"></div> <script src="/resources/qunit.js"></script> <script src="/resources/tests.js"></script></body></html>

The contents of tests.js:

123test( "hello test", function() { ok( 1 == "1", "Passed!" );});

 

The result:

Tests completed in 15 milliseconds.
1 tests of 1 passed, 0 failed.

hello test (0, 1, 1)Rerun
No comment yet.
Scooped by Mickael Ruau
October 19, 2013 5:30 AM
Scoop.it!

SonarQube JavaScript plugin: why compete with JSLint and JSHint ?

SonarQube JavaScript plugin: why compete with JSLint and JSHint ? | Devops for Growth | Scoop.it
This question has been raised several times on the Sonar mailing lists. Indeed since version 1.0, the SonarQube JavaScript plugin hasn’t relied on external rule engines like JSLint or JSHint.
No comment yet.
Scooped by Mickael Ruau
October 18, 2013 4:49 PM
Scoop.it!

Yasca

Yasca is an open source program which looks for security vulnerabilities, code-quality, performance, and conformance to best practices in program source code, integrating with other open-source tools as needed.

Mickael Ruau's insight:

Yasca est utilisable avec une vaste liste de langages.

No comment yet.
Scooped by Mickael Ruau
October 14, 2013 9:21 AM
Scoop.it!

RegEx Helper: a notepad++ plugin

A Notepad++ plugin that allows users to develop regular expressions and test them against their open documents.
No comment yet.
Scooped by Mickael Ruau
October 5, 2013 8:14 AM
Scoop.it!

End-to-End JavaScript Quality Analysis - Programming - O'Reilly Media

End-to-End JavaScript Quality Analysis - Programming - O'Reilly Media | Devops for Growth | Scoop.it
The rise of single-page web applications means that front-end developers need to pay attention not only to network transport optimization, but also to rendering and computation performance. With applications...
Mickael Ruau's insight:

These days, we are seeing easy-to-use coverage tools such as Istanbul and Blanket.js become widespread, and they work seamlessly with popular test frameworks such as Jasmine, Mocha, Karma, and many others.

 

(...)

With a tool like JSComplexity, code complexity metrics can be obtained in static analysis steps. Even better, you can track both McCabe’s cyclomatic complexity and Halstead complexity measures of every function over time. This prevents accidental code changes that could be adding more complexity to the code. For the application dashboard or continuous integration panel, these complexity metrics can be visualized using Plato in a few easy steps.

 

(...)

An optimal application development workflow does not treat the application performance as an afterthought. Performance is a feature and therefore its metrics must be an integral part of the workflow. This is where amulti-layer defense approach can help a lot. Even if the QA team can perform a series of thorough and intensive tests, a simple smoke test (possibly via a command-line headless web automation such asPhantomJS) can reveal any mistake as early as possible. After all, what is the purpose of hammering the address book application if its sorting feature suddenly becomes unbearably slow?

  
No comment yet.