目指せ、テストカバレッジ100%

61
目指せ! テストカバレッジ100% ふしはらかん(kan) / FreakOut Inc. Aim, Test coverage 100% 13922日日曜日

description

YAPC::Asia 2013 の LT 2日目のtalk資料です

Transcript of 目指せ、テストカバレッジ100%

Page 1: 目指せ、テストカバレッジ100%

目指せ!テストカバレッジ100%

ふしはらかん(kan) / FreakOut Inc.

Aim, Test coverage 100%

13年9月22日日曜日

Page 2: 目指せ、テストカバレッジ100%

LTの前にBefore LT

Apology

13年9月22日日曜日

Page 3: 目指せ、テストカバレッジ100%

LTの前に

•お詫び

Before LT

Apology

13年9月22日日曜日

Page 4: 目指せ、テストカバレッジ100%

タイトルは釣りですThe title of this presentation is deception

13年9月22日日曜日

Page 5: 目指せ、テストカバレッジ100%

目指せ!テストカバレッジ100%

ふしはらかん(precuredaisuki) / FreakOut Inc.

13年9月22日日曜日

Page 6: 目指せ、テストカバレッジ100%

目指せ!テストカバレッジ100%

ふしはらかん(precuredaisuki) / FreakOut Inc.

13年9月22日日曜日

Page 7: 目指せ、テストカバレッジ100%

目指せ!テストカバレッジ100%

ふしはらかん(precuredaisuki) / FreakOut Inc.

13年9月22日日曜日

Page 8: 目指せ、テストカバレッジ100%

目指せ!テストカバレッジ100%

ふしはらかん(precuredaisuki) / FreakOut Inc.

13年9月22日日曜日

Page 9: 目指せ、テストカバレッジ100%

テストカバレッジって?What is test coverage?

Software testing is doing and test the percentage of how much of the software body

13年9月22日日曜日

Page 10: 目指せ、テストカバレッジ100%

テストカバレッジって?

•ソフトウェアテストが

What is test coverage?

Software testing is doing and test the percentage of how much of the software body

13年9月22日日曜日

Page 11: 目指せ、テストカバレッジ100%

テストカバレッジって?

•ソフトウェアテストが

•ソフトウェア本体のどの程度の割合を

What is test coverage?

Software testing is doing and test the percentage of how much of the software body

13年9月22日日曜日

Page 12: 目指せ、テストカバレッジ100%

テストカバレッジって?

•ソフトウェアテストが

•ソフトウェア本体のどの程度の割合を

•テスト対象としているか

What is test coverage?

Software testing is doing and test the percentage of how much of the software body

13年9月22日日曜日

Page 13: 目指せ、テストカバレッジ100%

何が嬉しいかWhat do happy?

Is important to be able to find the leak and bias of the test, do you seek the perfect it is

not important13年9月22日日曜日

Page 14: 目指せ、テストカバレッジ100%

何が嬉しいか

•あのメソッドのテスト忘れてたWhat do happy?

Is important to be able to find the leak and bias of the test, do you seek the perfect it is

not important13年9月22日日曜日

Page 15: 目指せ、テストカバレッジ100%

何が嬉しいか

•あのメソッドのテスト忘れてた

•あのパターンの時のテスト忘れてた

What do happy?

Is important to be able to find the leak and bias of the test, do you seek the perfect it is

not important13年9月22日日曜日

Page 16: 目指せ、テストカバレッジ100%

何が嬉しいか

•あのメソッドのテスト忘れてた

•あのパターンの時のテスト忘れてた

•等に気付ける

What do happy?

Is important to be able to find the leak and bias of the test, do you seek the perfect it is

not important13年9月22日日曜日

Page 17: 目指せ、テストカバレッジ100%

何が嬉しいか

•あのメソッドのテスト忘れてた

•あのパターンの時のテスト忘れてた

•等に気付ける

•100%にすることが目標ではない

What do happy?

Is important to be able to find the leak and bias of the test, do you seek the perfect it is

not important13年9月22日日曜日

Page 18: 目指せ、テストカバレッジ100%

perlでやりたいI want to do in perl

13年9月22日日曜日

Page 19: 目指せ、テストカバレッジ100%

perlでやりたい•Devel::Coverが鉄板

I want to do in perl

13年9月22日日曜日

Page 20: 目指せ、テストカバレッジ100%

perlでやりたい•Devel::Coverが鉄板

cpanm  Devel::Covercover  -­‐test

I want to do in perl

