Описание
Характеристики
Отзывы
Unit Testing JavaScript (with CoffeeScript)
Год выпуска: 2015
Производитель: frontendmasters
производителя: frontendmasters/courses/unit-testing-javascript/
Автор: Justin Searls
Продолжительность: 4 hours, 45 min
Тип раздаваемого материала: Видеоклипы
Язык: Английский
Описание: We are writing increasingly complex applications in JavaScript both in the Browser and the server-side using Node.JS. With this increased complexity comes a need to understand the nuances of testing. This course covers how to write testable code, types of tests, testing strategies, tactics and tips that will increase your ability to test JavaScript on the client and the server (Node.js). The unit tests are written in CoffeeScript, but the testing strategies you'll learn will be useful in pure JavaScript as well.
Slides (PDF) - frontendmasters/assets/resources/searlsmosher/javascript-testing.pdf
Code (Github) - github/testdouble/real-world-testing/
Code + Challenge Videos (Github) - github/testdouble/real-world-testing-video
Содержание
Table of Contents
Introduction
Introduction
00:00:00 - 00:05:50
Introduction
Dave Mosher and Justin Searls the course with a brief summary of their work histories and how the came to work at Test Double.
Background
00:05:51 - 00:12:15
Background
Before getting into the content, Justin explains where to get the course files. He also gives a little background about the syntax used throughout the course. They will be writing most of their unit tests in CoffeeScript. - //github/testdouble/real-world-testing-video
CoffeeScript Basics
00:12:16 - 00:18:55
CoffeeScript Basics
Since most of the testing code will be written in CoffeeScript, Dave and Justin spend a few minutes explaining the syntax. They talk about why they prefer CoffeeScript over JavaScript for unit testing and compare how tests would look in both languages.
Roman Numeral Calculator
Setup
00:18:56 - 00:26:16
Setup
The first demo will involve building a Roman Numeral calculator and writing tests against its functionality. Before getting into the code, Dave walks through the environment setup and project dependencies. The repo for this course is organized into folders. It also includes videos for each demo.
Test-Driven Development
00:26:17 - 00:36:12
Test-Driven Development
Before writing any application code, Dave begins with the unit tests. Part of test-driven development is writing the specification for what the application should do before implementing the functionality.
Writing and Refactoring Unit Tests
00:36:13 - 00:43:49
Writing and Refactoring Unit Tests
Dave continues writing test cases for the Roman Numeral calculator. As his code begins to grow, he takes a few minutes to refactor it to create a more concise and readable spec.
Refactoring Application Code
00:43:50 - 00:49:04
Refactoring Application Code
Dave finishes the Roman Calculator example by refactoring the application code. He demonstrates how a growing number of test cases can pinpoint areas in the applicant code that need optimization. Because the test are already written, he can monitory them during the optimization process to ensure the code is still functional.
Questions
00:49:05 - 01:01:42
Questions
Dave and Justin take a few minutes to review the Roman Numeral Calculator and answer a number of audience questions about test-driven development.
Node
Testing Pyramid
01:01:43 - 01:09:41
Testing Pyramid
Justin takes over and begins the next section with a explanation of the Testing Pyramid. The Testing Pyramid illustrates the greater need for discovery testing and a smaller need for end-to-end testing.
Discovery Testing
01:09:42 - 01:18:13
Discovery Testing
Justin’s calls his approach to unit testing “discovery testing”. This involves breaking down the feature into smaller pieces and identifying each responsibility. Justin demonstrates his discovery process on his arithmetic problem generator.
Trees
01:18:14 - 01:29:10
Trees
Diagramming the functionality in tree-form will help break down tasks into smaller units. These smaller units, or leaf nodes, are pure functions that can be easily tested. Mocks can be built to supply these leaf nodes with test data.
Integration Tests
01:29:11 - 01:40:52
Integration Tests
Before getting into the unit tests for their arithmetic problem generator, Dave and Justin explain the integration tests that are pre-build for this application. They also talk about a few of the additional libraries they will be using and introduce the concept of helpers.
Other Dependencies
01:40:53 - 01:46:35
Other Dependencies
Dave finishes his summary of the project dependencies by explaining the grunt-jasmine-bundle module configuration. He also introduces the first unit test.
Video 1: First Unit Test
01:46:36 - 01:58:50
Video 1: First Unit Test
Dave and Justin begin walking through the first video which demonstrates the coding of the initial unit tests. Justin also spends a few minutes talking about how he determines where to start with his testing and why he isn’t writing unit tests for the Express application.
First Unit Test, continued
01:58:51 - 02:06:41
First Unit Test, continued
With the initial unit tests written (and failing), Justin and Dave move on to writing the code for the first collaborator and a few mocks for the subsequent collaborators. They also briefly explain the role of a Jasmine Spy.
Video 2: Generating a Problem
02:06:42 - 02:15:01
Video 2: Generating a Problem
Justin and Dave walk through the unit tests for generating a problem. The tests will verify a character is returned for the operator and numbers are generated for the left and right operands.
Video 3: Picking Random Values
02:15:02 - 02:27:33
Video 3: Picking Random Values
The next challenge is to ensure a random problem is generated. Dave and Justin explain one technique for testing randomness. After implementing the unit tests, they add the production code.
Video4: Saving a Problem
02:27:34 - 02:37:22
Video4: Saving a Problem
Now that a random problem is being generated, the problem needs to be saved. The unit tests in this video will verify a problem is stored in memory using it’s ID as the key.
Video 5: Presenting a Problem
02:37:23 - 02:43:38
Video 5: Presenting a Problem
Justin and Dave create a unit test to verify a problem is presented to the user correctly. The production code combines the left and right operands with the operator to create a well-formed problem.
Videos 6 & 7: Finishing the Application
02:43:39 - 02:50:44
Videos 6 & 7: Finishing the Application
The final two videos demonstrate the application in action. Dave and Justin talk through the process of wiring in Express to finalize the production code.
Discovery Testing Wrap-up
02:50:45 - 03:02:06
Discovery Testing Wrap-up
Dave switches to the answers branch in the repository to walk through the completed code and wrap-up the section on Discovery Testing. Both he and Justin field a few audience questions and talk a little more about strategies around code reuse.
Lineman
Lineman Background
03:02:07 - 03:09:12
Lineman Background
Before getting into the next section on Lineman, Justin and Dave spend a few minutes answering audience questions and talking about task automation with the npm run command.
Video 1: Jasmine Fixtures
03:09:13 - 03:21:56
Video 1: Jasmine Fixtures
After a brief explanation of the command line tool, Lineman, Dave and Justin begin walking through the first code video. They are using Jasmine Fixtures to make it easier to inject and test HTML snippets into the DOM. - //linemanjs
Jasmine Fixtures, continued
03:21:57 - 03:31:30
Jasmine Fixtures, continued
Dave and Justin next implement the createApplication function that will spin-up the application. They also talk about the test-runner, Test’em, and demonstrate how it can be used to test multiple connected browsers/devices. The video concludes with the first passing test.
SpyOn Function
03:31:31 - 03:37:01
SpyOn Function
As mentioned earlier, Jasmine Spies are able to sub any function and track calls to it and any arguments passed. The spyOn method is used to create a spy. Dave and Justin talk about how spies
Год выпуска: 2015
Производитель: frontendmasters
производителя: frontendmasters/courses/unit-testing-javascript/
Автор: Justin Searls
Продолжительность: 4 hours, 45 min
Тип раздаваемого материала: Видеоклипы
Язык: Английский
Описание: We are writing increasingly complex applications in JavaScript both in the Browser and the server-side using Node.JS. With this increased complexity comes a need to understand the nuances of testing. This course covers how to write testable code, types of tests, testing strategies, tactics and tips that will increase your ability to test JavaScript on the client and the server (Node.js). The unit tests are written in CoffeeScript, but the testing strategies you'll learn will be useful in pure JavaScript as well.
Slides (PDF) - frontendmasters/assets/resources/searlsmosher/javascript-testing.pdf
Code (Github) - github/testdouble/real-world-testing/
Code + Challenge Videos (Github) - github/testdouble/real-world-testing-video
Содержание
Table of Contents
Introduction
Introduction
00:00:00 - 00:05:50
Introduction
Dave Mosher and Justin Searls the course with a brief summary of their work histories and how the came to work at Test Double.
Background
00:05:51 - 00:12:15
Background
Before getting into the content, Justin explains where to get the course files. He also gives a little background about the syntax used throughout the course. They will be writing most of their unit tests in CoffeeScript. - //github/testdouble/real-world-testing-video
CoffeeScript Basics
00:12:16 - 00:18:55
CoffeeScript Basics
Since most of the testing code will be written in CoffeeScript, Dave and Justin spend a few minutes explaining the syntax. They talk about why they prefer CoffeeScript over JavaScript for unit testing and compare how tests would look in both languages.
Roman Numeral Calculator
Setup
00:18:56 - 00:26:16
Setup
The first demo will involve building a Roman Numeral calculator and writing tests against its functionality. Before getting into the code, Dave walks through the environment setup and project dependencies. The repo for this course is organized into folders. It also includes videos for each demo.
Test-Driven Development
00:26:17 - 00:36:12
Test-Driven Development
Before writing any application code, Dave begins with the unit tests. Part of test-driven development is writing the specification for what the application should do before implementing the functionality.
Writing and Refactoring Unit Tests
00:36:13 - 00:43:49
Writing and Refactoring Unit Tests
Dave continues writing test cases for the Roman Numeral calculator. As his code begins to grow, he takes a few minutes to refactor it to create a more concise and readable spec.
Refactoring Application Code
00:43:50 - 00:49:04
Refactoring Application Code
Dave finishes the Roman Calculator example by refactoring the application code. He demonstrates how a growing number of test cases can pinpoint areas in the applicant code that need optimization. Because the test are already written, he can monitory them during the optimization process to ensure the code is still functional.
Questions
00:49:05 - 01:01:42
Questions
Dave and Justin take a few minutes to review the Roman Numeral Calculator and answer a number of audience questions about test-driven development.
Node
Testing Pyramid
01:01:43 - 01:09:41
Testing Pyramid
Justin takes over and begins the next section with a explanation of the Testing Pyramid. The Testing Pyramid illustrates the greater need for discovery testing and a smaller need for end-to-end testing.
Discovery Testing
01:09:42 - 01:18:13
Discovery Testing
Justin’s calls his approach to unit testing “discovery testing”. This involves breaking down the feature into smaller pieces and identifying each responsibility. Justin demonstrates his discovery process on his arithmetic problem generator.
Trees
01:18:14 - 01:29:10
Trees
Diagramming the functionality in tree-form will help break down tasks into smaller units. These smaller units, or leaf nodes, are pure functions that can be easily tested. Mocks can be built to supply these leaf nodes with test data.
Integration Tests
01:29:11 - 01:40:52
Integration Tests
Before getting into the unit tests for their arithmetic problem generator, Dave and Justin explain the integration tests that are pre-build for this application. They also talk about a few of the additional libraries they will be using and introduce the concept of helpers.
Other Dependencies
01:40:53 - 01:46:35
Other Dependencies
Dave finishes his summary of the project dependencies by explaining the grunt-jasmine-bundle module configuration. He also introduces the first unit test.
Video 1: First Unit Test
01:46:36 - 01:58:50
Video 1: First Unit Test
Dave and Justin begin walking through the first video which demonstrates the coding of the initial unit tests. Justin also spends a few minutes talking about how he determines where to start with his testing and why he isn’t writing unit tests for the Express application.
First Unit Test, continued
01:58:51 - 02:06:41
First Unit Test, continued
With the initial unit tests written (and failing), Justin and Dave move on to writing the code for the first collaborator and a few mocks for the subsequent collaborators. They also briefly explain the role of a Jasmine Spy.
Video 2: Generating a Problem
02:06:42 - 02:15:01
Video 2: Generating a Problem
Justin and Dave walk through the unit tests for generating a problem. The tests will verify a character is returned for the operator and numbers are generated for the left and right operands.
Video 3: Picking Random Values
02:15:02 - 02:27:33
Video 3: Picking Random Values
The next challenge is to ensure a random problem is generated. Dave and Justin explain one technique for testing randomness. After implementing the unit tests, they add the production code.
Video4: Saving a Problem
02:27:34 - 02:37:22
Video4: Saving a Problem
Now that a random problem is being generated, the problem needs to be saved. The unit tests in this video will verify a problem is stored in memory using it’s ID as the key.
Video 5: Presenting a Problem
02:37:23 - 02:43:38
Video 5: Presenting a Problem
Justin and Dave create a unit test to verify a problem is presented to the user correctly. The production code combines the left and right operands with the operator to create a well-formed problem.
Videos 6 & 7: Finishing the Application
02:43:39 - 02:50:44
Videos 6 & 7: Finishing the Application
The final two videos demonstrate the application in action. Dave and Justin talk through the process of wiring in Express to finalize the production code.
Discovery Testing Wrap-up
02:50:45 - 03:02:06
Discovery Testing Wrap-up
Dave switches to the answers branch in the repository to walk through the completed code and wrap-up the section on Discovery Testing. Both he and Justin field a few audience questions and talk a little more about strategies around code reuse.
Lineman
Lineman Background
03:02:07 - 03:09:12
Lineman Background
Before getting into the next section on Lineman, Justin and Dave spend a few minutes answering audience questions and talking about task automation with the npm run command.
Video 1: Jasmine Fixtures
03:09:13 - 03:21:56
Video 1: Jasmine Fixtures
After a brief explanation of the command line tool, Lineman, Dave and Justin begin walking through the first code video. They are using Jasmine Fixtures to make it easier to inject and test HTML snippets into the DOM. - //linemanjs
Jasmine Fixtures, continued
03:21:57 - 03:31:30
Jasmine Fixtures, continued
Dave and Justin next implement the createApplication function that will spin-up the application. They also talk about the test-runner, Test’em, and demonstrate how it can be used to test multiple connected browsers/devices. The video concludes with the first passing test.
SpyOn Function
03:31:31 - 03:37:01
SpyOn Function
As mentioned earlier, Jasmine Spies are able to sub any function and track calls to it and any arguments passed. The spyOn method is used to create a spy. Dave and Justin talk about how spies
Характеристики
Вес
0.12 кг
Формат
(ВИДЕО)
Год
2015
Тип упаковки
Пластиковый бокс
Количество DVD
1
Отзывов ещё нет — ваш может стать первым.
Все отзывы 0