<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yuta-nakata</author_name>
  <author_url>https://blog.hatena.ne.jp/yuta-nakata/</author_url>
  <blog_title>Yuta NakataのBlog</blog_title>
  <blog_url>https://www.yuta-nakata.net/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>「テストコードを書いてください」と言われたとき、何をテストすればいいのか。具体的な関数を1つ題材に、テストケースの洗い出し方を整理します。 背景 テストの種類 具体例 テストケースを洗い出す4つの観点 境界値は「n-1, n, n+1」で機械的に出す テストを書くと、仕様の曖昧さが出てくる 穴1：戻り値の型が約束を守っていない 穴2：Exception を投げると、テストがザルになる 穴3：関数名と実装が合っていない テストコードの書き方を整える 1テストに詰め込まない 同じ形のassertはparametrizeに寄せる カバレッジで「網羅できたか」を数字にする テストケースの洗い出しチェッ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yuta-nakata.net%2Fentry%2F2024%2F07%2F25%2F220545&quot; title=&quot;pytestで考えるテストケース - Yuta NakataのBlog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-07-25 22:05:45</published>
  <title>pytestで考えるテストケース</title>
  <type>rich</type>
  <url>https://www.yuta-nakata.net/entry/2024/07/25/220545</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
