Re:Ask HN: What's the largest amount of bad code you have ev...
by srkigo on Wednesday November 14, 2018 @04:19PM
(#18454061)
How can it have millions of tests with 25 million lines of code? How many lines of code is there including the code in the tests?
[ Parent
| on HN ]
Re:Ask HN: What's the largest amount of bad code you have ev...
by eigenspace on Wednesday November 14, 2018 @04:27PM
(#18454137)
You can have automated test generation. I'd imagine with a database system, you'd have a big list of possible ingredients to a query and then go thorugh a series of nested for loops to concatenate them together and make sure each permutation works separately. That can easily make for thousands of tests with only a few lines of code.
Re:Ask HN: What's the largest amount of bad code you have ev...
by pkroll on Wednesday November 14, 2018 @04:36PM
(#18454223)
Along with what eigenspace said, check out SQLite's Testing page: https://www.sqlite.org/testing.html (the project has 711 times as much test code and scripts, as code). You can go really far... and still miss things on occasion.
Re:Ask HN: What's the largest amount of bad code you have ev...
by oraguy on Wednesday November 14, 2018 @08:29PM
(#18456117)
The 25 million lines of code is only the source code of Oracle Database written in C.
The test cases are written in a domain specific language named OraTst which is developed and maintained only within Oracle. OraTst is not available outside Oracle. The OraTst DSL looks like a mixture of special syntax to restart database, compare results of queries, change data configuration, etc. and embedded SQL queries to populate database and retrieve results.
I don't know how many more millions of lines of code the tests add. Assuming every test takes about 25 lines of code on an average (every test used to consume about half of my screen to a full screen), we can estimate that the tests themselves consume close to another additional 25 million lines of code to 50 million lines of code.