O'Reilly logo

NumPy Cookbook - Second Edition by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Quality Assurance

 

"If you lie to the computer, it will get you."

 
 --Perry Farrar, Communications of the ACM, Volume 28

In this chapter, we'll cover the following recipes:

  • Installing Pyflakes
  • Performing static analysis with Pyflakes
  • Analyzing code with Pylint
  • Performing static analysis with Pychecker
  • Testing code with docstrings
  • Writing unit tests
  • Testing code with mocks
  • Testing the BDD way

Introduction

Quality assurance, contrary to popular belief, is not so much about finding bugs as it is about preventing them. We will discuss two ways to improve code quality, thereby preventing issues. First, we will carry out static analysis of already existing code. Then, we will cover unit testing; this includes mocking and Behavior-Driven Development

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required