SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
JAVASCRIPT-QA-TOOLS




Tuesday, October 16, 12
Tuesday, October 16, 12
WER BIN ICH?


    • Sebastian           Springer

    • 29

    • Dipl. Inf. (FH)

    • Teamleiter           @ Mayflower



Tuesday, October 16, 12
WAS ERZÄHLE ICH HEUTE?


    • Was            bringt mir eine hohe Qualität überhaupt?

    • Welche Tools           kann ich nutzen?

    • Wie            kann ich die QA automatisieren?




Tuesday, October 16, 12
LET’S GO




Tuesday, October 16, 12
WARUM
                    QUALITÄTSSICHERUNG?



Tuesday, October 16, 12
JAVASCRIPT === QUICK & DIRTY




Tuesday, October 16, 12
JAVASCRIPT === QUICK & DIRTY


    • Leichtgewichtig

    • Schnelle              Ergebnisse

    • Direkt              in HTML eingebettet

    • (Fast)              überall verfügbar



Tuesday, October 16, 12
langfristig

JAVASCRIPT === QUICK & DIRTY




Tuesday, October 16, 12
UND WAS IST JETZT
                             QUALITÄT?



Tuesday, October 16, 12
WAS IST QUALITÄT?

    • Reliability

    • Efficiency

    • Security

    • Maintainability

    • Size



Tuesday, October 16, 12
8                 Qualitätssicherung als
                kontinuierlicher Prozess

Tuesday, October 16, 12
Continuous Inspection



Tuesday, October 16, 12
Continuous Integration



Tuesday, October 16, 12
QA IM KLEINEN - DIE IDE




Tuesday, October 16, 12
IDE - EINSTELLUNGEN




Tuesday, October 16, 12
QA IM GROßEN - JENKINS




Tuesday, October 16, 12
JENKINS - KONFIGURATION


    • Build Targets           mit Apache Ant

    • Build.xml

    • Build           Steps

    • Visualisierung          über Plugins



Tuesday, October 16, 12
JENKINS KONFIGURATION




Tuesday, October 16, 12
JENKINS - KONFIGURATION


    • Projektkonfiguration
        /var/lib/jenkins/jobs/<Projekt>/config.xml

    • Ant-Konfiguration
        /var/lib/jenkins/jobs/<Projekt>/workspace/build.xml




Tuesday, October 16, 12
UND WOZU DAS GANZE?




Tuesday, October 16, 12
Schnelle Rückmeldung



Tuesday, October 16, 12
BEISPIEL: DATE CALC




Tuesday, October 16, 12
BEISPIEL: DATE CALC




Tuesday, October 16, 12
BEISPIEL: DATE CALC
                                         Datum eingeben




Tuesday, October 16, 12
BEISPIEL: DATE CALC
                                         Offfset eingeben




Tuesday, October 16, 12
BEISPIEL: DATE CALC




                                       Datum berechnen
                                            lassen


Tuesday, October 16, 12
BEISPIEL: DATE CALC


                              Feiertage beachten!




Tuesday, October 16, 12
CODE-ANFORDERUNGEN


    • JSLinted

    • Kein           Copy/Paste Code

    • Unittests

    • Akzeptanztests




Tuesday, October 16, 12
WIE?




Tuesday, October 16, 12
Toolunterstützung &
                            Automatisierung


Tuesday, October 16, 12
CODE-ANFORDERUNGEN


    • JSLinted

    • Kein           Copy/Paste Code

    • Unittests

    • Akzeptanztests




Tuesday, October 16, 12
JSLINT




Tuesday, October 16, 12
JSLINT?
                          ANYONE?



Tuesday, October 16, 12
IT WILL HURT YOUR FEELINGS




Tuesday, October 16, 12
WAS TUT JSLINT?
    • Codingstyle               - Whitespaces

    • ==          und != vs. === und !==

    • Variablendeklaration              zu Beginn einer Funktion

    • “use           strict”

    • Keine               Globale Variablen

    • Definition               vor Verwendung

    • eval          is EVIL
Tuesday, October 16, 12
JSLINT IN DER IDE




