Documentation & testing in practice

Software Engineering Principles in Python

Adam Spannbauer

Machine Learning Engineer at Eastman

Documenting projects with Sphinx

  Example Sphinx Page

Software Engineering Principles in Python

Documenting classes

class Document:
    """Analyze text data

    :param text: text to analyze

    :ivar text: text originally passed to the instance on creation
    :ivar tokens: Parsed list of words from text
    :ivar word_counts: Counter containing counts of hashtags used in text
    """
    def __init__(self, text):
        ...
Software Engineering Principles in Python

Continuous integration testing

    Travis CI Logo

Example Travis Output - Failing

Software Engineering Principles in Python

Continuous integration testing

  Example Travis Output - Passing

Software Engineering Principles in Python

Links and additional tools

  • Sphinx - Generate beautiful documentation
  • Travis CI - Continuously test your code
  • GitHub & GitLab - Host your projects with git
  • Codecov - Discover where to improve your projects tests
  • Code Climate - Analyze your code for improvements in readability
Software Engineering Principles in Python

Let's Practice

Software Engineering Principles in Python

Preparing Video For Download...