¡Ö¥³¡¼¥É¤ËÁá¤Þ¤Ã¤ÆDRY¸¶Â§¤òŬÍѤ·¤Ê¤¤¤³¤È¡×¤ÈGoogle¤¬¸Æ¤Ó¤«¤±
Google¤Ë¸ºß¤¹¤ë¥³¡¼¥É¤òÆɤߤ䤹¤¯Êݼ餷¤ä¤¹¤¤·Á¤ËÊݤļè¤êÁȤߤò¹Ô¤¦¥°¥ë¡¼¥×¡ÖCode Health¡×¤¬¡¢¡ÖDRY¤òÁá¤Þ¤Ã¤ÆŬÍѤ·¤Ê¤¤¤³¤È¡×¤ÈÂꤷ¤¿µ»ö¤ò¸ø³«¤·¤Þ¤·¤¿¡£
Google Testing Blog: Don't DRY Your Code Prematurely
https://testing.googleblog.com/2024/05/dont-dry-your-code-prematurely.html
DRY¤Ï¡ÖDon't Repeat Yourself¡×¤Îά¾Î¤Ç¡¢¥³¡¼¥É¤ò½ÅÊ£¤µ¤»¤Ê¤¤¤³¤È¤ò½Å»ë¤¹¤ë¹Í¤¨Êý¤Ç¤¹¡£½ÅÊ£¤¹¤ë¥³¡¼¥É¤¬Â¸ºß¤·¤Æ¤¤¤ë¤È¡¢ÆÃÄê¤Îµ¡Ç½¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿»þ¤ËƱ¤¸µ¡Ç½¤ò»ý¤ÄÉôʬ¤òÁ´¤Æõ¤·¤ÆƱ»þ¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¡¢¸«Íî¤È¤·¤ä¥ß¥¹¤¬È¯À¸¤¹¤ë´í¸±À¤¬¹â¤Þ¤ê¤Þ¤¹¡£°ìÊý¡¢¥³¡¼¥É¤Î½ÅÊ£¤òËɤ²¤Æ¤¤¤ì¤Ð°ì¥«½ê¤À¤±¤òÊѹ¹¤¹¤ì¤ÐOK¤È¤¤¤¦¤ï¤±¡£
°ì¸«DRY¤ò¸·¤·¤¯Å¬ÍѤ¹¤ë¤È¥³¡¼¥É¤ÎÊݼéÀ¤¬¸þ¾å¤·¤ÆÎɤµ¤½¤¦¤Ë¸«¤¨¤Þ¤¹¤¬¡¢Google¤ÎCode Health¥°¥ë¡¼¥×¤Ï¥Ö¥í¥°¤Ë¡ÖDRY¸¶Â§¤ÎŬÍѤò¸·³Ê¤Ë¤·¤¹¤®¤ë¤ÈÃê¾Ý²½¤¬Áá¤Þ¤Ã¤Æ¤·¤Þ¤¤¡¢¾Íè¤ÎÊѹ¹¤¬É¬Íװʾå¤ËÊ£»¨¤Ë¤Ê¤ë¡×¤È»þ´ü¾°Áá¤ÊDRY¤ÎŬÍѤòÈò¤±¤ë¤Ù¤¤È½Ò¤Ù¤Þ¤·¤¿¡£
Î㤨¤Ð²¼µ¤Îº¸Â¦¤ÏDRY¤Ë±è¤Ã¤Æ¡Ödeadline¤ÎȽÄê¡×¤ò°ì¤Ä¤Î´Ø¿ô¤Ë¤Þ¤È¤á¤¿¥³¡¼¥É¤Ç¡¢±¦Â¦¤ÏDRY¤ËÈ¿¤·¤ÆÆó¤Ä¤Ëʬ¤«¤ì¤Æ¤¤¤ë¥³¡¼¥É¤Ç¤¹¡£¡ÖValueError¡×¤Î¥Á¥§¥Ã¥¯ÆâÍƤ¬Æ±°ì¤Ç¤¢¤ê¡¢¸½»þÅÀ¤Ç¤ÏDRY¤¬Å¬ÍѤǤ¤Æ¤·¤Þ¤¦¤â¤Î¤Î¡¢Code Health¥°¥ë¡¼¥×¤Ï¡Ö¥¿¥¹¥¯¤È»Ùʧ¤¤¤ÎÄù¤áÀÚ¤ê¤Ï°Û¤Ê¤ë¥í¥¸¥Ã¥¯¤ò»ý¤Ä°Û¤Ê¤ë³µÇ°¤Ç¡¢¶öÁ³¥Á¥§¥Ã¥¯ÆâÍƤ¬Æ±°ì¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤À¤±¡×¤È¤·¤ÆDRY¤òŬÍѤ¹¤Ù¤¤Ç¤Ê¤¤¤È¤·¤Æ¤¤¤Þ¤¹¡£
¼ÂºÝ¡¢»Ùʧ¤¤¤Ë´Ø¤·¤ÆÄɲäθ¡¾Ú¤¬É¬Íפˤʤ俾ì¹ç¡¢±¦Â¦¤Î¥³¡¼¥É¤Ç¤¢¤ì¤Ð´Êñ¤Ë¸¡¾Ú¤òÄɲäǤ¤Þ¤¹¤¬¡¢º¸Â¦¤Î¥³¡¼¥É¤Ë¡Ö»Ùʧ¤¤¤Ë´Ø¤¹¤ëÄɲäθ¡¾Ú¡×¤òƳÆþ¤¹¤ë¤Î¤ÏÈó¾ï¤ËÆñ¤·¤¤¤â¤Î¡£¡Ö¥³¡¼¥É¤¬ËÜÅö¤Ë¾éĹ¤Ê¤Î¤«¡¢¤½¤ì¤È¤âɽÌÌŪ¤Ë»÷¤Æ¤¤¤ë¤À¤±¤Ê¤Î¤«¤ò¿µ½Å¤Ë¸¡Æ¤¤¹¤ëɬÍפ¬¤¢¤ë¡×¤È½Ò¤Ù¤é¤ì¤Æ¤¤¤Þ¤¹¡£
¥³¡¼¥É¤ÎÍ×·ï¤Ï»þ´Ö¤È¤È¤â¤ËÊѲ½¤¹¤ë¤³¤È¤¬Â¿¤¤¤¿¤á¡¢³«È¯¤Î½é´üÃʳ¬¤ä¾®µ¬ÌϤʳ«È¯¤Ç¤Ï¿¾¯¤Î½ÅÊ£¤òµöÍƤ·¤Æ¤ª¤¡¢DRY¤òŬÍѤ¹¤ë¤Ù¤¤À¤È¤Ï¤Ã¤¤êȽÊ̤Ǥ¤ë½½Ê¬¤Ê¶¦Ḁ̈ѥ¿¡¼¥ó¤¬½Ð¸½¤·¤Æ¤«¤éÃê¾Ý²½¤ò»Ï¤á¤ëÊý¤¬³«È¯¤ò´Êñ¤Ë¿Ê¤á¤é¤ì¤ë¤È¤Î¤³¤È¤Ç¤¹¡£