下载  >  开发技术  >  C++  > Modern C++ Programming with Test-Driven Development(Pragmatic,2013)

Modern C++ Programming with Test-Driven Development(Pragmatic,2013) 评分

If you program in C++ you've been neglected. Test-driven development (TDD) is a modern software development practice that can dramatically reduce the number of defects in systems, produce more maintainable code, and give you the confidence to change your software to meet changing needs. But C++ prog
Early Praise for Modern C++ Programming with Test-Driven Development Jeff Langr has written another excellent book. This time he brings Test-Driven Development to the world of C++. Jeffs starting example brings us face to face with the stark simplicity of good TDD. He explains why we work that way and then provides key practical details, all the way through test doubles, working with legacy code, threading, and more. This one is a keeper for anyone working with C++! Ron Jeffries Co-creator of the Extreme Programming methodology Jeff Langr has written the best C++ book in years. Modern C++ Programming with est- Driven Development is the perfect mixture of theory and practice. The abstrac tions are explained with clarity and gusto, but the details are right there when you need them. It,s sure to be an instant classic, in C++ and in TDD both. Michael D. hill XP coach and writer Jeff is an expert software craftsman and in this book he shares his considerable wisdom about crafting great software. This book is not about testing, though you will learn valuable testing techniques. It is about improving your skills, code products, and life through test-driving. Whether you're a novice, expert, or in be tween, Jeff will show you the how and the why of an expert who test-drives better products with C++ James W. Grenning Author of Test-Driven Development for Embedded C Modern C++ Programming with Test-Driven Development Code Better, Sleep Better Jeff Lang The Pragmatic Bookshelf Dallas, Texas. Raleigh, North Carolina Pragmatic Bookshelf Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf, PragProg and the linking g device are trade marks of The Pragmatic Programmers, LLC Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings)contained herein Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titlespleasevisitusathttp://pragprog.com The team that produced this book includes Michael Swaine (editor Potomac Indexing, LLC (indexer) Kim Wimpsett (copyeditor) David J Kelly (typesetter) Janet furl rodu Juliet Benda (rights) Ellie Callahan(support) Copyright 2013 The Pragmatic Programmers, LLC All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or ansmitted, in any form, or by any means, electronic, mechanical, photocopying recording, or otherwise, without the prior consent of the publisher Printed in the united states of america N-13:978-1-937785-48 Encoded using the finest acid-free high-entropy binary digits Book version P1.0--October 2013 Contents Foreword Introduction Global Setup II Setup 1. 2 The Examples 1.3 C++ Compile 1. 4 CMake 6 1.5 Google Mock 1.6 CppUTest 8 1.7 libcurl 1. 8 JsonCpp 10 9 log 10 1.10 Boost 12 1.11 Building Examples and Running Tests 12 1.12 Teardown 13 2. Test-Driven Development: A First Example 15 2.1 Setup 2.2 The Soundex class 15 2.3 Getting Started 16 2.4 Fixing Unclean Code 23 2.5 Incrementalism 25 2.6 Fixtures and Setup 28 2.7 Thinking and TDD 30 2.8 Test-Driving vS Testing 33 2.9 What If? 36 2. 10 One Thing at a Time 37 2.11 Limiting Length 39 2. 12 Dropping Vowels 40 Contents· 2. 13 Doing what It Takes to Clarify Tests 41 2. 14 Testing Outside the Box 43 2.15 Back on track 45 2.16 Refactoring to Single-Responsibility functions 46 2. 17 Finishing Up 48 2. 18 What Tests Are We missing 48 2.19 Our solution 49 2.20 The Soundex class 50 2.21 Teardown 54 3. Test-Driven Development Foundations 55 3.1 Setup 55 3.2 Unit Test and TDD fundamentals 5 3.3 The TDD Cycle: Red-Green-Refactor 57 3.4 The Three rules of tdd 59 3.5 Getting Green on Red 60 3.6 Mind-Sets for Successful Adoption of TDD 69 3.7 Mechanics for Success 73 3.8 Teardown 77 4. Test Construction 79 4.1 Setup 79 4.2 Organization 79 4.3 Fast Tests. Slow Tests. Filters and Suites 86 4. 4 Assertions 89 4.5 Inspecting Privates 96 4.6 Testing vs. Test-Driving: Parameterized Tests and other Toⅴs 100 4.7 Teardown 103 5. Test doubles 105 5.1 Setup 105 5. 2 Dependency Challenges 105 5.3 Test Doubles 106 5.4 A Hand-Crafted Test Double 107 5.5 Improving Test Abstraction When Using Test Doubles 112 5.6 Using Mock Tools 114 5.7 Getting Test Doubles in Place 123 5.8 Design Will Change 130 5.9 Strategies for Using Test Doubles 132 Contents 5.10 Miscellaneous Test Double Topics 136 5.11 Teardown 138 6. Incremental Design 141 6.1 Setup 141 6.2 Simple design 141 6.3 Where Is the Up-Front Design? 166 6.4 Refactoring Inhibitors 169 6 Teardown 171 7. Quality Tests 173 7.1 Setup 173 7. 2 Tests come first 173 7.3 One Assert per Test 178 7. 4 Test abstraction 181 7.5 Teardown 194 8. Legacy Challenges 195 8.1 Setup 195 8.2 Legacy Code 195 8.3 Themes 196 8.4 The Legacy Application 198 8.5 A Test-Driven Mentality 201 8.6 Safe Refactoring to Support Testing 202 8.7 Adding Tests to Characterize Existing Behavior 205 8.8 Sidetracked by the Reality of Legacy Code 206 8.9 Creating a Test Double for rlog 207 8.10 Test-Driving Changes 211 8.Il A New Story 213 8.12 A Brief Exploration in Seeking Faster Tests 214 8. 13 Mondo extracto 215 8. 14 Spying to Sense Using a Member Variable 218 8.15 Spying to Sense Using a Mock 219 8.16 Alternate Injection Techniques 224 8.17 Large-Scale Change with the Mikado Method 224 8. 18 An Overview of the mikado method 225 8.19 Moving a method via Mikado 226 8.20 More Thoughts on the Mikado Method 236 8.21 Is It Worth it? 237 8.22 Teardown 238 ontents·vi 9. TDD and Threading 239 9.1 Setup 239 9.2 Core Concepts for Test-Driving Threads 239 9. 3 The Geoserver 240 9.4 Performance Requirements 246 9.5 Designing an Asynchronous Solution 249 9.6 Still Simply Test-Driving 252 9. 7 Ready for a Thready 254 9.8 Exposing Concurrency Issues 256 9.9 Creating Client Threads in the Test 259 9.10 Creating Multiple Threads in the ThreadPool 261 9.11 Back to the geoserver 263 9.12 Teardown 267 10. Additional TDD Concepts and discussions 269 10.I Setup 269 10.2 TDD and Performance 269 10.3 Unit Tests, Integration Tests, and Acceptance Tests 278 10.4 The Transformation Priority Premise 281 10.5 Writing Assertions First 294 10.6 Teardown 298 1l. Growing and Sustaining TDD 299 1.1 Setup 299 11.2 Explaining TDD to Nontechies 300 11. 3 The Bad Test Death Spiral, aka the scUMmy cycle 304 11.4 Pair Programming 306 11.5 Katas and dojos 310 11.6 USing the Code Coverage Metric Effectively 313 11.7 Continuous Integration 314 11. 8 Deriving Team Standards for TDD 315 11. 9 Keeping Up with the Community 316 11.10 Teardown 317 Al. Comparing Unit Testing tools 319 AlI Setup 319 Al.2 TDD Unit Testing Tool Features 319 Al. 3 Notes on Google Mock 321 Al. 4 Notes on CppUTest 321 al.5 Other Unit Testing Frameworks 321 al. 6 Teardown 322 Contents·i a2. Code kata: roman numeral converter 323 A2.I Setup 323 a2.2 Let's go! 323 A2. 3 Practice Makes perfect 331 a2. 4 Teardown 331 A3. Bibliography 333 Index 335

