Rails 4 Test Prescriptions: Build a Healthy Codebase (Paperback)
暫譯: Rails 4 測試處方:建立健康的程式碼庫 (平裝本)

Noel Rappin

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2014-12-13
  • 定價: $1,250
  • 售價: 5.0$625
  • 語言: 英文
  • 頁數: 350
  • 裝訂: Paperback
  • ISBN: 1941222196
  • ISBN-13: 9781941222195
  • 相關分類: Ruby
  • 立即出貨(限量) (庫存=2)

買這商品的人也買了...

相關主題

商品描述

Does your Rails code suffer from bloat, brittleness, or inaccuracy? Cure these problems with the regular application of test-driven development. Rails 4 Test Prescriptions is a comprehensive guide to how tests can help you design and write better Rails applications. In this completely revised edition, you'll learn why testing works and how to test effectively using Rails 4, Minitest 5, and RSpec 3, as well as popular testing libraries such as factory_girl and Cucumber. Do what the doctor ordered to make your applications feel all better. Side effects may include better code, fewer bugs, and happier developers.

Your Ruby on Rails application is sick. Deadlines are looming, but every time you make the slightest change to the code, something else breaks. Nobody remembers what that tricky piece of code was supposed to do, and nobody can tell what it actually does. Plus, it has bugs. You need test-driven development, a process for improving the design, maintainability, and long-term viability of software.

Containing both practical code examples and discussion of why testing works, this book starts with the most basic features delivered as part of core Ruby on Rails. Once you've integrated those features into your coding practice, you'll learn how to use popular third-party testing tools such as RSpec, Mocha, Cucumber, and factory_girl. You'll test the component parts of a Rails application, including the back-end model logic and the front-end display logic. Using Rails examples, you'll learn how to use testing to enable your code to respond better to future change. Plus, you'll see how to handle real-world testing situations.

This completely revised edition contains a new tutorial, as well as new examples throughout the book. Many chapters, including the JavaScript chapter, have undergone major changes to reflect new tools and new practices. And there are brand new chapters on testing for security, and testing external services.

What You Need:Ruby 2.1, Rails 4

商品描述(中文翻譯)

您的 Rails 代碼是否遭遇膨脹、脆弱或不準確的問題?透過定期應用測試驅動開發來治療這些問題。《Rails 4 測試處方》是一本全面的指南,說明測試如何幫助您設計和編寫更好的 Rails 應用程式。在這本完全修訂的版本中,您將學習為什麼測試有效,以及如何有效地使用 Rails 4、Minitest 5 和 RSpec 3 進行測試,還有流行的測試庫如 factory_girl 和 Cucumber。遵循醫生的建議,讓您的應用程式感覺更好。副作用可能包括更好的代碼、更少的錯誤,以及更快樂的開發人員。

您的 Ruby on Rails 應用程式生病了。截止日期迫在眉睫,但每當您對代碼進行最輕微的更改時,其他地方就會出現問題。沒有人記得那段棘手的代碼應該做什麼,也沒有人能告訴它實際上做了什麼。此外,它還有錯誤。您需要測試驅動開發,這是一個改善軟體設計、可維護性和長期可行性的過程。

這本書包含實用的代碼範例和為什麼測試有效的討論,從 Ruby on Rails 的核心功能開始。一旦您將這些功能整合到您的編碼實踐中,您將學習如何使用流行的第三方測試工具,如 RSpec、Mocha、Cucumber 和 factory_girl。您將測試 Rails 應用程式的組件部分,包括後端模型邏輯和前端顯示邏輯。通過 Rails 範例,您將學習如何使用測試使您的代碼更好地應對未來的變更。此外,您還將看到如何處理現實世界中的測試情況。

這本完全修訂的版本包含了一個新的教程,以及全書的新範例。許多章節,包括 JavaScript 章節,都經歷了重大變更,以反映新工具和新實踐。還有全新的章節,專門討論安全測試和外部服務測試。

您需要的環境:Ruby 2.1,Rails 4