Back to Basics The importance of testable modular JavaScript components.

Why are we talking about basics? We write a lot of Javascript…

Why are we talking about basics? We write a lot of Javascript… ...but our language doesn’t update much…

Why are we talking about basics? We write a lot of Javascript… ...but our language doesn’t update much… ...and this happens far too often:

Agenda All of the things!

Agenda 1. Modular Components a. What are module components? b. Why do we want modular components? c. How do you create modular components?

2. Testable Code a. What is Test Driven Development? b. How do you test your components? c. When do you start testing your code?

Ground Rules

1. Keep this interactive! ○ Ask questions! ○ Offer opinions! ○ Throw things!

Modular Components The whole point of this presentation.

What are modular components?

Let’s ask this a different way... What do jQuery Plugins, Angular Directives, Knockout Components, and Ext JS classes all have in common?

Let’s ask this a different way... ● Obviously it's NOT the pattern... ○ MVC, MVVM, MVP, MVW

● It's NOT object orientation. ○ (Prototypical or otherwise)

● It's NOT declarative bindings. ○ (Although we WILL talk about this later!)

Let’s ask this a different way... What do jQuery Plugins, Angular Directives, Knockout Components, and Ext JS classes all have in common? ...the answer is: Modular Components!

What are modular components? ● It’s the best practice that unites all of the modern JavaScript frameworks. ● It’s the type of controls that Bootstrap and Foundation offer right out of the box. ● They are atomic, reusable, controls that are more than just “scripts” to be used on a per page basis.

Why do we want modular components? ● Makes your code reusable. ○ Reduces your code base. ○ Reduces the chance of bugs. ○ Gives you opportunity to polish your controls.

● Makes you write better code. ○ Makes you consider your dependencies. ○ Makes your code easier to test.

Why do we want modular components? ● Streamlines your UX process. ○ Creates a common vocabulary for controls. ○ Enables adoption of new features.

How do you create modular components?

Let’s look at some code! ...and there was much rejoicing.

Testable Code Assert

What is Test Driven Development?

What is Test Driven Development? ● My Personal Goals ○ Make it so that you can test your code without ever firing up your application. ○ Start out by authoring ONE test per component/feature/service, and grow from there. ○ Ability to easily add tests as bugs are discovered.

How do you test your components? ● Obvious Answers ○ Unit Tests ○ Integration Tests

● Correct Answers ○ Make it easy to write tests! ○ Make it easy to run tests!

When do you start testing? ● Obvious Answers ○ Now ○ Yesterday

● Correct Answers ○ At the start of your project, set up the tooling! ○ Every time you write something new!

How do test your components?

Let’s look at some more code! ...and there was much rejoicing.

Basics

Back to Basics. The importance of testable modular. JavaScript components. ... Why are we talking about basics? We write a lot of. Javascript… ...but our language doesn't update much… ...and this happens far too often: ... Obviously it's NOT the pattern... ○ MVC, MVVM, MVP, MVW. ○ It's NOT object orientation.

1MB Sizes 0 Downloads 142 Views

Recommend Documents

Arena Basics
The Common template panel contains Arena modules such as Arrive, Server, Depart,. Inspect, and so on, ...... dedicated to an arrival process. The Format Type ...

Arena Basics
This system is known in queueing theory as the M/M/1 queue (Kleinrock 1975). The steady-state behavior of this system has been well studied, and analytical.

Computer Basics Quick Reference, Computer Basics Cheat Sheet
It calculates and processes information, and its speed ... RAM (random-access memory): Computer's main memory, which is used to ... Networks and the Internet.

Computer Basics Quick Reference, Computer Basics Cheat Sheet
which means unsaved data disappears when you shut off the computer. ROM (read-only memory): Computer's ... Terabyte (TB):. 1,099, 511,627,776 bytes.

Blending basics
Our tutorial proceeds by analyzing novel and conventional examples of linguistic ..... system infers motion from the spatial displacement of a single object over time. Further, Fauconnier and Turner (in ..... the data, blending theory is an excellent

Basics Services
We believe this information will assist us in delivering more targeted and relevant messaging and ... product type, with mobile clicks accounting for 30% of total clicks for certain brands. • Reduced cost-per-click: ... cost-per-impression (CPM) ba

GPS Basics
Mar 26, 2002 - Internet: www.u-blox.com ... information (e.g. speed, direction etc.) ... My aim was to work for a company professionally involved with GPS and u-blox ag ...... 3-dimensional positioning capability with a high degree of accuracy,.

Blogger Basics - nicolezumpano - Wikispaces
A blog (a portmanteau of web log) is a website where entries are written in ... Blogs provide commentary or news on a particular subject such as food, ... Page 24 ...

basics hardware.pdf
Download. Connect more apps... Try one of the apps below to open or edit this item. basics hardware.pdf. basics hardware.pdf. Open. Extract. Open with. Sign In.Missing:

Trac basics
Large projects require lots of tracking, such as: – Charting overall progress. – Planning enhancements ... Central location for all pertinent information. • Keeping everyone “on the same page”. Slide courtesy of ... Enhanced wiki & issue tr

Some Java Basics
May 27, 2009 - The Java Virtual Machine interpreter. • Performance: a bit ... the Java language provides an extensive set of application. • the Java language ...

solaris basics pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. solaris basics pdf. solaris basics pdf. Open. Extract. Open with.

vxworks basics pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. vxworks basics pdf. vxworks basics pdf. Open. Extract. Open with.

LabVIEW - Basics Ar.pdf
Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps.

ch6-Basics of Digital Audio.pdf
Digitization means conversion to a stream of numbers, and ...... if we use M previous values, we need M coecients ai, i = 1..M in a predictor. ˆfn = M. X i=1 ai˜f n−i.

MIDI Basics Overview.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. MIDI Basics ...

wimax basics pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. wimax basics ...

Basics of Chromosomes.pdf
Condensed form of genetic material appears at cell devision. Page 2 of 25 ... Basics of Chromosomes.pdf. Basics of Chromosomes.pdf. Open. Extract. Open with.