...展开详情
所需积分/C币:14 上传时间:2015-04-02 资源大小:7.39MB
举报 举报 收藏 收藏
分享 分享

评论 下载该资源后可以进行评论 2

closetozero 整体上不错的书,但是有些地方不是很好, 比如有时候会有大量的经验的概述,错误经历的概述等, 注意是概述,不是详述,如果没有相关的经验基本上就是无用的信息。 还有一些地方作者观点很不明确,写的像随笔。
2017-02-06
回复
tianchejun 找了很久终于找到了 感谢分享 恭喜发财
2015-09-11
回复
Modern C++ Programming with Test-Driven Development 无水印pdf

Modern C++ Programming with Test-Driven Development 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

立即下载
Modern C++ Programming with Test-Driven Development

本书是一本关于设计原则、编程实践、测试驱动开发的指南,旨在帮助C++ 程序员用测试驱动开发方法构建高性能解决方案。全书共11 章,涵盖测试驱动开发的基本工作方式、潜在好处、怎样利用测试驱动开发解决设计缺陷、测试驱动开发的难点和成本、怎样利用测试驱动开发减少甚至免除调试工作,以及如何长时间维持测试驱动开发。

立即下载
Modern.C++.Programming.with. Test-Driven.Development

英文版

立即下载
C++17 STL Cookbook & Mastering the C++17 STL

