<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nmtysh</author_name>
  <author_url>https://blog.hatena.ne.jp/nmtysh/</author_url>
  <blog_title>nmtysh.log</blog_title>
  <blog_url>https://nmtysh.hatenablog.com/</blog_url>
  <categories>
    <anon>PHP</anon>
    <anon>プログラミング</anon>
    <anon>テスト</anon>
  </categories>
  <description>関数のテストコードを書くときに、幾つものパターンをどうまとめるのが一番良いのか悩んでいます。 単純なパターンであれば、それぞれの入力値、期待する出力値を配列にまとめることでfor文(foreach文)で回してテストコードをコンパクトにすることができます。 テストコード自体よりもテストパターンが重要だと思うので、それぞれが「どういったテストなのか」「他のパターンとはどこがちがうのか」が分り易くないとダメだと思っています。 これが複雑な幾つかのパラメータを受け取るような関数だと、そのテストパターンをわかりやすく書くのが難しいです。 「テストしたい関数を実行して、その戻り値をチェックする」という部分…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnmtysh.hatenablog.com%2Fentry%2F2016%2F02%2F23%2F235621&quot; title=&quot;テストパターンを上手くまとめられるようになりたい - nmtysh.log&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>2016-02-23 23:56:21</published>
  <title>テストパターンを上手くまとめられるようになりたい</title>
  <type>rich</type>
  <url>https://nmtysh.hatenablog.com/entry/2016/02/23/235621</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