Tuesday, October 16, 12
JSLINT IN JENKINS
<target name="jslint">
    <apply executable="java" output="${basedir}/build/
                                      jslint/jslint.xml">
        <arg value="-jar" />
        <arg value="/opt/jslint4java/jslint4java.jar" />
        <arg value="--report" />
        <arg value="xml" />
        <fileset dir="${basedir}/source">
             <patternset>
                 <include name="**/*.js" />
             </patternset>
        </fileset>
    </apply>
</target>

Tuesday, October 16, 12
JSLINT IN JENKINS



    • Plugin: Violations        Plugin

    • Post-build          action: Report Violations




Tuesday, October 16, 12
CODE-ANFORDERUNGEN


    • JSLinted

    • Kein           Copy/Paste Code

    • Unittests

    • Akzeptanztests




Tuesday, October 16, 12
COPY AND PASTE
                            DETECTION



Tuesday, October 16, 12
WAS MACHT CPD?



    • Duplikate             im Quellcode finden

    • Tokens              statt Strings




Tuesday, October 16, 12
WARUM CPD?


    • Verbesserungen             an mehreren Stellen

    • Bugfixes             an mehreren Stellen




Tuesday, October 16, 12
WARUM CPD?


    • Verbesserungen             an mehreren Stellen

    • Bugfixes             an mehreren Stellen




                  = erhöhter Wartungsaufwand
Tuesday, October 16, 12
CPD IN DER IDE




Tuesday, October 16, 12
CPD IN DER IDE




Tuesday, October 16, 12
CPD IN JENKINS
  <target name="jscpd">
      <exec executable="/opt/PMD/pmd-bin-5.0.0/bin/run.sh">
          <arg value="cpd" />
          <arg value="--minimum-tokens" />
          <arg value="5" />
          <arg value="--files" />
          <arg value="source" />
          <arg value="--language" />
          <arg value="ecmascript" />
          <arg value="--format" />
          <arg value="xmls" />
          <arg value="build/jscpd/jscpd.xml" />
      </exec>
  </target>


Tuesday, October 16, 12
CPD IN JENKINS



    • Plugin: Duplicate         Code Scanner Plug-in

    • Post-build          action: Publish duplicate code analysis results




Tuesday, October 16, 12
CPD IN JENKINS



    • Plugin: Violations        Plugin

    • Post-build          action: Report Violations




Tuesday, October 16, 12
CODE-ANFORDERUNGEN


    • JSLinted

    • Kein           Copy/Paste Code

    • Unittests

    • Akzeptanztests




Tuesday, October 16, 12
UNITTESTS




Tuesday, October 16, 12
WARUM UNITTESTS?


    • Stabilität

    • Sicherheit          für Developer

    • Dokumentation

    • Pro          Bug ein Test



Tuesday, October 16, 12
JASMINE

         describe("DateCalc", function () {
             it("should return...", function () {
                 var dateCalc = new DateCalc(),
                        result = dateCalc.resolveDate();
                    expect(result).toBeFalsy();
             });
         });




Tuesday, October 16, 12
JSTESTDRIVER


    • Testing             Framework

    • Browser              Capturing

    • Coverage

    • Plugins             für andere Frameworks (qUnit, Jasmine, etc.)



Tuesday, October 16, 12
JASMINE IN JENKINS
                          java -jar JsTestDriver.jar --port 9876




Tuesday, October 16, 12
JASMINE IN JENKINS
       <target name="jasmine">
         <exec executable="java">
           <arg value="-jar" />
           <arg value="/opt/jstestdriver/
       JsTestDriver-1.3.5.jar" />
           <arg value="--config" />
           <arg value="${basedir}/source/
       DateCalcJenkins.jstd" />
           <arg value="--tests" />
           <arg value="all" />
           <arg value="--testOutput" />
           <arg value="${basedir}/build/jstestdriver" />
         </exec>
       </target>

Tuesday, October 16, 12
JASMINE IN JENKINS



    • Plugin: xUnit         Plugin

    • Post-build          action: Publish xUnit test result report




Tuesday, October 16, 12
COVERAGE



    • Voraussetzung       #1: JsTestDriver Coverage Plugin

    • Voraussetzung       #2: Lcov to Cobertura Converter