13年9月22日日曜日

Page 21: 目指せ、テストカバレッジ100%

perlでやりたい•Devel::Coverが鉄板

cpanm  Devel::Covercover  -­‐test

I want to do in perl

13年9月22日日曜日

Page 22: 目指せ、テストカバレッジ100%

perlでやりたい•Devel::Coverが鉄板

cpanm  Devel::Covercover  -­‐test

I want to do in perl

13年9月22日日曜日

Page 23: 目指せ、テストカバレッジ100%

問題点

See coverage reports generated for every test run it is not realistic

Issues

13年9月22日日曜日

Page 24: 目指せ、テストカバレッジ100%

問題点

•実行→HTML生成→確認は面倒

See coverage reports generated for every test run it is not realistic

Issues

13年9月22日日曜日

Page 25: 目指せ、テストカバレッジ100%

問題点

•実行→HTML生成→確認は面倒

•チームの場合の結果共有は?

See coverage reports generated for every test run it is not realistic

Issues

13年9月22日日曜日

Page 26: 目指せ、テストカバレッジ100%

そこでcoverallsですよSo it’s coveralls

13年9月22日日曜日

Page 27: 目指せ、テストカバレッジ100%

coverallsとは?What is coveralls?

13年9月22日日曜日

Page 28: 目指せ、テストカバレッジ100%

coverallsとは?• https://coveralls.io/

What is coveralls?

13年9月22日日曜日

Page 29: 目指せ、テストカバレッジ100%

coverallsとは?• https://coveralls.io/

• テストカバレッジをプロジェクト単位で表示してくれるサービス

What is coveralls?

13年9月22日日曜日

Page 30: 目指せ、テストカバレッジ100%

coverallsとは?• https://coveralls.io/

• テストカバレッジをプロジェクト単位で表示してくれるサービス

• Service that will display on a project-by-project basis test coverage

What is coveralls?

13年9月22日日曜日

Page 31: 目指せ、テストカバレッジ100%

coverallsとは?• https://coveralls.io/

• テストカバレッジをプロジェクト単位で表示してくれるサービス

• Service that will display on a project-by-project basis test coverage

• ruby / python 他の各言語に対応

What is coveralls?

13年9月22日日曜日

Page 32: 目指せ、テストカバレッジ100%

coverallsとは?• https://coveralls.io/

• テストカバレッジをプロジェクト単位で表示してくれるサービス

• Service that will display on a project-by-project basis test coverage

• ruby / python 他の各言語に対応• support many language

What is coveralls?

13年9月22日日曜日

Page 33: 目指せ、テストカバレッジ100%

coverallsとは?• https://coveralls.io/

• テストカバレッジをプロジェクト単位で表示してくれるサービス

• Service that will display on a project-by-project basis test coverage

• ruby / python 他の各言語に対応• support many language

• APIがある ← !!

What is coveralls?

13年9月22日日曜日

Page 34: 目指せ、テストカバレッジ100%

無いなら作ればいいShould I make if not

13年9月22日日曜日

Page 35: 目指せ、テストカバレッジ100%

無いなら作ればいい

•Devel::Cover::Report::Coveralls

Should I make if not

13年9月22日日曜日

Page 36: 目指せ、テストカバレッジ100%

無いなら作ればいい

•Devel::Cover::Report::Coveralls

• Devel::Coverのreport機構を利用

Should I make if not

13年9月22日日曜日

Page 37: 目指せ、テストカバレッジ100%

無いなら作ればいい

•Devel::Cover::Report::Coveralls

• Devel::Coverのreport機構を利用

• coveralls.ioのAPIを叩く

Should I make if not

13年9月22日日曜日

Page 38: 目指せ、テストカバレッジ100%

使い方How to use

13年9月22日日曜日

Page 39: 目指せ、テストカバレッジ100%

使い方• coverallsにログイン(githubアカウントでログイ

ンできる) login coveralls

How to use

13年9月22日日曜日

Page 40: 目指せ、テストカバレッジ100%

使い方• coverallsにログイン(githubアカウントでログイ

ンできる) login coveralls

• 自分のリポジトリを登録する

How to use

13年9月22日日曜日

Page 41: 目指せ、テストカバレッジ100%

使い方• coverallsにログイン(githubアカウントでログイ

ンできる) login coveralls

• 自分のリポジトリを登録する

• The registration in its own repositories

How to use

13年9月22日日曜日

Page 42: 目指せ、テストカバレッジ100%

