作者:傻傻的不敢看结5_749 | 来源:互联网 | 2023-05-17 22:26
Recently,IvestartedtoworkingonEmail2SMSfeatureinourproduct.WhenIjoinedtheprojectthi
Recently, I've started to working on Email2SMS feature in our product. When I joined the project this component had zero code coverage by unit-tests. Legacy code.
最近,我开始在我们的产品中使用Email2SMS功能。当我加入项目时,这个组件的单元测试代码覆盖率为零。遗留代码。
Since I started to working on it, I was using test-first approach. But code quality was very low. It was very hard to split it and tests small chunks by unit-tests, so I decided to write integration test.
自从我开始研究它以来,我一直在使用测试优先方法。但代码质量非常低。拆分它并通过单元测试测试小块是非常困难的,所以我决定编写集成测试。
There is php script, which accepts some message info, search for user in DB and save some info if everything is OK.
有php脚本,它接受一些消息信息,在DB中搜索用户并保存一些信息,如果一切正常。
$last_line = system('php emailtosms.php -file=unicode_message.txt ', $retval);
$this->assertStringExistsInLogFile('Email to SMS message was not sent');
Is it bad or not? How would you solve this problem?
这不好吗?你怎么解决这个问题?
1 个解决方案