Quality Control for Python Applications

Author

Michael Rossetti

Published

2024-11-06

Improve the maintainability and quality of your code. Attendees will become familiar with code modularity and organization principles, as well as quality control methods such as automated testing and continuous integration.

Prerequisites

Required Software:

  • GitHub Desktop (requires a GitHub account)
  • VS Code Text Editor
  • Anaconda
  • Command Line Application (Terminal on Mac, Git Bash on Windows)

Attendees should be familiar with Python Development Tools and Version Control before attempting this workshop.

Parts 1 and 2: Code Maintenance and Organization

Learning Objectives:

  1. Translate code from a Python notebook into a local development repository.
  2. Identify areas in code that can be simplified for improved readability and maintainability.
  3. Refactor code by simplifying complex logic and removing duplication.
  4. Discuss code organization concepts such as the single responsibility principle, and the DRY principle.
  5. Organize code into modules to enhance scalability and maintainability, and practice importing code across multiple files.
  6. Use automated tools such as Code Climate to perform automated assessments of code complexity and maintainability.

Part 3: Code Verification and Testing

Learning Objectives:

  1. Discuss the benefits of implementing automated tests in a software development project.
  2. Write automated tests for Python applications.
  3. Execute automated tests locally using the pytest package.
  4. Execute automated tests on a Continuous Integration server, using a GitHub Actions workflow.