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 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 无法解决整理冲突 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