Tuesday, October 16, 12
COVERAGE

<target name="coverage">
  <exec executable="/opt/jstestdriver/lcov_cobertura.py">
    <arg value="${basedir}/build/jstestdriver/
                jsTestDriver.conf-coverage.dat" />
    <arg value="-o" />
    <arg value="${basedir}/build/jstestdriver/coverage.xml" /
  </exec>
</target>




Tuesday, October 16, 12
COVERAGE



    • Plugin: Cobertura          Plugin

    • Post-build          action: Publish Cobertura Coverage Report




Tuesday, October 16, 12
CONFIG.JSTD
server: http://localhost:9876

load:
  - lib/jasmine-1.2.0.rc3/jasmine.js
  - lib/jasmine-jstd-adapter/src/JasmineAdapter.js
  - spec/DateCalc.js
  - spec/Holiday.js
  - src/DateCalc.js
  - src/Holiday.js

plugin:
 - name: "coverage"
   jar: "/opt/JsTestDriver/plugins/coverage.jar"
   module: "com.google.jstestdriver.coverage.CoverageM

Tuesday, October 16, 12
JASMINE IN DER IDE




Tuesday, October 16, 12
JASMINE IN DER IDE




Tuesday, October 16, 12
JASMINE IN DER IDE




Tuesday, October 16, 12
CODE-ANFORDERUNGEN


    • JSLinted

    • Kein           Copy/Paste Code

    • Unittests

    • Akzeptanztests




Tuesday, October 16, 12
AKZEPTANZTESTS




Tuesday, October 16, 12
WARUM AKZEPTANZTESTS?


    • Tests               gegen Akzeptanzkriterien

    • Anforderungen                vs. Umsetzung

    • Nicht               von Entwicklern




Tuesday, October 16, 12
SELENIUM IDE




Tuesday, October 16, 12
SELENIUM IN JENKINS
<target name=”selenium”>
  <exec executable=”java” output=”${basedir}/build/
selenium/results.html>
    <arg value=”-jar” />
    <arg value=”/opt/selenium/selenium-server.jar” />
    <arg value=”-htmlSuite” />
    <arg value=”*firefox” />
    <arg value=”http://datecalc.basti.dev” />
    <arg value=”/srv/www/vhosts/datecalc/tests/
suite.html” />
  </exec>
</target>



Tuesday, October 16, 12
SELENIUM IN JENKINS



    • Plugin: Selenium          HTML report Plugin

    • Post-build           action: Publish Selenium HTML Report




Tuesday, October 16, 12
CHUCK NORRIS PLUGIN




Tuesday, October 16, 12
FRAGEN?




Tuesday, October 16, 12
KONTAKT
                          Sebastian Springer
                          sebastian.springer@mayflower.de

                          Mayflower GmbH
                          Mannhardtstr. 6
                          80538 München
                          Deutschland

                          @basti_springer

                          https://github.com/sspringer82



Tuesday, October 16, 12

Weitere ähnliche Inhalte

Was ist angesagt?

Enterprise javascriptsession1
Enterprise javascriptsession1Enterprise javascriptsession1
Enterprise javascriptsession1
Troy Miles
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
oscon2007
 

Was ist angesagt? (8)

Enterprise javascriptsession1
Enterprise javascriptsession1Enterprise javascriptsession1
Enterprise javascriptsession1
 
Maintaining Your Tests At Scale
Maintaining Your Tests At ScaleMaintaining Your Tests At Scale
Maintaining Your Tests At Scale
 
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
 
Scala.js & friends: SCALA ALL THE THINGS
Scala.js & friends: SCALA ALL THE THINGSScala.js & friends: SCALA ALL THE THINGS
Scala.js & friends: SCALA ALL THE THINGS
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projects
 

Andere mochten auch

Weblogs im Museum
Weblogs im MuseumWeblogs im Museum
Weblogs im Museum
Tine Nowak
 

Andere mochten auch (8)

Open Educational Resources in Higher education
Open Educational Resources in Higher education Open Educational Resources in Higher education
Open Educational Resources in Higher education
 
