SlideShare a Scribd company logo
活字体カタ:テスト駆動開発

TypeScript Kata
The TDD style 2 edition
Ronnie Hegelund
Creator of AutoFixtureTS
http://bit.ly/XYF0Gp
Author of Enterprise development in TypeScript
http://bit.ly/11WyKF8

@ronniedrengen

http://ronniehegelund.blogspot.dk/
About me!
Ronnie Hegelund
Technical Lead, Widex A/S
http://ronniehegelund.blogspot.dk/
@ronniedrengen
Love all facets of software development from
Test driven development, Software Architecture, continuous delivery
Focus on
Web, C#, TypeScript and Developer/Team productivity

Latest projects
• TypeScript BCL
• TypeScript weekly
• CommunitySnippets for VisualStudio
• Writing a book. Enterprise development In TypeScript
• Visual Studio Test project templates
Agenda
1.
2.
3.
4.

What is TypeScript
Test Driven Development
Concepts of Code kata’s
Doing string calculator kata with
TypeScript
Visual Studio
Jasmine
What is TypeScript

TypeScript is a language for application scale
JavaScript development.
What is TypeScript

TypeScript is a typed superset of JavaScript
that compiles to plain JavaScript.
Any browser. Any host. Any OS.

Open Source.
What is TypeScript
TypeScript?
TypeScript is JavaScript with high-level language features.
Keyword

Description

Modules

Encapsulation for code and classes

Imports

Import modules

Exports

Export a member from module

Class

Encapsulation for properties, variables and function members

Extends

Extend a class. Used for inheritance

Implements

Implements an interface

Interface

Defines a contract of behavior when implemented by types

Constructor

Provide initialization for classes

Public and Private

Member visibillity modifier

=>

Arrow syntax, also called lambda expressions, used with definitions and functions

:

Seperator between the variable name and the variable type

...

Rest syntax, the same as the C#’s method parameter params

<TypeName>

Casting a type to another types

Generics <T>

Encapsulate operations that are not specific to a particular type

Enum

Used to quickly declare a range of constant or computed values
What is TypeScript
Starts with JavaScript
All JavaScript code is TypeScript code, simply copy and paste
All JavaScript libraries work with TypeScript

Optional Static Types, Classes, Modules
Enable scalable application development and excellent tooling
Zero cost: Static types completely disappear at run-time

Ends with JavaScript
Compiles to idiomatic JavaScript
Runs in any browser or host, on any OS
What is TypeScript
Library Typings (.d.ts files)
DefinitelyTyped has > 326 community library typings projects
344 contributors

Tools and Build Integration
Rich IDEs: Visual Studio, Eclipse, WebStorm, Cloud9, Brackets
Text Editors: SublimeText, vi, Emacs, JSBin
Build Integration: ASP.NET, node.js, compile-in-client, Ruby, grunt
and more

Open Source
Active development on CodePlex
Thousands of issues/discussions, hundreds of participants
Who’s already using TypeScript
Test-Driven Development
We all know that we need to test our code, but do we do it?
9 out of 10 times we skip it over because we just think it's faster.
My conclusion is that I am about 10% faster, and my code tested!

TDD In the simplest form
Solution, Testing vs TDD
Testing

Test-Driven Development

Design

Design

Test

Implement
Implement

Test
Test
How to do it
Design: figure out what you want
Test: write a test to express the design
It should FAIL
Implement: Write the code
Test againg:
It should PASS
Code Kata

Using Code Kata’s to become a better developer
Code kata is an exercise in programming that helps a programmer hone
their skills through practice and repetition.

A kata a day keeps the debugger away
Apply a Kata daily for at least 15 minutes, by coding, refactoring and test-first,.

Before you begin a Kata:
Try not to read ahead.
Do one task at a time. The trick is to learn to work incrementally.
Make sure you only test for correct inputs. there is no need to test for invalid
inputs for this kata
Code Katas aren’t effective

Doing the same thing over and over again doesn’t make us better at it

When we first learned from walking it was tuff, now it’s just a repetitive process
Lets do a string

