JavaScript Code Kata

Stefan Scheidt & Bastian Söhnchen
    OPITZ CONSULTING GmbH
Mission                                          Märkte
Wir entwickeln gemeinsam mit allen                Branchenübergreifend
Branchen Lösungen, die dazu führen, dass          Über 600 Kunden
sich diese Organisationen besser entwickeln                                           29%
als ihr Wettbewerb.                                                29%
                                                                                      Handel / Logistik /
                                                                                      Dienstleistungen
                                                 Industrie / Versorger /
Unsere Dienstleistung erfolgt                      Telekommunikation
partnerschaftlich und ist auf eine langjährige                                 42%
Zusammenarbeit angelegt.                                                       Öffentliche Auftraggeber / Banken und
                                                                               Versicherungen / Vereine und Verbände



Leistungsangebot                                 Eckdaten
 Business IT Alignment                           Gründung 1990
 Business Information Management                 400 Mitarbeiter
 Business Process Management                     8 Standorte
 Anwendungsentwicklung
 SOA und System-Integration
 IT-Infrastruktur-Management


                                                                           © OPITZ CONSULTING GmbH 2012         Seite 2
Part I

Code Katas
What's our goal?
Quality
Value
Satisfaction
Professionalism
What do we need?
Knowledge
Practice ...
... Practice ...
... Practice!
Code Katas


internalize basic coding practices
  to use them without thinking
Write clean code
Write tests first
Refactor your code
"Red – Green – Refactor"
Know your tools
Program in pairs
proper, well, fast
Part II

      Test-Driven
JavaScript Development
Hello Jasmine!
Hello Jasmine!
describe("parseFloat", function() {

      it("should return undefined for undefined", function () {
          expect(util.parseFloat(undefined)).toBeUndefined();
      });

      it("should return 0 for empty string", function () {
          expect(util.parseFloat('')).toEqual(0);
      });

      it("should return number for number strings", function () {
          expect(util.parseFloat('1.5')).toEqual(1.5);
      });

      // ...

});
Hello Jasmine!
describe("parseFloat", function() {

      it("should return undefined for undefined", function () {
          expect(util.parseFloat(undefined)).toBeUndefined();
      });

      it("should return 0 for empty string", function () {
          expect(util.parseFloat('')).toEqual(0);
      });

      it("should return number for number strings", function () {
          expect(util.parseFloat('1.5')).toEqual(1.5);
      });

      // ...

});
Hello Jasmine!
describe("parseFloat", function() {

      it("should return undefined for undefined", function () {
          expect(util.parseFloat(undefined)).toBeUndefined();
      });

      it("should return 0 for empty string", function () {
          expect(util.parseFloat('')).toEqual(0);
      });

      it("should return number for number strings", function () {
          expect(util.parseFloat('1.5')).toEqual(1.5);
      });

      // ...

});
Hello Jasmine!
describe("parseFloat", function() {

      it("should return undefined for undefined", function () {
          expect(util.parseFloat(undefined)).toBeUndefined();
      });

      it("should return 0 for empty string", function () {
          expect(util.parseFloat('')).toEqual(0);
      });

      it("should return number for number strings", function () {
          expect(util.parseFloat('1.5')).toEqual(1.5);
      });

      // ...

});
Hello Jasmine!

  expect(x).toEqual(y);
    expect(x).toBe(y);
 expect(x).toBeDefined();
expect(x).toBeUndefined();
 expect(x).toBeTruthy();
  expect(x).toBeFalsy();
           ...
Hello Jasmine!
Demo: Prime Factor Kata
Part III

