作者:empty 页数:364 出版社:empty |
About the AuthorGreg L.Turnquist has worked in the software industry since 1997.He is an activeparticipant in the opensource community, and has contributed patches to several projectsincluding MythTV, Spring Security, MediaWiki, and the TestNG Eclipse plugin, As a test-bittenscript junky, he has always sought the right tool for the job.He is a firm believer in agilepractices and automated testing.He has developed distributed systems, LAMP-based setups,and supported mission critical systems hosted on various platforms.After graduating from Auburn University with a Masters in Computer Engineering, Gregstarted working with Harris Corporation.He worked on many contracts utl izing many typesof technology.In 2006, he created the Spring Python project and went on to write SpringPython 1.1in 2010.He joined Spring Source, a division of VMware in 2010, as part of theirinte mational software development team,Matthew Closson is a creative technologist and entrepreneur at heart.He is currentlyemployed as a software engineer by Philips Healthcare.He is passionate about softwaretesting.systems integration, and web technologies.When not obsessing over Ruby and C#code, this elusive developer is likely to be found reading at the local bookstore or relaxing onthe beach.
Chetan Giridhar has more than five years experience of working in the software servicesindustry, product companies, and research organiza ions.He has a string background ofC/C++, Java[certifed Java professional) and has a good command of Perl, Python scriptinglanguages, using which he has developed useful tools and automation frameworks.Hisarticles on Code Reviews, Software Automation, and Agile methodologies have beenpublished in international magazines including Testing Experience and Agile Record for whichhe has received appreciation from other industry experts on his website-Techno Beans.Chetan has also co-authored a book on Design Patterns in Python that is listed at Python'sOff cl al Website, He has given lectures on Python Programming to software professionalsand at educational institutes including the Indian Institute of Astrophysics, Bangalore, Chetanholds aB.E.In Electrical Engineering from the University of Mumba land feels that the world isfull of knowledge.
I would lie to extend my thanks to SyvainHelegouarch.Matt Closson, aswell as my editors, for taking the time to technically review this book andprovide valuable feedback.I thank my one-year-old daughter for pulling meaway when I needed a break and my one-month-olds on forgiving me MANYopportunities in the middle of the night to work on this book.l especiallythank my precious wife Sara for the support, encouragement, patience, andmost importantly for saying'T think we should strike while their on is hot'when I was offered this wrt g opportunity.About the ReviewersI take this opportunity to thank Rahul Verma, who has guided and inspiredme, Ashok Mallya and Rishi Ranjan.for the lr encouragement and for theconti dence they have shown in me.Special thanks to my parents Jayant andJyotsanaGidhar, and my wife Deepti.who have all been a constant support
Sylvain Hell ego uarc his a senior software engineer with several years experience indevelopment and performance testing in various companies, both in France and in the UnitedKingdom.Passionate about open-source software, he has written several Python projectsaround communication protocols such as HTTP, XMPP, and the Atom Publishing Protocol Hehas been part of the CherryPy team since 2004 and has also authored the CherryPy Essentialsbook, published by Pack t Publishing in 2007.Sylvain also reviewed Spring Python, publishedby Pack t Publishing in 2010.His current interests are set on the open-data movement and thewave of innovation it brings to public services.When away from his computer, Sylvain plays theguitar and the drums or spends his time with friends and family.Maurice HT Ling completed his Ph.D.in Blo informatics and B.Sc(Hons) in Molecular andCell Biology from The University of Melbourne where he worked on microarray analysis andtext mining for protein-protein interactions.He is currently a SeniorS clent ist(Bioinformatics)in Life Technologies and an Honorary Fellow in The University of Melbourne, Australia.Maurice holds several Chief Editor ships including The Python Papers, Computational andMathematical Bl ology, and Methods and Cases in Computational, Mathematical, andStatistical Biology.In Singapore, he co-founded the Python UserGroup(Singapore) and hasbeen the co-chair of PyCon As la-Pac l fic since 2010.In his free tIme, Maurice likes to train inthe gym, read, and enjoy a good cup of coffee, He ls also a Senior Fellow of the InternationalFitness Association, USA.Hispersonalwebsiteis:http://maurice, vo dien.com.Support files, eBooks, discount offers and moreYou might want to visit www.PacktPub.comfor support files and downloads related to yourbook.Did you know that Pack t offers eBook versions of every book published, with PDF and ePubfiles available?You can upgrade to the eBook version at w wir,PacktPub.comand as a printbook customer, you are entitled to adls count on the eBook copy, Get In touch with us atservicegpacktpub.comfor more de talls.At ww.PacktPub.com, you can also read a collection of free technical articles, signup fora range of free newsletters and receive exclusive discounts and offers on Pack t books andeBooks.
Chapter1:UsingUnittestToDevelopBasicTests
Introduction
Asserting the basics
Setting up and tearing down a test harness
Running testcases from the commandline with increased verbosity
Running a subset of testcase methods
Chaining together a suite of tests
Defining testsuites inside the test module
Retooling old test code to run inside unittest
Breaking down obscure tests into simple ones
Testing the edges
Testing corner cases by iteration
Chapter2:RunningAutomatedTestSuiteswithNose
Introduction
Getting nosy with testing
Embedding nose inside Python
Writing a nose extension to pick tests based on regular expressions
Writing a nose extension to generate a CSV report
Writing a project-level script that lets you run different testsuites
Chapter3:CreatingTestableDocumentationwithdoctest
Introduction
Documenting the basics
Catching stacktrace s
Running doc tests from the commandline
Coding a test harness for doctest
Filtering out test noise
TableofContents
Printing out all your documentation including a status report
Testing the edges
Testing corner cases by iteration
Getting nosy with doctest
Updating the project-level script to run this chapter's doc tests
Chapter4:TestingCustomerStorieswithBehavior
Driven Development
Introduction
Naming tests that sound like sentences and stories
Testing separate doctest documents
Writing a testable story with doctest
Writing a testable novel with doctest
Writing a testable story with Void space
Mock and nose
Writing a testable story with mock i to and nose
Writing a testable story with Lettuce
Using Should DSL to write succinct assertions with Lettuce
Updating the project-level script to run this chapter's BDD tests
Chapter5:HighLevelCustomerScenarioswithAcceptanceTesting
Introduction
Installing Pyc curacy
Testing the basics with Pyc curacy
Using Pyc curacy to verify webapp security
Installing the Robot Framework
Creating a data-driven testsuite with Robot
Writing a testable story with Robot
Tagging Robot tests and running a subset
Testing web basics with Robot
Using Robot to verify webapp security
Creating a project-level script to verify this chapter's acceptance tests
Chapter6:IntegratingAutomatedTestswithContinuousIntegration
Introduction
Generating a continuous integration report for Jenkins using No seX Unit
Configuring Jenkins to run Python tests upon commit
Configuring Jenkins to run Python tests when scheduled
Generating aCl report for Team City using team city-nose
Configuring Team City to run Python tests upon commit
Configuring Team City to run Python tests when scheduled
Chapter7:MeasuringyourSuccesswithTestCoverage
Introduction
Building a network management application
Installing and running coverage on your testsuite
Generating an HTML report using coverage
Generating an XML report using coverage
Getting nosy with coverage
Filtering out test noise from coverage
Letting JenkIns get nosy with coverage
Updating the project-level script to provide coverage reports
Chapter8:Smoke/LoadTesting-Testing