kata with
Diverse links
• TypeScript http://www.typescriptlang.org/
• Kata practices bit.ly/3sUjzK
• StringCalculator in different languages bit.ly/2wma3X
• Chutzpah – Javascript test runner bit.ly/qsazVS
• DefinitelyTyped repositories
• Github bit.ly/Shdyzn
• Nuget.org http://bit.ly/W0V3bD
• nodeJS TSDPM bit.ly/VMo1LQ
• TypeScript Weekly http://paper.li/ronniedrengen/1386937876

More Related Content

What's hot

Golang
GolangGolang
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
Stanislav Petrov
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief exampleJeremy Kendall
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
VincitOy
 
Introduction to Spock: A Unit Testing Framework
Introduction to Spock: A Unit Testing FrameworkIntroduction to Spock: A Unit Testing Framework
Introduction to Spock: A Unit Testing Framework
Knoldus Inc.
 
Test your user interface using BDD (Swedish)
Test your user interface using BDD (Swedish)Test your user interface using BDD (Swedish)
Test your user interface using BDD (Swedish)
Evolve
 
Developer Job in Practice
Developer Job in PracticeDeveloper Job in Practice
Developer Job in Practice
intive
 
How do we test nodejs apps?
How do we test nodejs apps?How do we test nodejs apps?
How do we test nodejs apps?
Michal Juhas
 
It's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecIt's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspec
Giulio De Donato
 
TypeScript
TypeScriptTypeScript
TypeScript
Jon Vallet
 
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
PROIDEA
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
Rogério Vicente
 
Go lang
Go langGo lang
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
Dror Helper
 
TDD with RSpec
TDD with RSpecTDD with RSpec
TDD with RSpec
Rachid Calazans
 
Effectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP ProjectsEffectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP Projects
Andrew Yatsenko
 
Tdd
TddTdd
Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06
Carl Brown
 
Tdd com Java
Tdd com JavaTdd com Java
Tdd com Java
Rafael Miceli
 

What's hot (20)

Golang
GolangGolang
Golang
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
Kshitij
KshitijKshitij
Kshitij
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
 
Introduction to Spock: A Unit Testing Framework
Introduction to Spock: A Unit Testing FrameworkIntroduction to Spock: A Unit Testing Framework
Introduction to Spock: A Unit Testing Framework
 
Test your user interface using BDD (Swedish)
Test your user interface using BDD (Swedish)Test your user interface using BDD (Swedish)
Test your user interface using BDD (Swedish)
 
Developer Job in Practice
Developer Job in PracticeDeveloper Job in Practice
Developer Job in Practice
 
How do we test nodejs apps?
How do we test nodejs apps?How do we test nodejs apps?
How do we test nodejs apps?
 
It's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecIt's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspec
 
TypeScript
TypeScriptTypeScript
TypeScript
 
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
 
Go lang
Go langGo lang
Go lang
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
 
TDD with RSpec
TDD with RSpecTDD with RSpec
TDD with RSpec
 
Effectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP ProjectsEffectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP Projects
 
Tdd
TddTdd
Tdd
 
Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06
 
Tdd com Java
Tdd com JavaTdd com Java
Tdd com Java
 

Similar to Typescript kata The TDD style 2 edition

AI in Code Generation - March User Group
AI in Code Generation - March User GroupAI in Code Generation - March User Group
AI in Code Generation - March User Group
Peter Caitens
 
2024.04 - AI in Code Generation - April User Group Meeting
2024.04 - AI in Code Generation - April User Group Meeting2024.04 - AI in Code Generation - April User Group Meeting
2024.04 - AI in Code Generation - April User Group Meeting
petercaitens1
 
Test driven development and react js application go hand in hand
Test driven development and react js application go hand in handTest driven development and react js application go hand in hand
Test driven development and react js application go hand in hand
Katy Slemon
 
TypeScript VS JavaScript.pptx
TypeScript VS JavaScript.pptxTypeScript VS JavaScript.pptx
TypeScript VS JavaScript.pptx
Albiorix Technology
 