Kommunikations-APIs von JavaScript (International PHP Conference/WebTechCon 2...
Kommunikations-APIs von JavaScript (International PHP Conference/WebTechCon 2...Kommunikations-APIs von JavaScript (International PHP Conference/WebTechCon 2...
Kommunikations-APIs von JavaScript (International PHP Conference/WebTechCon 2...
 
Beschleunigung via Twitter (Input)
Beschleunigung via Twitter (Input)Beschleunigung via Twitter (Input)
Beschleunigung via Twitter (Input)
 
Qualität von MOOCs
Qualität von MOOCsQualität von MOOCs
Qualität von MOOCs
 
Qualität von MOOCs - Folien zum GMW Workshop mit Rolf Schulmeister, Claudia B...
Qualität von MOOCs - Folien zum GMW Workshop mit Rolf Schulmeister, Claudia B...Qualität von MOOCs - Folien zum GMW Workshop mit Rolf Schulmeister, Claudia B...
Qualität von MOOCs - Folien zum GMW Workshop mit Rolf Schulmeister, Claudia B...
 
Quaity of MOOCs - Results of "The MOOC Quality Project"
Quaity of MOOCs - Results of "The MOOC Quality Project"Quaity of MOOCs - Results of "The MOOC Quality Project"
Quaity of MOOCs - Results of "The MOOC Quality Project"
 
Weblogs im Museum
Weblogs im MuseumWeblogs im Museum
Weblogs im Museum
 
E-Learning im Museum
E-Learning im MuseumE-Learning im Museum
E-Learning im Museum
 

Ähnlich wie JavaScript QA Tools

Automated tests workshop
Automated tests workshopAutomated tests workshop
Automated tests workshop
drewz lin
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP Testing
Ran Mizrahi
 

Ähnlich wie JavaScript QA Tools (20)

Continuous Integration for IOS Apps
Continuous Integration for IOS AppsContinuous Integration for IOS Apps
Continuous Integration for IOS Apps
 
Creating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsCreating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance Tests
 
Automated tests workshop
Automated tests workshopAutomated tests workshop
Automated tests workshop
 
Ruby meetup 7_years_in_testing
Ruby meetup 7_years_in_testingRuby meetup 7_years_in_testing
Ruby meetup 7_years_in_testing
 
Código Fácil De Testear
Código Fácil De TestearCódigo Fácil De Testear
Código Fácil De Testear
 
How we're building Wercker
How we're building WerckerHow we're building Wercker
How we're building Wercker
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP Testing
 
Las maravillas de Google App Engine
Las maravillas de Google App EngineLas maravillas de Google App Engine
Las maravillas de Google App Engine
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develoment
 
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
 
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
 
Using Apache Cassandra: What is this thing, and how do I use it?
Using Apache Cassandra: What is this thing, and how do I use it?Using Apache Cassandra: What is this thing, and how do I use it?
Using Apache Cassandra: What is this thing, and how do I use it?
 
April JavaScript Tools
April JavaScript ToolsApril JavaScript Tools
April JavaScript Tools
 
How to Tame TDD - ISTA 2017
How to Tame TDD - ISTA 2017How to Tame TDD - ISTA 2017
How to Tame TDD - ISTA 2017
 
Backbone.js, Socket.io und Node.js im Einsatz
Backbone.js, Socket.io und Node.js im EinsatzBackbone.js, Socket.io und Node.js im Einsatz
Backbone.js, Socket.io und Node.js im Einsatz
 
Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (IWOMM)Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (IWOMM)
 
Cassandra Meetup: Real-time Analytics using Cassandra, Spark and Shark at Ooyala
Cassandra Meetup: Real-time Analytics using Cassandra, Spark and Shark at OoyalaCassandra Meetup: Real-time Analytics using Cassandra, Spark and Shark at Ooyala
Cassandra Meetup: Real-time Analytics using Cassandra, Spark and Shark at Ooyala
 
Grunt understanding
Grunt understandingGrunt understanding
Grunt understanding
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
 
Everything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der PraxisEverything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der Praxis
 

Mehr von Sebastian Springer

Mehr von Sebastian Springer (20)

Schnelleinstieg in Angular
Schnelleinstieg in AngularSchnelleinstieg in Angular
Schnelleinstieg in Angular
 
Creating Enterprise Web Applications with Node.js
Creating Enterprise Web Applications with Node.jsCreating Enterprise Web Applications with Node.js
Creating Enterprise Web Applications with Node.js
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
 
From Zero to Hero – Web Performance
From Zero to Hero – Web PerformanceFrom Zero to Hero – Web Performance
From Zero to Hero – Web Performance
 
Von 0 auf 100 - Performance im Web
Von 0 auf 100 - Performance im WebVon 0 auf 100 - Performance im Web
Von 0 auf 100 - Performance im Web
 
A/B Testing mit Node.js
A/B Testing mit Node.jsA/B Testing mit Node.js
A/B Testing mit Node.js
 
Angular2
Angular2Angular2
Angular2
 
Einführung in React
Einführung in ReactEinführung in React
Einführung in React
 
JavaScript Performance
JavaScript PerformanceJavaScript Performance
JavaScript Performance
 
ECMAScript 6 im Produktivbetrieb
ECMAScript 6 im ProduktivbetriebECMAScript 6 im Produktivbetrieb
ECMAScript 6 im Produktivbetrieb
 
Streams in Node.js
Streams in Node.jsStreams in Node.js
Streams in Node.js
 
JavaScript Performance
JavaScript PerformanceJavaScript Performance
JavaScript Performance
 
Große Applikationen mit AngularJS
Große Applikationen mit AngularJSGroße Applikationen mit AngularJS
Große Applikationen mit AngularJS
 
Testing tools
Testing toolsTesting tools
Testing tools
 
Node.js Security
Node.js SecurityNode.js Security
Node.js Security
 
Typescript
TypescriptTypescript
Typescript
 
Reactive Programming
Reactive ProgrammingReactive Programming
Reactive Programming
 
Best Practices für TDD in JavaScript
Best Practices für TDD in JavaScriptBest Practices für TDD in JavaScript
Best Practices für TDD in JavaScript
 
Warum ECMAScript 6 die Welt ein Stückchen besser macht
Warum ECMAScript 6 die Welt ein Stückchen besser machtWarum ECMAScript 6 die Welt ein Stückchen besser macht
Warum ECMAScript 6 die Welt ein Stückchen besser macht
 
Lean Startup mit JavaScript
Lean Startup mit JavaScriptLean Startup mit JavaScript
Lean Startup mit JavaScript
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

JavaScript QA Tools

  • 3. WER BIN ICH? • Sebastian Springer • 29 • Dipl. Inf. (FH) • Teamleiter @ Mayflower Tuesday, October 16, 12
  • 4. WAS ERZÄHLE ICH HEUTE? • Was bringt mir eine hohe Qualität überhaupt? • Welche Tools kann ich nutzen? • Wie kann ich die QA automatisieren? Tuesday, October 16, 12
  • 6. WARUM QUALITÄTSSICHERUNG? Tuesday, October 16, 12
  • 7. JAVASCRIPT === QUICK & DIRTY Tuesday, October 16, 12
  • 8. JAVASCRIPT === QUICK & DIRTY • Leichtgewichtig • Schnelle Ergebnisse • Direkt in HTML eingebettet • (Fast) überall verfügbar Tuesday, October 16, 12
  • 9. langfristig JAVASCRIPT === QUICK & DIRTY Tuesday, October 16, 12
  • 10. UND WAS IST JETZT QUALITÄT? Tuesday, October 16, 12
  • 11. WAS IST QUALITÄT? • Reliability • Efficiency • Security • Maintainability • Size Tuesday, October 16, 12
  • 12. 8 Qualitätssicherung als kontinuierlicher Prozess Tuesday, October 16, 12
  • 15. QA IM KLEINEN - DIE IDE Tuesday, October 16, 12
  • 17. QA IM GROßEN - JENKINS Tuesday, October 16, 12
  • 18. JENKINS - KONFIGURATION • Build Targets mit Apache Ant • Build.xml • Build Steps • Visualisierung über Plugins Tuesday, October 16, 12
  • 20. JENKINS - KONFIGURATION • Projektkonfiguration /var/lib/jenkins/jobs/<Projekt>/config.xml • Ant-Konfiguration /var/lib/jenkins/jobs/<Projekt>/workspace/build.xml Tuesday, October 16, 12
  • 21. UND WOZU DAS GANZE? Tuesday, October 16, 12
  • 25. BEISPIEL: DATE CALC Datum eingeben Tuesday, October 16, 12
  • 26. BEISPIEL: DATE CALC Offfset eingeben Tuesday, October 16, 12
  • 27. BEISPIEL: DATE CALC Datum berechnen lassen Tuesday, October 16, 12
  • 28. BEISPIEL: DATE CALC Feiertage beachten! Tuesday, October 16, 12
  • 29. CODE-ANFORDERUNGEN • JSLinted • Kein Copy/Paste Code • Unittests • Akzeptanztests Tuesday, October 16, 12
  • 31. Toolunterstützung & Automatisierung Tuesday, October 16, 12
  • 32. CODE-ANFORDERUNGEN • JSLinted • Kein Copy/Paste Code • Unittests • Akzeptanztests Tuesday, October 16, 12
  • 34. JSLINT? ANYONE? Tuesday, October 16, 12
  • 35. IT WILL HURT YOUR FEELINGS Tuesday, October 16, 12
  • 36. WAS TUT JSLINT? • Codingstyle - Whitespaces • == und != vs. === und !== • Variablendeklaration zu Beginn einer Funktion • “use strict” • Keine Globale Variablen • Definition vor Verwendung • eval is EVIL Tuesday, October 16, 12
  • 37. JSLINT IN DER IDE Tuesday, October 16, 12
  • 38. JSLINT IN JENKINS <target name="jslint"> <apply executable="java" output="${basedir}/build/ jslint/jslint.xml"> <arg value="-jar" /> <arg value="/opt/jslint4java/jslint4java.jar" /> <arg value="--report" /> <arg value="xml" /> <fileset dir="${basedir}/source"> <patternset> <include name="**/*.js" /> </patternset> </fileset> </apply> </target> Tuesday, October 16, 12
  • 39. JSLINT IN JENKINS • Plugin: Violations Plugin • Post-build action: Report Violations Tuesday, October 16, 12
  • 40. CODE-ANFORDERUNGEN • JSLinted • Kein Copy/Paste Code • Unittests • Akzeptanztests Tuesday, October 16, 12
  • 41. COPY AND PASTE DETECTION Tuesday, October 16, 12
  • 42. WAS MACHT CPD? • Duplikate im Quellcode finden • Tokens statt Strings Tuesday, October 16, 12
  • 43. WARUM CPD? • Verbesserungen an mehreren Stellen • Bugfixes an mehreren Stellen Tuesday, October 16, 12
  • 44. WARUM CPD? • Verbesserungen an mehreren Stellen • Bugfixes an mehreren Stellen = erhöhter Wartungsaufwand Tuesday, October 16, 12
  • 45. CPD IN DER IDE Tuesday, October 16, 12
  • 46. CPD IN DER IDE Tuesday, October 16, 12
  • 47. CPD IN JENKINS <target name="jscpd"> <exec executable="/opt/PMD/pmd-bin-5.0.0/bin/run.sh"> <arg value="cpd" /> <arg value="--minimum-tokens" /> <arg value="5" /> <arg value="--files" /> <arg value="source" /> <arg value="--language" /> <arg value="ecmascript" /> <arg value="--format" /> <arg value="xmls" /> <arg value="build/jscpd/jscpd.xml" /> </exec> </target> Tuesday, October 16, 12
  • 48. CPD IN JENKINS • Plugin: Duplicate Code Scanner Plug-in • Post-build action: Publish duplicate code analysis results Tuesday, October 16, 12
  • 49. CPD IN JENKINS • Plugin: Violations Plugin • Post-build action: Report Violations Tuesday, October 16, 12
  • 50. CODE-ANFORDERUNGEN • JSLinted • Kein Copy/Paste Code • Unittests • Akzeptanztests Tuesday, October 16, 12
  • 52. WARUM UNITTESTS? • Stabilität • Sicherheit für Developer • Dokumentation • Pro Bug ein Test Tuesday, October 16, 12
  • 53. JASMINE describe("DateCalc", function () { it("should return...", function () { var dateCalc = new DateCalc(), result = dateCalc.resolveDate(); expect(result).toBeFalsy(); }); }); Tuesday, October 16, 12
  • 54. JSTESTDRIVER • Testing Framework • Browser Capturing • Coverage • Plugins für andere Frameworks (qUnit, Jasmine, etc.) Tuesday, October 16, 12
  • 55. JASMINE IN JENKINS java -jar JsTestDriver.jar --port 9876 Tuesday, October 16, 12
  • 56. JASMINE IN JENKINS <target name="jasmine"> <exec executable="java"> <arg value="-jar" /> <arg value="/opt/jstestdriver/ JsTestDriver-1.3.5.jar" /> <arg value="--config" /> <arg value="${basedir}/source/ DateCalcJenkins.jstd" /> <arg value="--tests" /> <arg value="all" /> <arg value="--testOutput" /> <arg value="${basedir}/build/jstestdriver" /> </exec> </target> Tuesday, October 16, 12
  • 57. JASMINE IN JENKINS • Plugin: xUnit Plugin • Post-build action: Publish xUnit test result report Tuesday, October 16, 12
  • 58. COVERAGE • Voraussetzung #1: JsTestDriver Coverage Plugin • Voraussetzung #2: Lcov to Cobertura Converter Tuesday, October 16, 12
  • 59. COVERAGE <target name="coverage"> <exec executable="/opt/jstestdriver/lcov_cobertura.py"> <arg value="${basedir}/build/jstestdriver/ jsTestDriver.conf-coverage.dat" /> <arg value="-o" /> <arg value="${basedir}/build/jstestdriver/coverage.xml" / </exec> </target> Tuesday, October 16, 12
  • 60. COVERAGE • Plugin: Cobertura Plugin • Post-build action: Publish Cobertura Coverage Report Tuesday, October 16, 12
  • 61. CONFIG.JSTD server: http://localhost:9876 load: - lib/jasmine-1.2.0.rc3/jasmine.js - lib/jasmine-jstd-adapter/src/JasmineAdapter.js - spec/DateCalc.js - spec/Holiday.js - src/DateCalc.js - src/Holiday.js plugin: - name: "coverage" jar: "/opt/JsTestDriver/plugins/coverage.jar" module: "com.google.jstestdriver.coverage.CoverageM Tuesday, October 16, 12
  • 62. JASMINE IN DER IDE Tuesday, October 16, 12
  • 63. JASMINE IN DER IDE Tuesday, October 16, 12
  • 64. JASMINE IN DER IDE Tuesday, October 16, 12
  • 65. CODE-ANFORDERUNGEN • JSLinted • Kein Copy/Paste Code • Unittests • Akzeptanztests Tuesday, October 16, 12
  • 67. WARUM AKZEPTANZTESTS? • Tests gegen Akzeptanzkriterien • Anforderungen vs. Umsetzung • Nicht von Entwicklern Tuesday, October 16, 12
  • 69. SELENIUM IN JENKINS <target name=”selenium”> <exec executable=”java” output=”${basedir}/build/ selenium/results.html> <arg value=”-jar” /> <arg value=”/opt/selenium/selenium-server.jar” /> <arg value=”-htmlSuite” /> <arg value=”*firefox” /> <arg value=”http://datecalc.basti.dev” /> <arg value=”/srv/www/vhosts/datecalc/tests/ suite.html” /> </exec> </target> Tuesday, October 16, 12
  • 70. SELENIUM IN JENKINS • Plugin: Selenium HTML report Plugin • Post-build action: Publish Selenium HTML Report Tuesday, October 16, 12
  • 73. KONTAKT Sebastian Springer sebastian.springer@mayflower.de Mayflower GmbH Mannhardtstr. 6 80538 München Deutschland @basti_springer https://github.com/sspringer82 Tuesday, October 16, 12