Showing posts with label Development. Show all posts

John C. Maxwell

Published by HarperCollins Leadership, an imprint of HarperCollins

Published in association with Yates & Yates, www.yates2.com.

Epub Edition November 2017 ISBN 9780718074005

Library of Congress Cataloging-in-Publication Data ISBN 978-0-718073992

Description: Nashville, Tennessee : HarperCollins, [2018] | Includes bibliographical references.
Identifiers: LCCN 2017033337 | ISBN 9780718073992
Subjects: LCSH: Leadership.
Classification: LCC HD57.7 .M394 2018 | DDC 658.4/092--dc23 LC 
record available at https://lccn.loc.gov/2017033337

e-books shop
e-books shop
Purchase Now !
Just with Paypal



Book Details
 Price
 4.00
 Pages
 244 p
 File Size 
 2,377 KB
 File Type
 PDF format
 ISBN
 978-0-718074005 (eBook)
 978-1-4002-01822 (IE)
 Copyright©   
 2018 by John C. Maxwell 

About the Author
John C. Maxwell is a #1 New York Times bestselling author, coach, and speaker
who has sold more than 26 million books in fifty languages. In 2014 he was
identified as the #1 leader in business by the American Management
Association® and the most influential leadership expert in the world by Business
Insider and Inc. magazines. He is the founder of the John Maxwell Company,
the John Maxwell Team, EQUIP, and the John Maxwell Leadership Foundation,
organizations that have trained millions of leaders. In 2015, they reached the
milestone of having trained leaders from every country in the world. The
recipient of the Mother Teresa Prize for Global Peace and Leadership from the
Luminary Leadership Network, Dr. Maxwell speaks each year to Fortune 500
companies, presidents of nations, and many of the world’s top business leaders.
He can be followed at Twitter.com/JohnCMaxwell. For more information about

PREFACE TO THE 2.0 EDITION
I can hardly believe it’s been twenty-five years since I wrote the original
manuscript of Developing the Leader Within You. When I first put my fourcolored
pen to paper, I thought I was writing my one leadership book. At age
forty-five I had been on quite a leadership journey. When I started my
professional career as a minister in rural Indiana in 1969, I didn’t think about
leadership. I just worked hard. It wasn’t until I was at my second church in the
early ’70s that I realized everything rises and falls on leadership. I started my
intentional growth journey at that time and targeted leadership as one of the
areas where I wanted to grow. While I was leading that second church in Ohio, I
began teaching others leadership. In the early ’80s, I took on the leadership of a
church in San Diego. It eventually became recognized as one of the ten most
influential churches in America. While I was there I wrote Developing the
Leader Within You. At that time I also started getting many more speaking
requests. And I started a company to help me train leaders and distribute training
resources. The demands of my schedule and the opportunities to train leaders
nationally and internationally prompted me to give up my church in 1995. I’ve
spent my time writing, speaking, and training leaders ever since.

But going back to when I wrote the first edition of this book, as I prepared to
write it, I thought a lot about the greatest discovery I had made in leading those
three organizations: that leadership can be developed. I had developed the leader
within me. And my greatest desire was to share my leadership journey with
others and teach what I had learned so that they could develop the leaders within them also.

I thought I had much to share from the first twenty-five years of my
leadership life, but when I look back now, I’m struck by how much more I’ve
learned in the twenty-five years since then. That should have been no surprise to
me, since I’ve written many additional books on leadership. But sometimes you
don’t realize how far you’ve traveled until you go back and look at where you
were. It’s like going back to the home you grew up in twenty-five years later: it’s
a lot smaller than you remembered!

I can’t tell you how excited I am to share with you the things I’ve learned
since I first wrote this book. There’s so much to tell that I can hardly contain
myself—or contain it in just ten chapters.

I have extensively rewritten this entire book. That’s why I’m calling it 2.0. It
still contains the foundational lessons for becoming a good leader. It’s still the
first book I recommend that people read to start their leadership development
journeys. And it’s still the book I recommend that leaders use to mentor others in
leadership. But I’ve taken great pains to give it greater depth, to focus it more
specifically on a leader’s needs. For example, instead of doing general teaching
on integrity and attitude, as I did in the original version, I look more specifically
at how those characteristics can make someone a better leader.