Practice
Prime Factors
Word Wrap
Game of Life
Traditional archery at Japanfest
             by johntrainor (http://www.flickr.com/photos/trainor/2902023575/)

                             Scottish Furniture Makers Exhibit
Jordanhill School D&T Dept (http://www.flickr.com/photos/designandtechnologydepartment/)

                                    The Jewel of Simplicity
              Alyssa L. Miller (http://www.flickr.com/photos/alyssafilmmaker/)

                                   Eiqmal - Sedapnyer
                     emrank (http://www.flickr.com/photos/emrank/)

                                       DSC06071
                      Andy G (http://www.flickr.com/photos/andyg/)

                             Fresh sinigang ingredients 2/365
                    by Nikkorz (http://www.flickr.com/photos/nikkorz/)
The best days are not planned
   Marcus Hansson (http://www.flickr.com/photos/marcus_hansson/)

                             karate training
            Genista (http://www.flickr.com/photos/genista/)

                         Orto – Vegetable Garden
Salvadonica, Chianti, Tuscany (http://www.flickr.com/photos/salvadonica/)

                          Making tin soldiers 3
            Andrei! (http://www.flickr.com/photos/andrein/)

                                Roofer
          Velo Steve (http://www.flickr.com/photos/juniorvelo/)

                      Red Light – Green Light
       MoToMo (http://www.flickr.com/photos/90155419@N00/)

                              Craftsman
    Robert S. Donovan (http://www.flickr.com/photos/booleansplit/)
Rallying at Dusk
 Thomas Faivre-Duboz (http://www.flickr.com/photos/tfa/)

                          Progress
by kevin dooley (http://www.flickr.com/photos/pagedooley/)

                      Smiley Keyboard
     ~Prescott (http://www.flickr.com/photos/ppym1/)

           310/365 Revision Week: Number Theory
stuartpilbrow (http://www.flickr.com/photos/stuartpilbrow/)

                       loose words
 popofatticus (http://www.flickr.com/photos/barretthall/)

                      Replacement
  DolfinDans (http://www.flickr.com/photos/dolfindans/)

                  Studies for „That‘s Life“
    Ben Sisto (http://www.flickr.com/photos/bensisto/)
The End ...
  stefan.scheidt@opitz-consulting.com
            (@stefanscheidt)

bastian.soehnchen@opitz-consulting.com

More Related Content

PPTX
Oberflächentests für JavaScript-Web-Apps – Mobile Tech Conference 2012 Autumn...
PPTX
JavaScript Data Binding mit jQuery Mobile - Mobile Developer Conference 2012 ...
PPTX
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
PPTX
Oracle DB 12c SQL Tuning
PDF
IT Project NE - Services Offer 2013
PDF
A year in the life of a Grails startup
PDF
Oxagile General Presentation
PDF
Vyako -Tech Profile
Oberflächentests für JavaScript-Web-Apps – Mobile Tech Conference 2012 Autumn...
JavaScript Data Binding mit jQuery Mobile - Mobile Developer Conference 2012 ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Oracle DB 12c SQL Tuning
IT Project NE - Services Offer 2013
A year in the life of a Grails startup
Oxagile General Presentation
Vyako -Tech Profile

Similar to JavaScript Code Kata Workshop – JavaScript Conference 2012 – OPITZ CONSULTING – Stefan Scheidt, Bastian Soehnchen (20)

PDF
Vyako Tech Profile
PDF
Kellton Tech Profile - Consumer and Enterprise Web Applications
PDF
New Tech Services
DOC
Cv latest ashish
PDF
Maintainable JavaScript 2011
PDF
Crossing Points Showcase 2012
PPTX
Beyond ratings and followers (RecSys 2012)
PPTX
Software Development Lifecycle Overview By CC
PDF
Run Your Oracle BI QA Cycles More Effectively
PPTX
Talearnt Webinar
PPTX
Talearnt Webinar
PPTX
18 jan13 talearnt webinar
PDF
StangaOne1 Company Presentation
PPTX
CGS Profile
PPTX
CGS Profile
PPTX
F4IT services overview
DOCX
Bowen Gao resume 2016 (2)
PDF
Tools For jQuery Application Architecture (Extended Slides)
PPTX
Euro IT Group
PDF
JasonKaye_v7
Vyako Tech Profile
Kellton Tech Profile - Consumer and Enterprise Web Applications
New Tech Services
Cv latest ashish
Maintainable JavaScript 2011
Crossing Points Showcase 2012
Beyond ratings and followers (RecSys 2012)
Software Development Lifecycle Overview By CC
Run Your Oracle BI QA Cycles More Effectively
Talearnt Webinar
Talearnt Webinar
18 jan13 talearnt webinar
StangaOne1 Company Presentation
CGS Profile
CGS Profile
F4IT services overview
Bowen Gao resume 2016 (2)
Tools For jQuery Application Architecture (Extended Slides)
Euro IT Group
JasonKaye_v7

More from OPITZ CONSULTING Deutschland (20)

PDF
OC|Webcast: Grundlagen der Oracle Lizenzierung
PDF
OC|Webcast "Java heute" vom 28.09.2021
PDF
OC|Webcast "Java heute" vom 24.08.2021
PDF
OC|Webcast "Daten wirklich nutzen"
PDF
Architecture Room Stuttgart - "Cloud-native ist nur ein Teil des Spiels!"
PDF
OC|Webcast "Willkommen in der Cloud!"
PDF
OC|Webcast "Die neue Welt der Virtualisierung"
PDF
10 Thesen zur professionellen Softwareentwicklung
PDF
OC|Webcast: Oracle Lizenzierung - Lizenznews 2021
PDF
OC|Webcast: Oracle Lizenzierung - Die größten Fallen in der Praxis
PDF
OC|Webcast: Oracle Lizenzierung - Virtualisierung und Cloud
PDF
OC|Webcast: Grundlagen der Oracle-Lizenzierung
PDF
OC|Weekly Talk: Inspect’n’Adapt – Make Change come true!
PDF
OC|Webcast: Schnell und clever in die AWS Cloud – Migrationsszenarien und Han...
PDF
OC|Weekly Talk The Power of DevOps…
PDF
OC|Weekly Talk: "Das müsste man mal digitalisieren" - Mit Low-Code schnell zu...
PDF
OC|Weekly Talk: Service Management – Was hat sich durch Corona geändert?
PDF
OC|Weekly Talk - Digitales Coaching & Smart Sparring
PDF
OC|Weekly Talk - Beratung remote
PDF
Effiziente Betriebsoptimierung durch Cloud Nutzung
OC|Webcast: Grundlagen der Oracle Lizenzierung
OC|Webcast "Java heute" vom 28.09.2021
OC|Webcast "Java heute" vom 24.08.2021
OC|Webcast "Daten wirklich nutzen"
Architecture Room Stuttgart - "Cloud-native ist nur ein Teil des Spiels!"
OC|Webcast "Willkommen in der Cloud!"
OC|Webcast "Die neue Welt der Virtualisierung"
10 Thesen zur professionellen Softwareentwicklung
OC|Webcast: Oracle Lizenzierung - Lizenznews 2021
OC|Webcast: Oracle Lizenzierung - Die größten Fallen in der Praxis
OC|Webcast: Oracle Lizenzierung - Virtualisierung und Cloud
OC|Webcast: Grundlagen der Oracle-Lizenzierung
OC|Weekly Talk: Inspect’n’Adapt – Make Change come true!
OC|Webcast: Schnell und clever in die AWS Cloud – Migrationsszenarien und Han...
OC|Weekly Talk The Power of DevOps…
OC|Weekly Talk: "Das müsste man mal digitalisieren" - Mit Low-Code schnell zu...
OC|Weekly Talk: Service Management – Was hat sich durch Corona geändert?
OC|Weekly Talk - Digitales Coaching & Smart Sparring
OC|Weekly Talk - Beratung remote
Effiziente Betriebsoptimierung durch Cloud Nutzung

Recently uploaded (20)

PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Architecture types and enterprise applications.pdf
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
Tartificialntelligence_presentation.pptx
PPT
What is a Computer? Input Devices /output devices
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Unlock new opportunities with location data.pdf
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Benefits of Physical activity for teenagers.pptx
CloudStack 4.21: First Look Webinar slides
Architecture types and enterprise applications.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Tartificialntelligence_presentation.pptx
What is a Computer? Input Devices /output devices
WOOl fibre morphology and structure.pdf for textiles
Unlock new opportunities with location data.pdf
NewMind AI Weekly Chronicles – August ’25 Week III
Web Crawler for Trend Tracking Gen Z Insights.pptx
Hybrid model detection and classification of lung cancer
Getting started with AI Agents and Multi-Agent Systems
DP Operators-handbook-extract for the Mautical Institute
sustainability-14-14877-v2.pddhzftheheeeee
Developing a website for English-speaking practice to English as a foreign la...
observCloud-Native Containerability and monitoring.pptx
O2C Customer Invoices to Receipt V15A.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...

JavaScript Code Kata Workshop – JavaScript Conference 2012 – OPITZ CONSULTING – Stefan Scheidt, Bastian Soehnchen

  • 1. JavaScript Code Kata Stefan Scheidt & Bastian Söhnchen OPITZ CONSULTING GmbH
  • 2. Mission Märkte Wir entwickeln gemeinsam mit allen  Branchenübergreifend Branchen Lösungen, die dazu führen, dass  Über 600 Kunden sich diese Organisationen besser entwickeln 29% als ihr Wettbewerb. 29% Handel / Logistik / Dienstleistungen Industrie / Versorger / Unsere Dienstleistung erfolgt Telekommunikation partnerschaftlich und ist auf eine langjährige 42% Zusammenarbeit angelegt. Öffentliche Auftraggeber / Banken und Versicherungen / Vereine und Verbände Leistungsangebot Eckdaten  Business IT Alignment  Gründung 1990  Business Information Management  400 Mitarbeiter  Business Process Management  8 Standorte  Anwendungsentwicklung  SOA und System-Integration  IT-Infrastruktur-Management © OPITZ CONSULTING GmbH 2012 Seite 2
  • 9. What do we need?
  • 14. Code Katas internalize basic coding practices to use them without thinking
  • 18. "Red – Green – Refactor"
  • 22. Part II Test-Driven JavaScript Development
  • 24. Hello Jasmine! describe("parseFloat", function() { it("should return undefined for undefined", function () { expect(util.parseFloat(undefined)).toBeUndefined(); }); it("should return 0 for empty string", function () { expect(util.parseFloat('')).toEqual(0); }); it("should return number for number strings", function () { expect(util.parseFloat('1.5')).toEqual(1.5); }); // ... });
  • 25. Hello Jasmine! describe("parseFloat", function() { it("should return undefined for undefined", function () { expect(util.parseFloat(undefined)).toBeUndefined(); }); it("should return 0 for empty string", function () { expect(util.parseFloat('')).toEqual(0); }); it("should return number for number strings", function () { expect(util.parseFloat('1.5')).toEqual(1.5); }); // ... });
  • 26. Hello Jasmine! describe("parseFloat", function() { it("should return undefined for undefined", function () { expect(util.parseFloat(undefined)).toBeUndefined(); }); it("should return 0 for empty string", function () { expect(util.parseFloat('')).toEqual(0); }); it("should return number for number strings", function () { expect(util.parseFloat('1.5')).toEqual(1.5); }); // ... });
  • 27. Hello Jasmine! describe("parseFloat", function() { it("should return undefined for undefined", function () { expect(util.parseFloat(undefined)).toBeUndefined(); }); it("should return 0 for empty string", function () { expect(util.parseFloat('')).toEqual(0); }); it("should return number for number strings", function () { expect(util.parseFloat('1.5')).toEqual(1.5); }); // ... });
  • 28. Hello Jasmine! expect(x).toEqual(y); expect(x).toBe(y); expect(x).toBeDefined(); expect(x).toBeUndefined(); expect(x).toBeTruthy(); expect(x).toBeFalsy(); ...
  • 35. Traditional archery at Japanfest by johntrainor (http://www.flickr.com/photos/trainor/2902023575/) Scottish Furniture Makers Exhibit Jordanhill School D&T Dept (http://www.flickr.com/photos/designandtechnologydepartment/) The Jewel of Simplicity Alyssa L. Miller (http://www.flickr.com/photos/alyssafilmmaker/) Eiqmal - Sedapnyer emrank (http://www.flickr.com/photos/emrank/) DSC06071 Andy G (http://www.flickr.com/photos/andyg/) Fresh sinigang ingredients 2/365 by Nikkorz (http://www.flickr.com/photos/nikkorz/)
  • 36. The best days are not planned Marcus Hansson (http://www.flickr.com/photos/marcus_hansson/) karate training Genista (http://www.flickr.com/photos/genista/) Orto – Vegetable Garden Salvadonica, Chianti, Tuscany (http://www.flickr.com/photos/salvadonica/) Making tin soldiers 3 Andrei! (http://www.flickr.com/photos/andrein/) Roofer Velo Steve (http://www.flickr.com/photos/juniorvelo/) Red Light – Green Light MoToMo (http://www.flickr.com/photos/90155419@N00/) Craftsman Robert S. Donovan (http://www.flickr.com/photos/booleansplit/)
  • 37. Rallying at Dusk Thomas Faivre-Duboz (http://www.flickr.com/photos/tfa/) Progress by kevin dooley (http://www.flickr.com/photos/pagedooley/) Smiley Keyboard ~Prescott (http://www.flickr.com/photos/ppym1/) 310/365 Revision Week: Number Theory stuartpilbrow (http://www.flickr.com/photos/stuartpilbrow/) loose words popofatticus (http://www.flickr.com/photos/barretthall/) Replacement DolfinDans (http://www.flickr.com/photos/dolfindans/) Studies for „That‘s Life“ Ben Sisto (http://www.flickr.com/photos/bensisto/)
  • 38. The End ... stefan.scheidt@opitz-consulting.com (@stefanscheidt) bastian.soehnchen@opitz-consulting.com