Reliable JavaScript

Reliable JavaScript
Автор книги: id книги: 822098     Оценка: 0.0     Голосов: 0     Отзывы, комментарии: 0 2818,71 руб.     (26,83$) Читать книгу Купить и читать книгу Купить бумажную книгу Электронная книга Жанр: Зарубежная образовательная литература Правообладатель и/или издательство: John Wiley & Sons Limited Дата добавления в каталог КнигаЛит: ISBN: 9781119028741 Возрастное ограничение: 0+ Оглавление Отрывок из книги

Реклама. ООО «ЛитРес», ИНН: 7719571260.

Описание книги

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 through long-term use and maintenance. Taking a test-first approach to software architecture, this book walks you through several patterns and practices and explains what they are supposed to do by having you write unit tests. Write the code to pass the unit tests, so you not only develop your technique for structuring large-scale applications, but you also learn how to test your work. You'll come away with hands-on practice that results in code that is correct from the start, and has the test coverage to ensure that it stays correct during subsequent maintenance. All code is provided both in the text and on the web, so you can immediately get started designing more complete, robust applications. JavaScript has graduated from field-validation scripts to full-scale applications, but many developers still approach their work as if they were writing simple scripts. If you're one of those developers, this book is the solution you need to whip your code into shape and create JavaScript applications that work. Write more concise and elegant code by thinking in JavaScript Test the implementation and use of common design patterns Master the use of advanced JavaScript features Ensure your code's conformance to your organization's standards If you're ready to step up your code and develop more complete software solutions, Reliable JavaScript is your essential resource.

Оглавление

Lawrence Spencer. Reliable JavaScript

CREDITS

ABOUT THE AUTHORS

ABOUT THE TECHNICAL EDITORS

ACKNOWLEDGMENTS

INTRODUCTION

THE RISE OF JAVASCRIPT AS A FIRST-CLASS LANGUAGE

THE EASE OF WRITING TRULY DISASTROUS CODE IN JAVASCRIPT

THE EASE OF UNINTENTIONALLY BREAKING JAVASCRIPT CODE

THIS BOOK'S INTENDED AUDIENCE

HOW THIS BOOK IS STRUCTURED

WHAT YOU NEED TO USE THIS BOOK

CONVENTIONS

SOURCE CODE

ERRATA

P2P.WROX.COM

PART I. Laying a Solid Foundation

CHAPTER 1. Practicing Skillful Software Engineering

WRITING CODE THAT STARTS CORRECT

WRITING CODE THAT STAYS CORRECT

SUMMARY

CHAPTER 2. Tooling Up

USING A TESTING FRAMEWORK

USING A DEPENDENCY-INJECTION FRAMEWORK

USING AN ASPECT TOOLKIT

USING A CODE-CHECKING TOOL

SUMMARY

CHAPTER 3. Constructing Reliable Objects

USING PRIMITIVES

USING OBJECT LITERALS

USING THE MODULE PATTERN

USING OBJECT PROTOTYPES AND PROTOTYPAL INHERITANCE

CREATING OBJECTS WITH NEW

USING CLASSICAL INHERITANCE

USING FUNCTIONAL INHERITANCE

MONKEY-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 Callback Pattern

UNDERSTANDING THE PATTERN THROUGH UNIT TESTS

AVOIDING PROBLEMS

SUMMARY

CHAPTER 6. Ensuring Correct Use of the Promise Pattern

UNDERSTANDING PROMISES THROUGH UNIT TESTS

CHAINING PROMISES

USING A PROMISE WRAPPER

UNDERSTANDING STATES AND FATES

DISTINGUISHING STANDARD PROMISES FROM JQUERY PROMISES

SUMMARY

CHAPTER 7. Ensuring Correct Use of Partial Function Application

UNIT-TESTING A PARTIAL FUNCTION APPLICATION

CREATING AN ASPECT FOR PARTIAL FUNCTION APPLICATION

DISTINGUISHING BETWEEN PARTIAL FUNCTION APPLICATION AND CURRYING

SUMMARY

CHAPTER 8. Ensuring Correct Use of the Memoization Pattern

UNDERSTANDING THE PATTERN THROUGH UNIT TESTS

ADDING MEMOIZATION WITH AOP

SUMMARY

CHAPTER 9. Ensuring Correct Implementation of the Singleton Pattern

UNDERSTANDING THE PATTERN THROUGH UNIT TESTS

SUMMARY

CHAPTER 10. Ensuring Correct Implementation of the Factory Pattern

WRITING UNIT TESTS FOR A FACTORY

IMPLEMENTING THE FACTORY PATTERN

CONSIDERING OTHER FACTORY TYPES

SUMMARY

CHAPTER 11. Ensuring Correct Implementation and Use of the Sandbox Pattern

