在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → xUnit Test Pattern

xUnit Test Pattern

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:6.05M
  • 下载次数:3
  • 浏览次数:88
  • 发布时间:2020-08-09
  • 实例类别:一般编程问题
  • 发 布 人:robot666
  • 文件格式:.pdf
  • 所需积分:2
 

实例介绍

【实例简介】
xUnit Test Pattern.pdf 获得美国生产力奖的关于单元测试,xUnit方方面面的一本经典著作,开发测试都值得一读
Named Test Suite(592): We define a test suite, suitably named, that contains a set of tests that we wish to be able to run as a group Parameterized Test (607): We pass the information needed to do fixture setup and result verification to a utility method that implements the entire test life cycle Prebuilt Fixture (429): We build the Shared Fixture separately from running the tests Recorded Test(278): We automate tests by recording interactions with the application and playing them back using a test Scripted Test (285): We automate the tests by writing test programs by hand Setup Decorator (447): We wrap the test suite with a Decorator that sets up the shared test fixture before running the tests nd tears it down after all the tests are done Shared Fixture (317): We reuse the same instance of the test fixture across many tests Standard Fixture (305): We reuse the same design of the test fixture across many tests State Verification(462): We inspect the state of the sut after it has been exercised and compare it to the expected state Stored Procedure Test (654): We write Fully Automated Tests for each stored procedure. Suite Fixture Setup (441): We build/destroy the shared fixture in special methods called by the Test Automation Framework beforelafter the first/last test method is called Table Truncation Teardown (661): We truncate the tables modified during the test to tear down the fixture Test Automation Framework(298): We use a framework that provides all the mechanisms needed to run the test logic so the test writer needs to provide only the test-specific logic. Test Discovery (393): The Test Automation Framework discovers all the tests that belong to the test suite automatically Test Double (522): We replace a component on which the sut depends with a test-specific equivalent Test Enumeration (399): The test automater manually writes the code that enumerates all tests that belong to the test suite Test Helper (643): We define a helper class to hold any Test Utility Methods we want to reuse in several tests. Test Hook(709): We modify the sut to behave differently during the test Test Method (348): We encode each test as a single Test Method on some class Test Runner( 377): We define an application that instantiates a Test Suite object and executes all the testcase objects it Test Selection(403): The Test Automation Framework selects the Test Methods to be run at runtime based on attributes of the tests Test Spy (538): We use a Test Double to capture the indirect output calls made to another component by the SUt for later verification by the test Test Stub(529 ): We replace a real object with a test-specific object that feeds the desired indirect inputs into the Sut Test Suite Object(387): We define a collection class that implements the standard test interface and use it to run a set of related Testcase Obiects Test Utility Method (599): We encapsulate the test logic we want to reuse behind a suitably named utility method Test-Specific Subclass (579): We add methods that expose the state or behavior needed by the test to a subclass of the Sut. Testcase Class(373 ): We group a set of related Test Methods on a single Testcase Class Testcase Class per Class(617): We put all the Test Methods for one sut class onto a single Testcase Class Testcase Class per Feature(624): We group the Test Methods onto Testcase Classes based on which testable feature of the SUT they exercise Testcase Class per Fixture(631): We organize Test Methods into Testcase Classes based on commonality of the test fixture Testcase Object (382): We create a Command object for each test and call the run method when we wish to execute it. Testcase Superclass (638): We inherit reusable test-specific logic from an abstract Testcase Superclass Transaction Rollback Teardown(668): We roll back the uncommitted test transaction as part of the teardown Unfinished Test Assertion (494): We ensure that incomplete tests fail by executing an assertion that is guaranteed to fail. XUnit Test patterns The adson esle goalie opie ÷ The Addison-Wesley Signature Series provides readers with practical and authoritative information on the latest trends in modern technology for computer professionals. The series is based on one simple premise: great books come from great authors. Books in the series are personally chosen by expert advisors, world-class authors in their own right These experts are proud to put their signatures on the covers, and their signatures ensure that these thought leaders have worked closely with authors to define topic coverage, book scope, critical content, and overall uniqueness. The expert signatures also symbolize a promise to our readers: you are reading a future classic THE ADDISON- WESLEY SIGNATURE SERIES SIGNERS: KENT BECK AND MARTIN FOWLER Kent Beck has pioneered people-oriented technologies like JUnit, Extreme Programming and patterns for software development. Kent is interested in helping teams do well by doing good - finding a style of software development that simultaneously satisfies economic, aesthetic, emotional, and practical constraints. His books focus on touching the lives of the creators and users of software Martin Fowler has been a pioneer of object technology in enterprise applications. His cen- tral concern is how to design software well. He focuses on getting to the heart of how to build enterprise software that will last well into the future. He is interested in looking behind the specifics of technologies to the patterns, practices, and principles that last for many years; these books should be usable a decade from now. Martins criterion is that these are books he wished he could write TITLES IN THE SERIES Test-Driven Development: By Example Kent Beck. ISBN 0321146530 User Stories Applied: For Agile Software Development Mike Cohn. sbn 0321205685 Implementing Lean Software Development: From Concept to Cash Mary and Tom Poppendieck, ISBN 0321437381 Refactoring Databases: Evolutionary Database Design Scott W. Ambler and pramodkumar J sadalage, ISBN 0321293533 RTIN F Patterns of Enterprise Application Architecture rin.Martin Fowler, ISBN 0321127420 Qaan四 Beyond Software Architecture: Creating and Sustaining Winning Solutions Luke hohmann ISBN 0201775948 Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions Gregor Hohpe and Bobby Woolf, ISBN 0321200683 Refactoring to Patterns Joshua Kerievsky. ISBN 0321213351 Formoreinformation,checkouttheserieswebsiteatwww.awprofessional.com XUnit Test patterns Refactoring Test Code Gerard meszaros A Addison-Wesley Upper Saddle river,NJ。 Boston· Indianapolis· San francisco New york· Toronto· Montreal· London· Munich· Paris· Madrid Capetown· Sydney· Tokyo· Singapore· Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trade marks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals The author and publisher have taken care in the preparation of this book, but make no expressed or implied war- ranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or con sequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact U.S. Corporate and Government Sales corpsales@pearsontechgroup.com For sales outside the United States please contact International sales nternational@pearsoned com Library of Congress Cataloging-in-Publication data Meszaros. gerard XUnit test patterns: refactoring test code/ Gerard Meszaros Includes bibliographical references and index ISBN-13: 978-0-13-149505-0(hardback alk paper) ISBN-10:0-13-149505-4 1. Software patterns. 2. Computer software--Testing. I. Title QA76.76P37M492007 005.1—dc22 2006103488 Copyright 2007 Pearson Education, Inc All rights reserved. Printed in the United States of America. This publication is protected by copyright, and per- mission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise For information regarding permissions, write to Pearson education. Inc Rights and Contracts Department 75 Arlington Street, Suite 300 Boston. Ma 02116 Fax:(617)848-7047 ISBN13:978-0-13-149505-0 ISBN10:0-13-149505-4 Text printed in the United States on recycled paper at Courier in Westford, Massachusetts First printing, May 2007 This book is dedicated to the memory of denis clelland, who recruited me away from Nortel in 1995 to work at Clear stream Consulting and thereby gave me the opportunity to have the experiences that led to this book. sadly, Denis passed away on April 27, 2006, while i was finalizing the second draft This page intentionally left blank Contents Visual Summary of the Pattern Language Foreword 。XIX Acknowledgments XXVII Introduction....,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,xxix Refactoring a Test PART I. The Narratives Chapter 1.A Brief Tour about This chapter The Simplest lest Automation Strategy that Could possibly Work Development Process.. Customer tests.,.,,,,,,,,,,,,,,,,, Unit Tests Design for Testability 7 Test Organization What's Next? Chapter 2. Test Smell About This Chapter An introduction to test smells What's a test smell? 10 Kinds of Test smells ,,,,,,,,,10 What to do about smells? 11 A Catalog of Sme 12 The Project Smells 12 The behavior Smells 13 The Code smells 16 What's Next? 17 【实例截图】
【核心代码】

标签:

实例下载地址

xUnit Test Pattern

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警