Документація й тестування на практиці

Принципи Software Engineering у Python

Adam Spannbauer

Machine Learning Engineer at Eastman

Documenting projects with Sphinx

  Приклад сторінки Sphinx

Принципи Software Engineering у 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 у Python

Continuous integration testing

    Travis CI Logo

Example Travis Output - Failing

Принципи Software Engineering у Python

Continuous integration testing

  Example Travis Output - Passing

Принципи Software Engineering у 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 у Python

Let's Practice

Принципи Software Engineering у Python

Preparing Video For Download...