実際のドキュメンテーションとテスト

Python におけるソフトウェアエンジニアリングの原則

Adam Spannbauer

Machine Learning Engineer at Eastman

Sphinxでプロジェクトをドキュメント化する

Sphinxページの例

Python におけるソフトウェアエンジニアリングの原則

クラスのドキュメント化

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):
        ...
Python におけるソフトウェアエンジニアリングの原則

継続的インテグレーションテスト

Travis CI Logo

Travis の出力例 - 失敗

Python におけるソフトウェアエンジニアリングの原則

継続的インテグレーションテスト

Travis の出力例 - 合格

Python におけるソフトウェアエンジニアリングの原則

リンクと追加ツール

  • Sphinx - 整理されたドキュメントを生成
  • Travis CI - コードの継続的なテスト
  • GitHub & GitLab - gitでプロジェクトをホスト
  • Codecov - プロジェクトのテストの改善点を見つける
  • Code Climate - 読みやすくするためにコードを分析
Python におけるソフトウェアエンジニアリングの原則

練習しましょう!

Python におけるソフトウェアエンジニアリングの原則

Preparing Video For Download...