In addition, I also removed two chapters that were focused on developing
staff (which I cover in depth in other books) and replaced them with two new
chapters on topics vital to developing you as a leader: servanthood, the heart of
the leader, and personal growth, the expansion of leadership. I look back now
and think, How in the world did I miss those the first time around?
If you read the original version of the book, you’re going to be pleased by all
the new material and insights I’ve included in this new 2.0 edition celebrating
the book’s twenty-fifth anniversary. I can’t imagine offering a better leadership
tune-up than this.

If this book is new to you, you’re in for a treat, because you’re going to
receive everything you need to take a significant step in your leadership journey.
And if you do everything I suggest in the application section at the end of each
chapter, you will be amazed at how much your influence, your effectiveness, and
your impact will increase in such a short time.

So let’s go. Turn the page, and begin developing the leader within you.


Table of Contents

Preface to the 2.0 Edition
Acknowledgments

1. The Definition of Leadership: Influence
2. The Key to Leadership: Priorities
3. The Foundation of Leadership: Character
4. The Ultimate Test of Leadership: Creating Positive Change
5. The Quickest Way to Gain Leadership: Problem Solving
6. The Extra Plus in Leadership: Attitude
7. The Heart of Leadership: Serving People
8. The Indispensable Quality of Leadership: Vision
9. The Price Tag of Leadership: Self-Discipline
10. The Expansion of Leadership: Personal Growth

What’s Next?
About the Author
Notes

Bookscreen
e-books shop

Thank you to:
Charlie Wetzel, my writer
Stephanie Wetzel, who edited the first draft
Carolyn Kokinda, who typed my manuscript notes
Linda Eggers, my executive assistant

Sloan Kelly


e-books shop
e-books shop
Purchase Now !
Just with Paypal



Book Details
 Price
 4.00
 Pages
 395 p
 File Size 
 5,991 KB
 File Type
 PDF format
 ISBN-13
 978-1-4842-4532-3 (pbk)
 978-1-4842-4533-0(electronic) 
 Copyright©   
 2019 by Sloan Kelly

About the Author
Sloan Kelly has worked in the games industry
for nearly 12 years. He has worked on a
number of AAA and indie titles and currently
works for an educational game company. He
lives in Ontario, Canada, with his wife and
children. Sloan is on Twitter @codehoose and
makes YouTube videos in his spare time.

About the Technical Reviewer
John Watson is a game developer, artist, guitar
player, husband, and father. Among John’s
many software-powered side projects, he’s
building a Raspberry Pi–powered device that
generates interactive music in live modern
dance performances. He’s also developing a
retro-inspired 2D twin-stick arcade shooter
called Gravity Ace. You can follow his progress
on Twitter @yafd or at gravityace.com. Stop by
and say hi!

Introduction
This book is intended for anyone who wants to learn how to program
games. It is ideally suited to students who want to learn Python and
PyGame on their Raspberry Pi. While not necessary, this book has been
oriented toward the Raspberry Pi computer.
The Python programming language is ideally suited to beginners and
experts alike. The skills you will learn in this book are easily transferable to
other computer languages too.
If you are unfamiliar with the Raspberry Pi, there are several good
eBook guides on getting started including mine called A Slice of Raspberry
Pi, available from all good eBook retailers.
This book assumes that you are familiar with the Raspberry Pi
computer and that you have the Raspberry Pi Foundation’s recommended
Raspbian operating system installed. Raspbian is a distribution of the
Debian Linux operating system built specifically for the Raspberry Pi. This
distribution contains all the Software Development Kits (SDKs) including
one for Python that includes PyGame. If you don’t have Raspbian installed,
you will have to ensure that you have Python and PyGame installed on
your system.
Don’t have a Raspberry Pi? Not to worry, you can still learn Python and
PyGame. The code in this book will work on other OSs with Python and
PyGame installed; Python is a platform-independent language.
You can obtain more information and download versions of Python from
www.python.org. PyGame can be obtained from www.pygame.org/.
Sprites from Ari Feldman’s SpriteLib have been used for the projects
contained in this book.


