应该测试 tdd 的静态文本,例如电子邮件主题?
should test static text for tdd for example email subject?
我不确定是否应该测试 TDD 的静态文本,例如电子邮件主题
例如我有下一段代码是否需要添加测试以包含正确的主题?或适当的 "from" 参数?
def send_mail_complete_sectors_and_profile():
agents = Agents.objects.filter(
Q(is_completed_profile=False) |
Q(has_sectors_config=False)
)
agent_emails = map(lambda a: a.email1, agents)
send_mail('', '', '', agent_emails);
Kent Beck, 2008
I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence
def send_mail_complete_sectors_and_profile():
agents = Agents.objects.filter(
Q(is_completed_profile=False) |
Q(has_sectors_config=False)
)
agent_emails = map(lambda a: a.email1, agents)
send_mail('', '', '', agent_emails);
i have the next piece of code is necessary add a test for including proper subject? or proper "from" param?
在这种情况下,"yes, you should probably do that"。
编写测试的动机是改进您的设计。特别是,您希望最终将核心逻辑和副作用完全分离。如果您不熟悉这些概念,请参阅 Gary Bernhardt 的 sceen cast, or a recording of his excellent talk Boundaries。
测试优先(tdd 的一个重要元素)的承诺是我们通过首先探索确定性逻辑来更好地理解边界和核心。
我不确定是否应该测试 TDD 的静态文本,例如电子邮件主题
例如我有下一段代码是否需要添加测试以包含正确的主题?或适当的 "from" 参数?
def send_mail_complete_sectors_and_profile():
agents = Agents.objects.filter(
Q(is_completed_profile=False) |
Q(has_sectors_config=False)
)
agent_emails = map(lambda a: a.email1, agents)
send_mail('', '', '', agent_emails);
Kent Beck, 2008
I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence
def send_mail_complete_sectors_and_profile():
agents = Agents.objects.filter(
Q(is_completed_profile=False) |
Q(has_sectors_config=False)
)
agent_emails = map(lambda a: a.email1, agents)
send_mail('', '', '', agent_emails);
i have the next piece of code is necessary add a test for including proper subject? or proper "from" param?
在这种情况下,"yes, you should probably do that"。
编写测试的动机是改进您的设计。特别是,您希望最终将核心逻辑和副作用完全分离。如果您不熟悉这些概念,请参阅 Gary Bernhardt 的 sceen cast, or a recording of his excellent talk Boundaries。
测试优先(tdd 的一个重要元素)的承诺是我们通过首先探索确定性逻辑来更好地理解边界和核心。