LoginSignup
0
0

More than 3 years have passed since last update.

xUnit Test Patterns ユニットテストの不吉な臭い

Last updated at Posted at 2018-12-01

はじめに

xUnit Test Patterns: Refactoring Test Codeにあるユニットテストの不吉な臭いから抜粋。

テストコードの不吉な臭い(Code Smells)

  1. 条件付きのテストコード(Conditional Test Logic)
  2. テストを書くのが困難なコード(Hard-to-Test Code)
  3. テストコードの重複(Test Code Duplication)
  4. 製品コードにテストコードがある(Test Logic in Production)

振る舞いの不吉な臭い(Behavior Smells)

  1. アサート文がランダムに実行される(Assertion Roulette)
  2. テストが不規則に実行される(Assertion Roulette)
  3. 壊れやすいテスト(Fragile Test)
  4. 何らかの機会にデバッグが必要。(Frequent Debugging)
  5. テストの実行に手動の介入が必要(Manual Intervention)
  6. 遅いテスト(Slow Tests)

プロジェクトの不吉な臭い(Project Smells)

  1. バグだらけのテスト(Buggy Tests)
  2. 開発者がテストコードを書かない(Developers Not Writing Tests)
  3. テストコードの保守コストが高い(High Test Maintenance Cost)
  4. 製品のバグ(Production Bugs)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0