Mutation Testing Results :: Dead Code + Missing Tests
维护者通常 1 天内回复
@81reap 已经在做这个了。
开始于 2026年9月24日。
评估
这个 Issue 还没有评估数据。
描述
results of running mutation testing on the rust codebase. I ran it over the entire codebase on my Ryzen 7 5800X3D ~3h (09:56 → 13:07). I left it running through the day as I was at work and these are the results.
files
programmatic breakdowns
issues by file
[reap@jager:~/Desktop/SQLPage]$ awk -F: 'FNR==NR{m[$1]++;next}{c[$1]++}
END{for(f in m) printf "%d\t%d\t%d\t%.0f%%\t%s\n", m[f], c[f], m[f]+c[f], 100*m[f]/(m[f]+c[f]), f}' \
mutants.out/{missed,caught}.txt | sort -k1,1rn -k3,3rn
| File | Missed | Caught | Viable | Survival |
|---|---|---|---|---|
telemetry.rs |
52 | 13 | 65 | 80% |
template_helpers.rs |
49 | 26 | 75 | 65% |
render.rs |
29 | 48 | 77 | 38% |
webserver/database/sql/rewrite.rs |
21 | 92 | 113 | 19% |
webserver/database/sql_to_json.rs |
21 | 23 | 44 | 48% |
app_config.rs |
18 | 73 | 91 | 20% |
webserver/oidc.rs |
18 | 54 | 72 | 25% |
filesystem.rs |
18 | 31 | 49 | 37% |
webserver/http.rs |
18 | 26 | 44 | 41% |
webserver/lambda_http.rs |
15 | 3 | 18 | 83% |
webserver/database/mod.rs |
12 | 7 | 19 | 63% |
webserver/database/execute_queries.rs |
10 | 34 | 44 | 23% |
webserver/database/csv_import.rs |
9 | 25 | 34 | 26% |
webserver/database/connect.rs |
9 | 4 | 13 | 69% |
webserver/database/sqlpage_functions/function_traits.rs |
7 | 45 | 52 | 13% |
webserver/database/error_highlighting.rs |
7 | 22 | 29 | 24% |
cli/commands.rs |
6 | 0 | 6 | 100% |
webserver/http_client.rs |
5 | 4 | 9 | 56% |
webserver/database/migrations.rs |
5 | 2 | 7 | 71% |
webserver/server_timing.rs |
4 | 12 | 16 | 25% |
templates.rs |
4 | 7 | 11 | 36% |
webserver/content_security_policy.rs |
4 | 3 | 7 | 57% |
webserver/http_request_info.rs |
3 | 40 | 43 | 7% |
webserver/error.rs |
3 | 16 | 19 | 16% |
file_cache.rs |
3 | 13 | 16 | 19% |
webserver/response_writer.rs |
3 | 4 | 7 | 43% |
webserver/database/sqlpage_functions/functions.rs |
3 | 0 | 3 | 100% |
webserver/database/blob_to_data_url.rs |
2 | 28 | 30 | 7% |
webserver/database/sql.rs |
2 | 16 | 18 | 11% |
webserver/database/sqlpage_functions/http_fetch_request.rs |
2 | 2 | 4 | 50% |
webserver/error_with_status.rs |
2 | 1 | 3 | 67% |
webserver/database/sqlpage_expr.rs |
1 | 16 | 17 | 6% |
webserver/database/sqlpage_functions/url_parameters.rs |
1 | 14 | 15 | 7% |
main.rs |
1 | 5 | 6 | 17% |
webserver/database/sql/statement.rs |
1 | 1 | 2 | 50% |
webserver/http_metrics.rs |
1 | 0 | 1 | 100% |
Files with zero iissues: single_or_vec.rs, dynamic_component.rs, webserver/routing.rs, webserver/request_variables.rs, lib.rs, utils.rs.
issue by group
[reap@jager:~/Desktop/SQLPage]$ jq -r --rawfile missed mutants.out/missed.txt \
--argjson dead '["src/template_helpers.rs:525:9","src/template_helpers.rs:526:13",
"src/webserver/database/mod.rs:76:9","src/webserver/error_with_status.rs:22:9",
"src/webserver/error_with_status.rs:27:24",
"src/webserver/database/sqlpage_functions/url_parameters.rs:132:9"]' \
--argjson harness '["src/telemetry.rs","src/webserver/lambda_http.rs","src/cli/commands.rs","src/main.rs"]' \
--arg dialect 'Mssql|MySql|Postgres|postgres|mssql|mysql|oracle|duckdb|Snowflake|sql server|sql_nonnull_to_json|decode_pg_range|decimal_to_json' '
($missed|split("\n")|map(select(length>0))|INDEX(.)) as $M |
map(select($M[.name])) | map(. as $m | {cat:
if $dead | index($m.name|split(": ")[0]) then "dead-code"
elif $harness | index($m.file) then "harness-gap"
elif $m.name | test($dialect) then "dialect"
else "logic" end})
| group_by(.cat)[] | "\(.[0].cat)\t\(length)"' mutants.out/mutants.json
dead-code 7
dialect 33
harness-gap 74
logic 255
- 主要语言
- Rust
- 星标
- 2.6k
- 派生
- 175
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 43
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sqlpage/SQLPage 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
sqlpage/SQLPage#1218 · 3 条评论 ·
维护者通常 1 天内回复
-
There is no convenient way to reproduce issues可能已有人在做 @81reap 于 26 天前认领。 未关闭enhancement
sqlpage/SQLPage#1566 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Confusing sort interface可能已有人在做 @lovasoa 于 73 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 20/100
sqlpage/SQLPage#1442 · 3 条评论 ·
维护者通常 1 天内回复
-
chart: 3D charts未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
symposium-dev/symposium#530 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
topgrade-rs/topgrade#2540 ·
维护者通常 1 天内回复
-
Invalid JSON options for ngram and edge_ngram silently use defaults可能已有人在做 @Tilendlesa 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
noemaforge/vimanam#153 ·
维护者通常 1 天内回复