Table of Contents
About the Author ..............................................................................xvii
About the Technical Reviewer ...........................................................xix
Acknowledgments .............................................................................xxi
Introduction .....................................................................................xxiii
Chapter 1: What Is a Programming Language? ....................................1
What Does a Computer Program Do? ...................................................................2
Conclusion ............................................................................................................3
Chapter 2: What Is Python? ..................................................................5
Programming Styles ..............................................................................................5
Object-Oriented .....................................................................................................7
Functional .............................................................................................................8
What Is Pygame? ..................................................................................................8
Conclusion ............................................................................................................9
Chapter 3: Introducing Python ............................................................11
The Terminal Window ..........................................................................................11
Running the Python Interpreter ...........................................................................12
Python Is Interpreted ...........................................................................................13
Python As a Calculator ........................................................................................13
Keywords ............................................................................................................16
Printing ...............................................................................................................17
String Formatting ..........................................................................................19
Variables .............................................................................................................22
Naming Variables ...........................................................................................22
Python As a Calculator, Part II .............................................................................23
Arithmetic Operators .....................................................................................26
Data Types .....................................................................................................27
Numeric Types ...............................................................................................27
String Formatting Again ................................................................................29
Conclusion ..........................................................................................................31
Chapter 4: Breaking Free from the Interpreter ...................................33
What Is IDLE? ......................................................................................................33
Starting IDLE .......................................................................................................33
Starting a New File .............................................................................................34
Hello, World! ........................................................................................................36
Running from the Command Line ..................................................................36
Running from Inside IDLE ..............................................................................38
Conclusion ..........................................................................................................39
Chapter 5: Making Decisions ..............................................................41
A Note About Blocks ............................................................................................44
Testing for Equality .............................................................................................45
Using Boolean Logic ............................................................................................50
And ................................................................................................................50
Or ...................................................................................................................51
Not .................................................................................................................52
Nesting Ifs ...........................................................................................................52
A Note on Switch ................................................................................................54
Conclusion ..........................................................................................................54
Chapter 6: Making the Raspberry Pi Repeat Itself .............................55
The for Loop ........................................................................................................55
The range() Function .....................................................................................57
While Loops .........................................................................................................58
Counting ........................................................................................................58
Sentinel .........................................................................................................60
Conditional .....................................................................................................62
Conclusion ..........................................................................................................62
Chapter 7: Containers .........................................................................63
Container Nomenclature .....................................................................................63
Tuples ..................................................................................................................64
Removing Elements from a Tuple ..................................................................64
Changing Element Values ..............................................................................65
Tuples in Printing ...........................................................................................66
Deconstructing Tuples ...................................................................................67
Lists ....................................................................................................................67
List Creation ..................................................................................................68
Adding Values to the List ...............................................................................68
Removing Values from a List .........................................................................69
Doctor’s Waiting Room Program ....................................................................70
Dictionaries .........................................................................................................73
Iterating Through Dictionaries .......................................................................74
Adding New Items to Dictionaries .................................................................74
Removing Entries from a Dictionary ..............................................................74
Conclusion ..........................................................................................................75
Chapter 8: Putting It Together: Tic-Tac-Toe ........................................77
The Rules ............................................................................................................77
Program Layout ...................................................................................................79
Variables .............................................................................................................79
The Game ............................................................................................................80
Save and Run ......................................................................................................85
Conclusion ..........................................................................................................85
Chapter 9: Basic Introduction to PyGame ...........................................87
Importing the PyGame Framework .....................................................................87
Initializing PyGame ..............................................................................................88
The Main Loop ....................................................................................................89
Images and Surfaces ..........................................................................................92
Creating Images ..................................................................................................93
Loading Images ...................................................................................................93
Drawing Images ..................................................................................................94
Screen Coordinates and Resolution ....................................................................94
Sprite Sheets ......................................................................................................95
Full Listing ..........................................................................................................97
Conclusion ..........................................................................................................97
Chapter 10: Designing Your Game ......................................................99
Initial Concept .....................................................................................................99
Prototyping ..................................................................................................100
Functional Specification ...................................................................................101
Weapon Firing .............................................................................................101
Program Design ................................................................................................101
Coding ...............................................................................................................102
Testing ..............................................................................................................104
Iteration .............................................................................................................105
Conclusion ........................................................................................................105
Chapter 11: Game Project: Bricks ....................................................107
The Main Framework ........................................................................................108
Images ..............................................................................................................109
Moving the Bat ..................................................................................................110
Bat Initialization ...........................................................................................111
Drawing the Bat ...........................................................................................112
Moving the Bat ............................................................................................112
Moving the Ball .................................................................................................114
Ball Initialization ..........................................................................................114
Ball Movement .............................................................................................115
Bat and Ball Collision ...................................................................................118
Serving the Ball ...........................................................................................120
Brick Wall ..........................................................................................................121
Brick and Ball Collision ................................................................................122
Out of Bounds ..............................................................................................124
Conclusion ........................................................................................................125
Chapter 12: User-Defined Functions .................................................127
What Is a Function? ..........................................................................................127
Format of a Function .........................................................................................127
Functions as a Menial Task/Mnemonic Device .................................................128
Sending Parameters .........................................................................................129
Default Argument Values ...................................................................................131
Named Parameters ......................................................................................132
Returning Values ...............................................................................................133
Returning Tuples ..........................................................................................134
Accessing Global Variables ...............................................................................135
Real-World Example of a Function ....................................................................136
Conclusion ........................................................................................................139
Chapter 13: File Input and Output .....................................................141
Reading a File from Disk ...................................................................................141
Writing Data to a File ........................................................................................143
Reading and Writing Containers to a File ..........................................................144
Writing Your Own Serializer .........................................................................145
Writing Your Own Deserializer .....................................................................147
JSON .................................................................................................................148
JSON Serialization .......................................................................................148
JSON Deserializer ........................................................................................149
Handling Errors .................................................................................................150
Conclusion ........................................................................................................151
Chapter 14: Introducing Object-Oriented Programming ...................153
Classes and Objects ..........................................................................................154
Encapsulation ...................................................................................................154
Abstraction ........................................................................................................155
Inheritance ........................................................................................................155
Polymorphism ...................................................................................................155
Why Should You Use OOP? ................................................................................156
Data Hiding ..................................................................................................156
Reusable ......................................................................................................156
Easier to Code and Test Separately .............................................................156
The Ball Class ...................................................................................................157
Creating an Instance of the Class .....................................................................160
The Ball update( ) Method ............................................................................161
Constructors ................................................................................................162
SOLID ................................................................................................................164
Single Responsibility ...................................................................................165
Open-Closed Principle .................................................................................165
Liskov Substitution ......................................................................................166
Interface Segregation ..................................................................................166
Dependency Inversion .................................................................................167
Conclusion ........................................................................................................170
Chapter 15: Inheritance, Composition, and Aggregation ..................171
Inheritance ........................................................................................................172
Base and Child Classes .....................................................................................173
Programming to the Interface .....................................................................175
A Note About Constructors and Base Classes .............................................175
Composition ......................................................................................................177
Aggregation .......................................................................................................179
Conclusion ........................................................................................................180
Chapter 16: Game Project: Snake .....................................................181
Functions ..........................................................................................................182
Snake Framework .............................................................................................183
Images ..............................................................................................................190
Loading the Images .....................................................................................191
The Game Map ..................................................................................................192
Drawing the ‘Game Over’ Screen ......................................................................193
Drawing the Game ............................................................................................195
Drawing the Walls .............................................................................................196
Drawing the Player Data ...................................................................................198
Drawing the Snake ............................................................................................199
Updating the Game ...........................................................................................202
The updateGame( ) Method ..........................................................................203
Snake Movement .........................................................................................205
Touching a Berry ..........................................................................................206
Collision Detection ............................................................................................208
Helper Functions .........................................................................................208
Conclusion ........................................................................................................212
Chapter 17: Model View Controller ...................................................213
Model ................................................................................................................214
View ..................................................................................................................214
Controller ..........................................................................................................214
Why Use MVC? ..................................................................................................215
The Classes .................................................................................................216
Folder ..........................................................................................................217
The Robot Model .........................................................................................217
The Robot View ............................................................................................219
The Radar View ............................................................................................221
The Robot Controller ....................................................................................222
The Robot Generator ....................................................................................225
Ensuring Constant Speed ..................................................................................227
The Main Robot Program ..................................................................................228
Conclusion ........................................................................................................230
Chapter 18: Audio .............................................................................233
Playing a Sound ................................................................................................234
Playing, Pausing, and Changing Volume ...........................................................235
Conclusion ........................................................................................................240
Chapter 19: Finite State Machines ...................................................241
Game State .......................................................................................................241
Menu System ....................................................................................................241
Non-player Artificial Intelligence .......................................................................242
A Finite State Machine Example .......................................................................243
Finite State Machine Manager ....................................................................244
Conclusion ........................................................................................................249
Chapter 20: Game Project: Invaders .................................................251
The Classes .......................................................................................................253
The Finite State Machine ..................................................................................254
MVC and ‘Invaders’ ...........................................................................................255
The Framework .................................................................................................255
Bitmap Font .................................................................................................259
Interstitial Screens ......................................................................................263
The Main Menu ............................................................................................264
Player and Bullets .............................................................................................267
The Bullet Classes .......................................................................................267
The Player Classes ......................................................................................270
Testing Player ..............................................................................................273
The Alien Swarm Classes ..................................................................................275
Collision Detection ............................................................................................282
Explosions ...................................................................................................282
Collision Controller ......................................................................................285
The Main Program .............................................................................................288
The Main Game State ........................................................................................289
Running the Game ............................................................................................292
Conclusion ........................................................................................................293
Chapter 21: Simple Electronics with the GPIO Pins ..........................295
Voltage, Current, and Resistance ......................................................................296
What You Will Need ...........................................................................................298
Breadboard ..................................................................................................298
Breakout Board ............................................................................................299
Jumper Wires ..............................................................................................300
LEDs ............................................................................................................302
Resistors ......................................................................................................304
Switches ......................................................................................................307
Building a Circuit ...............................................................................................308
Connecting the Breakout Board to the Raspberry Pi ...................................308
Providing Power and Ground .......................................................................311
Adding the LED ............................................................................................312
Completing the Circuit .................................................................................313
Testing the Circuit ........................................................................................315
Pin Meanings ....................................................................................................316
The gpiozero Library .........................................................................................317
The Circuit ...................................................................................................318
The Python Program ....................................................................................319
Getting Button Input ....................................................................................320
Reading Button Input in Python ...................................................................321
Conclusion ........................................................................................................322
Chapter 22: Game Project: Memory ..................................................323
Arranging the Breadboard .................................................................................324
Placing the LEDs ..........................................................................................324
Testing the Circuit .............................................................................................326
Placing the Tact Switches ............................................................................327
Testing the Button Circuit ............................................................................328
The Memory Game ............................................................................................330
The ButtonLED and ButtonLEDCollection Classes .......................................331
The Main Program .......................................................................................334
Full Listing buttonled.py ....................................................................................336
Full Listing memorygame.py .............................................................................338
Conclusion ........................................................................................................339
Chapter 23: Game Project: Quiz ........................................................341
The Electronics .................................................................................................341
Testing the Buttons ......................................................................................342
The Finite State Machine ..................................................................................345
Making the Game ..............................................................................................347
The Questions ..............................................................................................348
UI Helper Classes .........................................................................................354
The Game Runner and Base State Class .....................................................359
Player Input .................................................................................................361
The State Classes ........................................................................................362
Playing the Game ..............................................................................................376
Conclusion ........................................................................................................377
Chapter 24: Conclusion .....................................................................379
Index .................................................................................................381