Six Steps to Conversation Driven Development
Six Steps to Conversation Driven DevelopmentSix Steps to Conversation Driven Development
Six Steps to Conversation Driven Development
Rasa Technologies
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovSvetlin Nakov
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
Hoa Le
 
Ten compelling reasons to learn .net framework
Ten compelling reasons to learn .net frameworkTen compelling reasons to learn .net framework
Ten compelling reasons to learn .net framework
JanBask Training
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
Utkarsh Khare
 
Introduction to Agile Software Development & Python
Introduction to Agile Software Development & PythonIntroduction to Agile Software Development & Python
Introduction to Agile Software Development & Python
Tharindu Weerasinghe
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
How to Become a Front-End Developer? Step-by-Step Guide by Careervira
How to Become a Front-End Developer? Step-by-Step Guide by CareerviraHow to Become a Front-End Developer? Step-by-Step Guide by Careervira
How to Become a Front-End Developer? Step-by-Step Guide by Careervira
Careervira
 
Agile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce ApproachAgile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce Approach
Ampersand
 
Samsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native AppSamsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native App
Ryo Jin
 
Launch .net updated
Launch .net updatedLaunch .net updated
Launch .net updatedaitrichtech
 
Software Craftsmanship @ Ntnu
Software Craftsmanship @ NtnuSoftware Craftsmanship @ Ntnu
Software Craftsmanship @ Ntnu
goeran
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
Quan Truong Anh
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
Tung Nguyen Thanh
 
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdfTop Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
JamesEddie2
 
That worked before
That worked beforeThat worked before
That worked before
Christian Güdemann
 

Similar to Typescript kata The TDD style 2 edition (20)

AI in Code Generation - March User Group
AI in Code Generation - March User GroupAI in Code Generation - March User Group
AI in Code Generation - March User Group
 
2024.04 - AI in Code Generation - April User Group Meeting
2024.04 - AI in Code Generation - April User Group Meeting2024.04 - AI in Code Generation - April User Group Meeting
2024.04 - AI in Code Generation - April User Group Meeting
 
Test driven development and react js application go hand in hand
Test driven development and react js application go hand in handTest driven development and react js application go hand in hand
Test driven development and react js application go hand in hand
 
TypeScript VS JavaScript.pptx
TypeScript VS JavaScript.pptxTypeScript VS JavaScript.pptx
TypeScript VS JavaScript.pptx
 
Six Steps to Conversation Driven Development
Six Steps to Conversation Driven DevelopmentSix Steps to Conversation Driven Development
Six Steps to Conversation Driven Development
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
 
Ten compelling reasons to learn .net framework
Ten compelling reasons to learn .net frameworkTen compelling reasons to learn .net framework
Ten compelling reasons to learn .net framework
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
Introduction to Agile Software Development & Python
Introduction to Agile Software Development & PythonIntroduction to Agile Software Development & Python
Introduction to Agile Software Development & Python
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
How to Become a Front-End Developer? Step-by-Step Guide by Careervira
How to Become a Front-End Developer? Step-by-Step Guide by CareerviraHow to Become a Front-End Developer? Step-by-Step Guide by Careervira
How to Become a Front-End Developer? Step-by-Step Guide by Careervira
 
Agile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce ApproachAgile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce Approach
 
Samsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native AppSamsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native App
 
Launch .net updated
Launch .net updatedLaunch .net updated
Launch .net updated
 
Software Craftsmanship @ Ntnu
Software Craftsmanship @ NtnuSoftware Craftsmanship @ Ntnu
Software Craftsmanship @ Ntnu
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
 
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdfTop Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
 
That worked before
That worked beforeThat worked before
That worked before
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

