Mutation Testing Results :: Dead Code + Missing Tests

Đang mở
#1,396 5 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@81reap đang làm issue này rồi.

Từ ngày 24/9/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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
Ngôn ngữ chính
Rust
Star
2.6k
Fork
175
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sqlpage/SQLPage

Tất cả issue của sqlpage/SQLPage

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.