Bookscreen
e-books shop

Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Spandana Chatterjee
Development Editor: James Markham
Coordinating Editor: Divya Modi
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)

Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools

Greg L. Turnquist


e-books shop
e-books shop
Purchase Now !
Just with Paypal



Book Details
 Price
 2.00
 Pages
 362 p
 File Size 
 8,659 KB
 File Type
 PDF format
 ISBN
 978-1-849514-66-8  
 Copyright©   
 2011 Packt Publishing 

About the Author
Greg L. Turnquist has worked in the software industry since 1997. He is an active
participant in the open source community, and has contributed patches to several projects
including MythTV, Spring Security, MediaWiki, and the TestNG Eclipse plugin. As a test-bitten
script junky, he has always sought the right tool for the job. He is a firm believer in agile
practices 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 Master's in Computer Engineering, Greg
started working with Harris Corporation. He worked on many contracts utilizing many types
of technology. In 2006, he created the Spring Python project and went on to write Spring
Python 1.1 in 2010. He joined SpringSource, a division of VMware in 2010, as part of their
international software development team.

About the Reviewers
Matthew Closson is a creative technologist and entrepreneur at heart. He is currently
employed as a software engineer by Philips Healthcare. He is passionate about software
testing, 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 on the beach.

Chetan Giridhar has more than five years experience of working in the software services
industry, product companies, and research organizations. He has a string background of
C/C++, Java (certified Java professional) and has a good command of Perl, Python scripting
languages, using which he has developed useful tools and automation frameworks. His
articles on Code Reviews, Software Automation, and Agile methodologies have been
published in international magazines including TestingExperience and AgileRecord for which
he has received appreciation from other industry experts on his website—TechnoBeans.
Chetan has also co-authored a book on Design Patterns in Python that is listed at Python's
Official Website. He has given lectures on Python Programming to software professionals
and at educational institutes including the Indian Institute of Astrophysics, Bangalore. Chetan
holds a B.E. in Electrical Engineering from the University of Mumbai and feels that the world is
full of knowledge.

