SQLite 的测试代码与生产代码的比例

SQLite#39;s test code to production code ratio(SQLite 的测试代码与生产代码的比例)
本文介绍了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 的测试代码与生产代码的比例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)