开发者

What are the advantages of doing unit testing over plain "assertions"?

开发者 https://www.devze.com 2023-01-13 05:49 出处:网络
I am currently building an application with one of the models be开发者_Go百科ing fairly complex. I am currently using assertions

I am currently building an application with one of the models be开发者_Go百科ing fairly complex. I am currently using assertions

raise "error message" if "settings failed"

question is - what are the advantages of using the Unit:testing frameworks over these assertions?


One of the biggest advantages is that unit tests can be automated. You can run all your unit tests after every build, and you immediately find problems. With assertions, bugs might hang around for weeks (or more) before someone happens to exercise that portion of the code.

0

精彩评论

暂无评论...
验证码 换一张
取 消