Sylvain Hellegouarch is a senior software engineer with several years experience in
development and performance testing in various companies, both in France and in the United
Kingdom. Passionate about open-source software, he has written several Python projects
around communication protocols such as HTTP, XMPP, and the Atom Publishing Protocol. He
has been part of the CherryPy team since 2004 and has also authored the CherryPy Essentials
book, published by Packt Publishing in 2007. Sylvain also reviewed Spring Python, published
by Packt Publishing in 2010. His current interests are set on the open-data movement and the
wave of innovation it brings to public services. When away from his computer, Sylvain plays the
guitar and the drums or spends his time with friends and family.

Maurice HT Ling completed his Ph.D. in Bioinformatics and B.Sc(Hons) in Molecular and
Cell Biology from The University of Melbourne where he worked on microarray analysis and
text mining for protein-protein interactions. He is currently a Senior Scientist (Bioinformatics)
in Life Technologies and an Honorary Fellow in The University of Melbourne, Australia.
Maurice holds several Chief Editorships including The Python Papers, Computational and
Mathematical Biology, and Methods and Cases in Computational, Mathematical, and
Statistical Biology. In Singapore, he co-founded the Python User Group (Singapore) and has
been the co-chair of PyCon Asia-Pacific since 2010. In his free time, Maurice likes to train in
the gym, read, and enjoy a good cup of coffee. He is also a Senior Fellow of the International
Fitness Association, USA. His personal website is: http://maurice.vodien.com.

