logo资料库

微软软件测试圣经(How We Test Software at Microsoft).pdf

第1页 / 共364页
第2页 / 共364页
第3页 / 共364页
第4页 / 共364页
第5页 / 共364页
第6页 / 共364页
第7页 / 共364页
第8页 / 共364页
资料共364页,剩余部分请下载后查看
How We Test Software at Microsoft Alan Page Ken Johnston Bj Rollison PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2009 by Microsoft Corporation ISBN: 9780735624252 All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Control Number: 2008940534 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWT 3 2 1 0 9 8 Distributed in Canada by H.B. Fenn and Company Ltd. A CIP catalogue record for this book is available from the British Library. Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/ mspress. Send comments to mspinput@microsoft.com. Microsoft, Microsoft Press, Access, Active Accessibility, Active Directory, ActiveX, Aero, Excel, Expression, Halo, Hotmail, Hyper-V, Internet Explorer, Microsoft Surface, MS, MSDN, MS-DOS, MSN, OneNote, Outlook, PowerPoint, SharePoint, SQL Server, Virtual Earth, Visio, Visual Basic, Visual Studio, Voodoo Vince, Win32, Windows, Windows Live, Windows Media, Windows Mobile, Windows NT, Windows Server, Windows Vista, Xbox, Xbox 360, and Zune are either registered trademarks or trademarks of the Microsoft group of companies. Other product and company names mentioned herein may be the trademarks of their respective owners. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. This book expresses the author's views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions Editor: Ben Ryan Project Editor: Lynn Finnel Editorial Production: Waypoint Press Cover Illustration: John Hersey Body Part No. X14-71546
To my wife, Christina, and our children, Cole and Winona, who sacrificed their time with me so I could write this book; and for my parents, Don and Arlene, for their constant support, and for giving me a sanctuary to write. —Alan Page To my children, David and Grace, for allowing their dad the time to write; and to my wife, Karen, who while I was working on a presentation for a testing conference first suggested, "Why don't you just call it 'How we test at Microsoft.'" Without those words (and Alan leading the way), we would not have started or finished this project. —Ken Johnston To my mother and father for their unending love, sage wisdom, and especially their patience. I also want to thank my 6-year-old daughter Elizabeth whose incessant curiosity to learn new things and persistent determination to conquer diverse challenges has taught me that the only problems we cannot overcome are those for which we have not yet found a solution. —Bj Rollison This book is dedicated to the test engineers at Microsoft who devote themselves to the most challenging endeavor in the software process, and who continue to mature the discipline by breaking through traditional barriers and roles in order to help ship leading-edge, high-quality software to our customers. For us, it is truly a privilege to mentor and work alongside so many professional testers at Microsoft, because through our interactions with them we also continue to learn more about software testing. About the Authors Alan Page began his software testing career in 1993 and joined Microsoft in 1995. In Alan's career at Microsoft, he has worked on various versions of Windows, Internet Explorer, and Windows CE. While a member of the Windows CE team, Alan became one of Microsoft's first Test Architects in 2001. Alan joined the Engineering Excellence team in 2005 and is currently the Director of Test Excellence at Microsoft, where he and his team provide technical training and consulting for testers at Microsoft
Ken Johnston is the Group Manager for the Microsoft Office Internet Platform & Operations team. This team develops manageability features for server products and services as well as provides live site operations support for Office Online, Office Live, CRM Online and several other services. Since joining Microsoft in 1998 Johnston has filled many other roles, including test lead on Site Server and MCIS and test manager on Hosted Exchange, Knowledge Worker Services, Net Docs, and the Microsoft Billing and Subscription Platform service. For two and a half years (2004–2006) he served as the Microsoft Director of Test Excellence. Bj Rollison is a Test Architect in the Engineering Excellence team. He began his Microsoft career in 1994, working on Windows 95. He also worked on various releases of Internet Explorer, Outlook 98, and several smaller projects until becoming the Director of Test in 1999. Prior to Microsoft, Bj worked for a small OEM company in Japan building hardware and software solutions for small businesses. Bj is a frequent speaker at international conferences, contributes regularly to professional trade journals, and also teaches courses in software testing and test automation for the University of Washington Extension Program. Acknowledgments This book never would have happened without the help of every single tester at Microsoft. Many helped directly by reviewing chapters or writing about their experiences in testing. Others helped by creating the legacy of software testing at Microsoft, or by continuing to innovate in the way we test
software. Including the names of all 9,000 testers at Microsoft would be impractical (especially when many former employees, people from other disciplines, and even external reviewers contributed to the completion of this book). On the other hand, we do want to call out the names of several people who have contributed substantially to the creation of this book. This book grew out of the opinions, suggestions, and feedback of many current and former Microsoft employees. Some of the most prominent contributors include Michael Corning, Ed Triou, Amol Kher, Scott Wadsworth, Geoff Staneff, Dan Travison, Brian Rogers, John Lambert, Sanjeev Verma, Shawn McFarland, Grant George, Tara Roth, Karen Carter-Schwendler, Jean Hartman, James Whittaker, Irada Sadykhova, Alex Kim, Darrin Hatakeda, Marty Riley, Venkat Narayanan, Karen Johnston, Jim Pierson, Ibrahim El Far, Carl Tostevin, Nachi Nagappan, Keith Stobie, Mark Davis, Mike Blaylock, Wayne Roseberry, Carole Cancler, Andy Tischaefer, Lori Ada-Kilty, Matt Heusser, Jeff Raikes, Microsoft Research (especially Amy Stevenson), the Microsoft Test Excellence Team, the Microsoft Test Leadership Team, and the Microsoft Test Architect Group. We'd also like to thank Lynn Finnel, the Project Editor for this book, who continued to give us encouragement and support throughout the creation of this book. Introduction Overview I still remember the morning, sometime late in the fall of 2007, when my manager at the time, Ken Johnston, uttered these five words, "You should write a book." He had just come back from delivering a talk at an industry test conference (not coincidentally titled, "How We Test Software at Microsoft,") and was excited by the audience reception. Ken loves to give presentations, but he somehow thought I should be the one to write the book. I humored him and said, "Sure, why not." I went on to say that the book could cover a lot of the things that we teach in our software testing courses, as well as a smattering of other popular test approaches used at Microsoft. It could be interesting, but there are a ton of books on testing—I know, I've probably read a few dozen of them—and some of them are really good. What value to the testing community could yet another book provide? I was about to talk the nonsense out of Ken when I realized something critical: At Microsoft, we have some of the best software test training in the world. The material and structure of the courses are fantastic, but that's not what makes it so great. The way our instructors tie in anecdotes, success stories, and cool little bits of trivia throughout our courses is what makes them impactful and memorable. I thought that if we could include some stories and bits of information on how Microsoft has used some of these approaches, the book might be interesting. I began to think beyond what we teach, of more test ideas and stories that would be fun to share with testers everywhere. I realized that some of my favorite programming books were filled with stories embedded with all of the "techie" stuff. The next thing I knew, I was writing a proposal. An outline began to come together, and the form of the book began to take shape, with four main themes emerging. It made sense to set some context by talking about Microsoft's general approaches to people and engineering. The next two sections would focus on how we do testing inside Microsoft, and the tools we use; and the final section would look at the future of testing inside Microsoft. I sent the proposal to Microsoft Press, and although I remained
excited about the potential for the book, part of me secretly hoped that Microsoft Press would tell me the idea was silly, and that I should go away. Alas, that didn't happen, and shortly thereafter, I found myself staring at a computer screen wondering what the first sentences would look like. From the very beginning, I knew that I wanted Ken to write the first two chapters. Ken has been a manager at Microsoft for years, and the people stuff was right up his alley. About the time I submitted the proposal, Ken left our group to manage the Office Online group. Soon after, it became apparent that Ken should also write the chapter on how we test Software plus Services. He's since become a leader at the company in defining how we test Web services, and it would have been silly not to have him write Chapter 14, "Testing Software Plus Services". Later on, I approached BJ Rollison, one of Microsoft's most prominent testers, to write the chapters about functional and structural test techniques. Bj Rollison designed our core software testing course, and he knows more about these areas of testing than anyone I know. He's also one of the only people I know who has read more books on testing than I have. Ken, Bj and I make quite a trio of authors. We all approach the task and produce our material quite differently, but in the end, we feel like we have a mix of both material and writing styles that reflects the diversity of the Microsoft testing population. We often joke that Bj is the professor, Ken tries to be the historian and storyteller, and I just absorb information and state the facts. Although we all took the lead on several chapters, we each edited and contributed to the others' work, so there is definitely a melding of styles throughout the book. I cannot begin to describe how every little setback in life becomes gigantic when the task of "writing a book" is always on your plate. Since starting this book, I took over Ken's old job as Director of Test Excellence at Microsoft. Why in the world I decided to take on a job with entirely new challenges in the middle of writing a book I'll never know. In hindsight, however, taking on this role forced me to gain some insight into test leadership at Microsoft that benefitted this book tremendously. My biggest fear in writing this book was how much I knew I'd have to leave out. There are over 9,000 testers at Microsoft. The test approaches discussed in this book cover what most testers at Microsoft do, but there are tons of fantastically cool things that Microsoft testers do that couldn't be covered in this book. On top of that, there are variations on just about every topic covered in this book. We tried to capture as many different ideas as we could, while telling stories about what parts of testing we think are most important. I also have to admit that I'm slightly nervous about the title of this book. "How We Test Software at Microsoft" could imply that everything in this book is done by every single tester at Microsoft, and that's simply not true. With such a large population of testers and such a massive product portfolio, there's just no way to write about testing in a way that exactly represents every single tester at Microsoft. So, we compromised. This book simply covers the most popular testing practices, tools, and techniques used by Microsoft testers. Not every team does everything we write about, but most do. Everything we chose to write about in this book has been successful in testing Microsoft products, so the topics in this book are a collection of some of the things we know work. In the end, I think we succeeded, but as testers, we know it could be better. Sadly, it's time to ship, but we do have a support plan in place! If you are interested in discussing anything from this book with the authors, you can visit our web site, www.hwtsam.com. We would all love to hear what you think. —Alan Page Who This Book Is For This book is for anyone who is interested in the role of test at Microsoft or for those who want to know more about how Microsoft approaches testing. This book isn't a replacement for any of the numerous other great texts on software testing. Instead, it describes how Microsoft applies a number of testing
techniques and methods of evaluation to improve our software. Microsoft testers themselves will likely find the book to be interesting as it includes techniques and approaches used across the company. Even nontesters may find it interesting to know about the role of test at Microsoft What This Book Is About This book starts by familiarizing the reader with Microsoft products, Microsoft engineers, Microsoft testers, the role of test, and general approaches to engineering software. The second part of the book discusses many of the test approaches and tools commonly used at Microsoft. The third part of the book discusses some of the tools and systems we use in our work. The final section of the book discusses future directions in testing and quality at Microsoft and how we intend to create that future. Part I, "About Microsoft" • Chapter 1 , "Software Engineering at Microsoft," • Chapter 2 , "Software Test Engineers at Microsoft" • Chapter 3 , "Engineering Life Cycles" Part II, "About Testing" • Chapter 4 , "A Practical Approach to Test Case Design" • Chapter 5 , "Functional Testing Techniques" • Chapter 6 , "Structural Testing Techniques" • Chapter 7 , "Analyzing Risk with Code Complexity" • Chapter 8 , "Model-Based Testing" Part III, "Test Tools and Systems" • Chapter 9 , "Managing Bugs and Test Cases" • Chapter 10 , "Test Automation" • Chapter 11 , "Non-Functional Testing" • Chapter 12 , "Other Tools" • Chapter 13 , "Customer Feedback Systems" • Chapter 14 , "Testing Software Plus Services" Part IV, "About the Future" • Chapter 15 , "Solving Tomorrow's Problems Today" • Chapter 16 , "Building the Future" Find Additional Content Online As new or updated material becomes available that complements this book, it will be posted online on the Microsoft Press Online Developer Tools Web site. The type of material you might find includes
updates to book content, articles, links to companion content, errata, sample chapters, and more. This Web site is available at www.microsoft.com/learning/books/online/developer, and is updated periodically. More stories and tidbits about testing at Microsoft will be posted on www.hwtsam.com. Support for This Book If you have comments, questions, or ideas regarding the book, or questions that are not answered by visiting the sites above, please send them to Microsoft Press via e-mail to mspinput@microsoft.com. Or via postal mail to Microsoft Press Attn: How We Test Software at Microsoft Editor One Microsoft Way Redmond, WA 98052-6399. Please note that Microsoft software product support is not offered through the above addresses. Part I: About Microsoft Chapter List Chapter 1: Software Engineering at Microsoft Chapter 2: Software Test Engineers at Microsoft Chapter 3: Engineering Life Cycles Chapter 1: Software Engineering at Microsoft Ken Johnston Overview Part I of this book, Chapters 1 through 3, provides a lot of information about Microsoft, what our goals are, how we are organized to engineer products, and how we ship products. A lot of the information in this chapter has been shared publicly, but we have pulled a few strings to share some new details of Microsoft internals. There are many books, articles, and Web sites that cover Microsoft's history in detail, but we felt that a brief overview within this book that focused on Microsoft engineering would help readers better understand the why behind how we test software at Microsoft. All the methods and tools we discuss in the rest of the book are influenced by our history, vision, and business objectives.
分享到:
收藏