C++17 STL Cookbook: Discover the latest enhancements to functional programming and lambda expressions Mastering the C++17 STL: Make full use of the standard library components in C++17 C__17 STL Cookbook.epub C__17 STL Cookbook.mobi C__17 STL Cookbook.pdf 9781787120495_Code.zip Mastering the C+

立即下载
installare programmi su linux e unix.doc

installare programmi su linux e unix.doc

立即下载
Core.Python.Applications.Programmi

Prentice.Hall.Core.Python.Applications.Programming.3rd.Edition.2012.RETAIL.eBook-repackb00k.pdf

立即下载
精通C#游戏编程 C# Game Programming: For Serious Game Creation英文版

I wa nt to help you make your game. Everyone has a great game idea, but the path from initial idea to finished prod uct is not a clear one. There are an intimi dating number of progr amming languages, libraries, and prod uction methods. Even experienced game developers often fail to realize their vi

立即下载
IEradicator2001

IE浏览器卸载器 ---------------------------------------------------------------- IEradicator 2001 ---------------------------------------------------------------- OCTOBER 2001 (c) 98lite.net, Shane Brooks 1999-2001 http:\\www.98lite.net This document is the Insta

立即下载
PLCSIM_V54.rar

适用于step7 5.4版本 Benvenuti in S7-PLCSIM, il software per la simulazione delle CPU S7 Il seguente file leggimi contiene importanti informazioni per l'installazione e l'utilizzo di S7-PLCSIM V 5.4. Si consiglia di leggerlo prima di installare e utilizzare il software. Indice 1 Nuove funzioni di S7-PL

立即下载
TclTk 8.5 Programming Cookbook.pdf

With over 100 recipes, this Cookbook is ideal for both beginners and advanced Tcl/Tk programmers. From the basics to creating applications, it’s full of indispensable tips and tricks to make the most of the language. Overview The quickest way to solve your problems with Tcl/Tk 8. Understand the basi

立即下载
The Go Programming Language

The Go ProgThe Go Programming Languageramming LanguageThe Go ProgramminThe Go Programming LanguageThe Go Programming LanguageThe Go Programming LanguageThe Go Programming LanguageThe Go Programming LanguageThe Go Programming LanguageThe Go Programming LanguageThe Go Programming LanguageThe Go Progra

立即下载
高清彩版 A Practical Guide to Linux Commands, Editors, and Shell Programming(4th)

高清彩版 A Practical Guide to Linux Commands, Editors, and Shell Programming(4th)

立即下载
A Smarter Way to Learn Python

很基础的Python入门书,配有丰富的在线练习,可以让你轻松的入门Python编程。

立即下载
CUDA by Example(英文原书+自带源代码)

CUDA by Example.An Introduction to General-Purpose GPU Programming(英文原书+自带源代码)源代码是nvidia官网下的。

立即下载
MT7621_ProgrammingGuide_Preliminary_Platform_decrypted.pdf

mtk 7621开发编程指导,MT7621_ProgrammingGuide_Preliminary_Platform_decrypted.pdf

立即下载
Serial-Programming-HOWTO linux串口中断和select模式

文档介绍了 linux串口中断和select模式, 里面有详细的程序例程,saio.sa_mask = 0; 这一行,sa_mask需要用函数sigemptyset(&saio;.sa_mask)来初始化。

立即下载