UNDERSTANDING THE PATTERN THROUGH UNIT TESTS

SUMMARY

CHAPTER 12. Ensuring Correct Implementation of the Decorator Pattern

DEVELOPING A DECORATOR THE TEST-DRIVEN WAY

SUMMARY

CHAPTER 13. Ensuring Correct Implementation of the Strategy Pattern

UNDERSTANDING THE PATTERN THROUGH UNIT TESTS

SUMMARY

CHAPTER 14. Ensuring Correct Implementation of the Proxy Pattern

DEVELOPING A PROXY THE TEST-DRIVEN WAY

SUMMARY

CHAPTER 15. Ensuring Correct Implementation of Chainable Methods

UNDERSTANDING THE PATTERN THROUGH UNIT TESTS

CHAINING THEN

SUMMARY

PART III. Testing and Writing with Advanced JavaScript Features

CHAPTER 16. Conforming to Interfaces in an Interface-Free Language

UNDERSTANDING THE BENEFITS OF INTERFACES

UNDERSTANDING THE INTERFACE SEGREGATION PRINCIPLE

USING TEST-DRIVEN DEVELOPMENT TO CREATE A CONTRACT REGISTRY

SUMMARY:

CHAPTER 17. Ensuring Correct Argument Types

UNDERSTANDING THE OPPORTUNITIES AND RISKS POSED BY JAVASCRIPT’S TYPE-FREE PARAMETERS

EXTENDING THE CONTRACTREGISTRY TO CHECK ARGUMENTS

SUPPORTING CONTRACT LIBRARIES

PUTTING IT ALL TOGETHER

COMPARING THE ASPECT-ORIENTED SOLUTION TO A STATIC SOLUTION

SUMMARY

CHAPTER 18. Ensuring Correct Use of call, apply, and bind

EXPLORING HOW THIS IS BOUND

CREATING AND TESTING CODE THAT USES CALL, APPLY, AND BIND

SUMMARY

CHAPTER 19. Ensuring Correct Use of Method-Borrowing

ENSURING THE BORROWING OBJECT IS SUITABLE

ANTICIPATING SIDE EFFECTS ON THE BORROWER

ANTICIPATING SIDE EFFECTS ON THE DONOR OBJECT

SUMMARY

CHAPTER 20. Ensuring Correct Use of Mixins

CREATING AND USING MIXINS

SUMMARY

CHAPTER 21. Testing Advanced Program Architectures

ENSURING RELIABLE USE OF THE OBSERVER PATTERN

ENSURING RELIABLE USE OF THE MEDIATOR PATTERN

SUMMARY

PART IV. Special Subjects in Testing

CHAPTER 22. Testing DOM Access

UNIT-TESTING UI

OPTIMIZING YOUR CODE WITH A PROFILER

SUMMARY

CHAPTER 23. Ensuring Conformance to Standards

USING ESLINT

ENFORCING ARCHITECTURAL DIVISIONS

SUMMARY

PART V. Summary

CHAPTER 24. Summary of the Principles of Test-Driven Development

RECALLING WHY TEST-DRIVEN DEVELOPMENT IS WORTHWHILE

PRACTICING TEST-DRIVEN DEVELOPMENT

SUMMARY

CHAPTER 25. Summary of JavaScript Idioms in This Book

REVIEWING OBJECTS

REVIEWING VARIABLES

REVIEWING FUNCTIONS

REVIEWING BOOLEAN OPERATIONS

SUMMARY

INDEX

WILEY END USER LICENSE AGREEMENT

Отрывок из книги

LARRY SPENCER is Vice President of Application Development at ScerIS, a software and services company in Sudbury, Massachusetts. He and his team create browser-based applications in AngularJS, with a C#/Web API/SQL Server back end. Larry's 35-year career has included stints programming in COBOL, C, C++, C#, and even mainframe assembly language, but he says JavaScript is the most fun. A frequent speaker at Code Camps and other gatherings, Larry enjoys sharing his love of software with the development community. You can find his blog at http://FascinatedWithSoftware.com.

Larry's outside interests include philosophy, chess, and classical guitar. He lives in Marlborough, Massachusetts.

.....

With globals popping into existence unbidden, an almost total lack of architectural tradition, a questionable relationship to the truth, and more quirkiness than you'd find at a cosplay convention, it's a wonder that JavaScript has done as well as she has in the world.

Believe it or not, it gets worse before it gets better. Even if you get it right, it can go wrong oh so easily.

.....

Добавление нового отзыва

Комментарий Поле, отмеченное звёздочкой  — обязательно к заполнению

Отзывы и комментарии читателей

Нет рецензий. Будьте первым, кто напишет рецензию на книгу Reliable JavaScript
Подняться наверх