使い方• coverallsにログイン(githubアカウントでログイ

ンできる) login coveralls

• 自分のリポジトリを登録する

• The registration in its own repositories

How to use

13年9月22日日曜日

Page 43: 目指せ、テストカバレッジ100%

使い方

language:  perlperl:    -­‐  5.18.1    -­‐  5.16.3before_install:    cpanm  -­‐n  Devel::Cover::Report::Coverallsscript:    perl  Build.PL  &&  ./Build  build  &&  cover  -­‐test  -­‐report  coveralls

How to use

13年9月22日日曜日

Page 44: 目指せ、テストカバレッジ100%

使い方

•TravisCI用の設定(.travis.yml)を修正

language:  perlperl:    -­‐  5.18.1    -­‐  5.16.3before_install:    cpanm  -­‐n  Devel::Cover::Report::Coverallsscript:    perl  Build.PL  &&  ./Build  build  &&  cover  -­‐test  -­‐report  coveralls

How to use

13年9月22日日曜日

Page 45: 目指せ、テストカバレッジ100%

使い方

•TravisCI用の設定(.travis.yml)を修正

•fix .travis.ymllanguage:  perlperl:    -­‐  5.18.1    -­‐  5.16.3before_install:    cpanm  -­‐n  Devel::Cover::Report::Coverallsscript:    perl  Build.PL  &&  ./Build  build  &&  cover  -­‐test  -­‐report  coveralls

How to use

13年9月22日日曜日

Page 46: 目指せ、テストカバレッジ100%

使い方How to use

13年9月22日日曜日

Page 47: 目指せ、テストカバレッジ100%

使い方•githubへコードをpush push the code to github

How to use

13年9月22日日曜日

Page 48: 目指せ、テストカバレッジ100%

使い方•githubへコードをpush push the code to github

How to use

13年9月22日日曜日

Page 49: 目指せ、テストカバレッジ100%

使い方•githubへコードをpush push the code to github

How to use

13年9月22日日曜日

Page 50: 目指せ、テストカバレッジ100%

13年9月22日日曜日

Page 51: 目指せ、テストカバレッジ100%

13年9月22日日曜日

Page 52: 目指せ、テストカバレッジ100%

仕組み

Throw the API of coveralls by obtaining a token from the environment variable of

TravisCI. It is necessary to put the configuration file token in CI other

Mechanism

13年9月22日日曜日

Page 53: 目指せ、テストカバレッジ100%

仕組み

•TravisCIの環境変数からtokenを取得

Throw the API of coveralls by obtaining a token from the environment variable of

TravisCI. It is necessary to put the configuration file token in CI other

Mechanism

13年9月22日日曜日

Page 54: 目指せ、テストカバレッジ100%

仕組み

•TravisCIの環境変数からtokenを取得

•APIで投げる

Throw the API of coveralls by obtaining a token from the environment variable of

TravisCI. It is necessary to put the configuration file token in CI other

Mechanism

13年9月22日日曜日

Page 55: 目指せ、テストカバレッジ100%

仕組み

•TravisCIの環境変数からtokenを取得

•APIで投げる

•他のCIでは設定ファイルにtokenを記述する必要

Throw the API of coveralls by obtaining a token from the environment variable of

TravisCI. It is necessary to put the configuration file token in CI other

Mechanism

13年9月22日日曜日

Page 56: 目指せ、テストカバレッジ100%

まとめSummary

Let's take a test coverage for better code. Regards the coveralls-perl

13年9月22日日曜日

Page 57: 目指せ、テストカバレッジ100%

まとめ

•より良いコードのためにテストカバレッジをとろう

Summary

Let's take a test coverage for better code. Regards the coveralls-perl

13年9月22日日曜日

Page 58: 目指せ、テストカバレッジ100%

まとめ

•より良いコードのためにテストカバレッジをとろう

• coverallsは良いサービスです

Summary

Let's take a test coverage for better code. Regards the coveralls-perl

13年9月22日日曜日

Page 59: 目指せ、テストカバレッジ100%

まとめ

•より良いコードのためにテストカバレッジをとろう

• coverallsは良いサービスです

•Devel::Cover::Report::Coveralls

Summary

Let's take a test coverage for better code. Regards the coveralls-perl

13年9月22日日曜日

Page 60: 目指せ、テストカバレッジ100%

おまけ

!?

One more things

13年9月22日日曜日

Page 61: 目指せ、テストカバレッジ100%

御清聴ありがとうございましたThank you for your attention

13年9月22日日曜日