Reliable JavaScript /

Create more robust applications with a test-first approach to JavaScript Reliable JavaScript, How to Code Safely in the World's Most Dangerous Language demonstrates how to create test-driven development for large-scale JavaScript applications that will stand the test of time and stay accurate t...

Full description

Saved in:
Bibliographic Details
Main Authors: Spencer, Lawrence D. (Author), Richards, Seth H. (Author)
Format: Electronic eBook
Language:English
Published: Indianapolis, Indiana : Wrox, [2015]
Series:Wrox professional guides.
Subjects:
Online Access:CONNECT
Table of Contents:
  • Reliable JavaScript®; Contents; Introduction; Part I: Laying a Solid Foundation; Chapter 1: Practicing Skillful Software; Writing Code That Starts Correct; Mastering the Features of JavaScript; Case Study: D3.js; JavaScript Is Single-Threaded; Avoiding JavaScript's Pitfalls in Larger Systems; Scripts Are Not Modules; Nested Functions Control Scope; Coding by Contract; Applying the Principles of Software Engineering; The SOLID Principles; The DRY Principle; Writing Code That Stays Correct; Investing for the Future with Unit Tests; Practicing Test-Driven Development.
  • Engineering Your Code to Be Easy to TestSummary; Chapter 2: Tooling Up ; Using a Testing Framework; Identifying Incorrect Code; Designing for Testability; Writing the Minimum Required Code; Safe Maintenance and Refactoring; Runnable Specification; Current Open-Source and Commercial Frameworks; QUnit; D.O.H.; Introducing Jasmine; Suites and Specs; Expectations and Matchers; Spies; Using a Dependency-Injection Framework; What Is Dependency Injection?; Making Your Code More Reliable with Dependency Injection; Mastering Dependency Injection.
  • Case Study: Writing a Lightweight Dependency-Injection FrameworkUsing a Dependency-Injection Framework; Current Dependency-Injection Frameworks; RequireJS; AngularJS; Using an Aspect Toolkit; Case Study: Caching with and without AOP; Implementing Caching without AOP; Making Your Code More Reliable with AOP; Case Study: Building the Aop.js Module; Other AOP Libraries; AspectJS; AopJS jQuery Plugin; YUI's Do Class; Conclusion; Using a Code-Checking Tool; Making Your Code More Reliable with Linting Tools; Introducing JSHint; Using JSHint; If You Don't Run It, Bugs Will Come.
  • Alternatives to JSHintJSLint; ESLint; Strict Mode; Summary; Chapter 3: Constructing Reliable Objects; Using Primitives; Using Object Literals; Using the Module Pattern; Creating Modules-at-Will; Creating Immediate-Execution Modules; Creating Reliable Modules; Using Object Prototypes and Prototypal Inheritance; The Default Object Prototype; Prototypal Inheritance; Prototype Chains; Creating Objects with New; The new Object Creation Pattern; Potential for Bad Things to Happen; Enforcing the Use of new; Using Classical Inheritance; Emulating Classical Inheritance; Repetition Killed the Kangaroo.
  • Using Functional InheritanceMonkey-Patching; Summary; Part II: Testing Pattern-Based Code; Chapter 4: Reviewing the Benefits of Patterns; Case Study; Producing More Elegant Code by Using a Broader Vocabulary; Producing Reliable Code with Well-Engineered, Well-Tested Building Blocks; Summary; Chapter 5: Ensuring Correct Use of the Call back Pattern; Understanding the Pattern Through Unit Tests; Writing and Testing Code That Uses Callback Functions; Writing and Testing Callback Functions; Avoiding Problems; Flattening the Callback Arrow; Minding this; Summary.