Typescript kata The TDD style 2 edition

  • 1. 活字体カタ:テスト駆動開発 TypeScript Kata The TDD style 2 edition Ronnie Hegelund Creator of AutoFixtureTS http://bit.ly/XYF0Gp Author of Enterprise development in TypeScript http://bit.ly/11WyKF8 @ronniedrengen http://ronniehegelund.blogspot.dk/
  • 2. About me! Ronnie Hegelund Technical Lead, Widex A/S http://ronniehegelund.blogspot.dk/ @ronniedrengen Love all facets of software development from Test driven development, Software Architecture, continuous delivery Focus on Web, C#, TypeScript and Developer/Team productivity Latest projects • TypeScript BCL • TypeScript weekly • CommunitySnippets for VisualStudio • Writing a book. Enterprise development In TypeScript • Visual Studio Test project templates
  • 3. Agenda 1. 2. 3. 4. What is TypeScript Test Driven Development Concepts of Code kata’s Doing string calculator kata with TypeScript Visual Studio Jasmine
  • 4. What is TypeScript TypeScript is a language for application scale JavaScript development.
  • 5. What is TypeScript TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Any browser. Any host. Any OS. Open Source.
  • 7. TypeScript? TypeScript is JavaScript with high-level language features. Keyword Description Modules Encapsulation for code and classes Imports Import modules Exports Export a member from module Class Encapsulation for properties, variables and function members Extends Extend a class. Used for inheritance Implements Implements an interface Interface Defines a contract of behavior when implemented by types Constructor Provide initialization for classes Public and Private Member visibillity modifier => Arrow syntax, also called lambda expressions, used with definitions and functions : Seperator between the variable name and the variable type ... Rest syntax, the same as the C#’s method parameter params <TypeName> Casting a type to another types Generics <T> Encapsulate operations that are not specific to a particular type Enum Used to quickly declare a range of constant or computed values
  • 8. What is TypeScript Starts with JavaScript All JavaScript code is TypeScript code, simply copy and paste All JavaScript libraries work with TypeScript Optional Static Types, Classes, Modules Enable scalable application development and excellent tooling Zero cost: Static types completely disappear at run-time Ends with JavaScript Compiles to idiomatic JavaScript Runs in any browser or host, on any OS
  • 9. What is TypeScript Library Typings (.d.ts files) DefinitelyTyped has > 326 community library typings projects 344 contributors Tools and Build Integration Rich IDEs: Visual Studio, Eclipse, WebStorm, Cloud9, Brackets Text Editors: SublimeText, vi, Emacs, JSBin Build Integration: ASP.NET, node.js, compile-in-client, Ruby, grunt and more Open Source Active development on CodePlex Thousands of issues/discussions, hundreds of participants
  • 10. Who’s already using TypeScript
  • 11. Test-Driven Development We all know that we need to test our code, but do we do it? 9 out of 10 times we skip it over because we just think it's faster. My conclusion is that I am about 10% faster, and my code tested! TDD In the simplest form
  • 12. Solution, Testing vs TDD Testing Test-Driven Development Design Design Test Implement Implement Test Test
  • 13. How to do it Design: figure out what you want Test: write a test to express the design It should FAIL Implement: Write the code Test againg: It should PASS
  • 14. Code Kata Using Code Kata’s to become a better developer Code kata is an exercise in programming that helps a programmer hone their skills through practice and repetition. A kata a day keeps the debugger away Apply a Kata daily for at least 15 minutes, by coding, refactoring and test-first,. Before you begin a Kata: Try not to read ahead. Do one task at a time. The trick is to learn to work incrementally. Make sure you only test for correct inputs. there is no need to test for invalid inputs for this kata
  • 15. Code Katas aren’t effective Doing the same thing over and over again doesn’t make us better at it When we first learned from walking it was tuff, now it’s just a repetitive process
  • 16. Lets do a string kata with
  • 17. Diverse links • TypeScript http://www.typescriptlang.org/ • Kata practices bit.ly/3sUjzK • StringCalculator in different languages bit.ly/2wma3X • Chutzpah – Javascript test runner bit.ly/qsazVS • DefinitelyTyped repositories • Github bit.ly/Shdyzn • Nuget.org http://bit.ly/W0V3bD • nodeJS TSDPM bit.ly/VMo1LQ • TypeScript Weekly http://paper.li/ronniedrengen/1386937876