SQLite 的测试代码与生产代码的比例 [英] SQLite's test code to production code ratio

查看:33
本文介绍了SQLite 的测试代码与生产代码的比例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQLite 声称测试代码是生产代码的 679 倍.http://www.sqlite.org/testing.html

SQLite claim to have 679 times more test code than production one. http://www.sqlite.org/testing.html

有谁知道这怎么可能?他们会自动生成任何测试代码吗?这些45678.3 KSLOC"测试代码的主要部分是什么?

Does anyone knows how it is possible? Do they generate any test code automatically? What are the major parts of these "45678.3 KSLOC" of test code?

推荐答案

有人知道怎么可能吗?"

"Does anyone knows how it is possible?"

有可能"拥有 679 倍的测试代码,因为一个功能可以以多种不同的方式使用.只考虑一个带有两个参数的函数.我可以为一个测试边界条件和许多其他条件组合的函数生成大量测试代码.当您考虑测试的设置/拆卸时,那里有额外的代码.根据他们的测试框架,这种开销可能会显着增加测试中的代码量.

"It is possible" to have 679 times as much test code because a single feature can be used in many different ways. Consider just a single function that takes two parameters. I can generate alot of test code for that one function that tests boundary conditions and many other combinations of conditions. When you consider setup/teardown of the tests, there is additional code there. Depending on their testing framework this overhead may significantly add to the amount of code in testing.

真正归结为一个软件可以以多种不同方式使用这一事实,这意味着您有许多不同的场景要测试.这就是优雅的软件,因为一个简单的程序可以应用于多种场景,但这也是使验证和测试软件如此具有挑战性的原因.

What it really boils down to is the fact the a piece of software can be used in so many different ways, which means that you have many different scenarios to test for. This is the beauty of elegant software, in that a simple program can be applied to numerous scenarios, but that is the same thing that makes verifying and testing software so challenging.

这篇关于SQLite 的测试代码与生产代码的比例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