Coverage percentages can be floored one hundredth too low

オープン 初心者向け
#98 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
testing-qa

調査の方向性

まず effective_coverage.floor_two_decimals を読み、カバーされた行数と総行数をどのように受け取るかを追ってください。生のパーセンテージと実効パーセンテージの計算に関するテストを確認し、次に1万行中29行のケースを追加してください。レポート、サマリー、HTMLインデックス、実効ゲートのパーセンテージが、正確に切り捨てられた値を使うようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Found while reviewing the user manual against the implementation at fe013fe.

effective_coverage.floor_two_decimals computes math.floor(value * 100.0) / 100.0 on a float. For some exact ratios the binary representation is slightly below the decimal value, and the result is one hundredth too low.

Reproduction
>>> import math
>>> math.floor(100.0 * 29 / 10000 * 100.0) / 100.0
0.28

29 of 10,000 lines is exactly 0.29 %.

Effect

Raw and effective percentages in report.json, the summary and the HTML index can be 0.01 lower than the exact value. Together with #17 this also affects the effective gate. The error is towards under-reporting.

Expected behavior

Floor with integer arithmetic on covered and total counts, for example (10000 * covered // total) / 100.

主要言語
Python
スター
0
フォーク
4
平均マージ
1日 16時間
マージ済み PR(30日)
16

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-score/coverage_tool のほかの issue

eclipse-score/coverage_tool の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。