Preface
Testing has always been a part of software development. For decades, comprehensive testing
was defined by complex manual test procedures backed by big budgets; but something
revolutionary happened in 1998. In his Guide to Better Smalltalk, Smalltalk guru Kent Beck
introduced an automated test framework called SUnit. This triggered an avalanche of test
frameworks including JUnit, PyUnit, and many others for different languages and various
platforms, dubbed the xUnit movement. Automated testing was made a cornerstone
of the agile movement when 17 top software experts signed the Agile Manifesto in 2001.
Testing includes many different styles including unit testing, integration testing, acceptance
testing, smoke testing, load testing, and countless others. This book digs in and explores
testing at all the important levels while using the nimble power of Python. It also shows many tools.

This book is meant to expand your knowledge of testing from something you either heard
about or have practiced a little into something you can apply at any level to meet your needs
in improving software quality. I hope to give you the tools to reap huge rewards in better
software development and customer satisfaction.

Table of Contents
Preface 1
Chapter 1: Using Unittest To Develop Basic Tests 5
Introduction 5
Asserting the basics 7
Setting up and tearing down a test harness 11
Running test cases from the command line with increased verbosity 14
Running a subset of test case methods 16
Chaining together a suite of tests 18
Defining test suites inside the test module 21
Retooling old test code to run inside unittest 25
Breaking down obscure tests into simple ones 29
Testing the edges 35
Testing corner cases by iteration 39
Chapter 2: Running Automated Test Suites with Nose 45
Introduction 45
Getting nosy with testing 46
Embedding nose inside Python 49
Writing a nose extension to pick tests based on regular expressions 52
Writing a nose extension to generate a CSV report 59
Writing a project-level script that lets you run different test suites 66
Chapter 3: Creating Testable Documentation with doctest 77
Introduction 77
Documenting the basics 78
Catching stack traces 82
Running doctests from the command line 85
Coding a test harness for doctest 88
Filtering out test noise 92
Printing out all your documentation including a status report 96
Testing the edges 101
Testing corner cases by iteration 104
Getting nosy with doctest 107
Updating the project-level script to run this chapter's doctests 110
Chapter 4: Testing Customer Stories with Behavior
Driven Development 117
Introduction 117
Naming tests that sound like sentences and stories 120
Testing separate doctest documents 126
Writing a testable story with doctest 130
Writing a testable novel with doctest 136
Writing a testable story with Voidspace 142
Mock and nose 142
Writing a testable story with mockito and nose 147
Writing a testable story with Lettuce 150
Using Should DSL to write succinct assertions with Lettuce 158
Updating the project-level script to run this chapter's BDD tests 163
Chapter 5: High Level Customer Scenarios with Acceptance Testing 169
Introduction 170
Installing Pyccuracy 172
Testing the basics with Pyccuracy 176
Using Pyccuracy to verify web app security 179
Installing the Robot Framework 183
Creating a data-driven test suite with Robot 186
Writing a testable story with Robot 191
Tagging Robot tests and running a subset 197
Testing web basics with Robot 204
Using Robot to verify web app security 208
Creating a project-level script to verify this chapter's acceptance tests 212
Chapter 6: Integrating Automated Tests with Continuous Integration 217
Introduction 217
Generating a continuous integration report for Jenkins using NoseXUnit 220
Configuring Jenkins to run Python tests upon commit 222
Configuring Jenkins to run Python tests when scheduled 227
Generating a CI report for TeamCity using teamcity-nose 231
Configuring TeamCity to run Python tests upon commit 234
Configuring TeamCity to run Python tests when scheduled 237
Chapter 7: Measuring your Success with Test Coverage 241
Introduction 241
Building a network management application 243
Installing and running coverage on your test suite 251
Generating an HTML report using coverage 255
Generating an XML report using coverage 257
Getting nosy with coverage 259
Filtering out test noise from coverage 261
Letting Jenkins get nosy with coverage 264
Updating the project-level script to provide coverage reports 269
Chapter 8: Smoke/Load Testing—Testing Major Parts 275
Introduction 275
Defining a subset of test cases using import statements 277
Leaving out integration tests 281
Targeting end-to-end scenarios 285
Targeting the test server 290
Coding a data simulator 298
Recording and playing back live data in real time 303
Recording and playing back live data as fast as possible 311
Automating your management demo 319
Chapter 9: Good Test Habits for New and Legacy Systems 323
Introduction 324
Something is better than nothing 324
Coverage isn't everything 326
Be willing to invest in test fixtures 328
If you aren't convinced on the value of testing, your team
won't be either 330
Harvesting metrics 331
Capturing a bug in an automated test 332
Separating algorithms from concurrency 333
Pause to refactor when test suite takes too long to run 334
Cash in on your confidence 336
Be willing to throw away an entire day of changes 337
Instead of shooting for 100 percent coverage, try to have a steady growth 339
Randomly breaking your app can lead to better code 340
Index 343


Bookscreen
e-books shop

What you need for this book
You will need Python 2.6 or above. The recipes in this book have NOT been tested against
Python 3+. This book uses many other Python test tools, but includes detailed steps to show
how to install and use them.
Who this book is for
This book is for Python developers who want to take testing to the next level. It covers different
styles of testing, giving any developer an expanded set of testing skills to help write better
systems. It also captures lessons learned from the author, explaining not only how to write
better tests but why.
Loading...
DMCA.com Protection Status