SQLite#39;s test code to production code ratio(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 的测试代码与生产代码的比例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQLite 的测试代码与生产代码的比例
基础教程推荐
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
