Cargando…

Python testing : beginner's guide.

The book begins with the very foundations of automated testing, and expands on them until the best-practice tools and techniques are fully covered. New concepts are illustrated with step-by-step hands-on exercises. Testing will be easier and more enjoyable with this beginner's guide. If you are...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Arbuckle, Daniel
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, U.K. : Packt Pub., 2010.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Table of Contents; Python Testing Beginner's Guide; Python Testing; Credits; About the Author; About the Reviewers; Preface; What this book covers; What you need for this book; Who this book is for; Conventions; Time for action
  • heading; What just happened?; Pop quiz
  • heading; Have a go hero
  • heading; Reader feedback; Customer support; Errata; Piracy; Questions; 1. Testing for Fun and Profit; How can testing help?; Types of testing; Unit testing; Integration testing; System testing; You've got Python, right?; Summary; 2. Doctest: The Easiest Testing Tool; Basic doctest.
  • Time for action
  • creating and running your first doctestWhat just happened?; The syntax of doctests; Time for action
  • writing a more complex test; What just happened?; Expecting exceptions; Time for action
  • expecting an exception; What just happened?; Expecting blank lines in the output; Using directives to control doctest; Ignoring part of the result; Time for action
  • using ellipsis in tests; What just happened?; Ignoring whitespace; Time for action
  • normalizing whitespace; Skipping an example entirely; Time for action
  • skipping tests; What just happened?; Other doctest directives.
  • Execution scopePop quiz
  • doctest syntax; Have a go hero
  • from English to doctest; Embedding doctests in Python docstrings; Time for action
  • embedding a doctest in a docstring; What just happened?; Doctest directives; Execution scope; Putting it in practice: an AVL tree; English specification; Node data; Constructor; Recalculate height; Make deletable; Rotation; Locating a node; Testing the rest of the specification; Summary; 3. Unit Testing with Doctest; What is Unit testing and what it is not?; Time for action
  • identifying units; What just happened?; Pop quiz
  • understanding units.
  • Unit testing throughout the development processDesign phase; Time for action
  • unit testing during design; What just happened?; Pop quiz
  • unit testing during design; Have a go hero; Development phase; Time for action
  • unit testing during development; What just happened?; Feedback phase; Time for action
  • unit testing during feedback; What just happened?; Back to the development phase; Time for action
  • unit testing during development ... again; What just happened?; Maintenance phase; Time for action
  • unit testing during maintenance; What just happened?; Reuse phase.
  • Time for action
  • unit testing during reuseWhat just happened?; Pop quiz
  • unit testing; Have a go hero
  • test-driven development; Summary; 4. Breaking Tight Coupling by using Mock Objects; Installing Python Mocker; Time for action
  • installing Python Mocker; The idea of a mock object; Python Mocker; Time for action
  • exploring the basics of Mocker; What just happened?; Mocking functions; Mocking containers; Parameter matching; ANY; ARGS; KWARGS; IS; IN; CONTAINS; MATCH; Mocking complex expressions; Have a go hero; Returning iterators; Raising exceptions; Calling functions via a mock.