<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] ## 概述 go>1.8 官方支持模糊測試 Fuzzing 是一種自動化測試,它不斷地操縱程序的輸入以查找錯誤。Go fuzzing 使用覆蓋率指導來智能地遍歷被模糊測試的代碼,以發現并向用戶報告故障。由于它可以達到人類經常錯過的邊緣情況,因此模糊測試對于發現安全漏洞和漏洞特別有價值 ![](https://img.kancloud.cn/b3/eb/b3eb2511c3e3996368e9e02f6e804b64_1090x408.png) 模糊測試參數只能是以下類型: * `string`,`[]byte` * `int`,`int8`,`int16`,`int32`/`rune`,`int64` * `uint`,`uint8`/`byte`,`uint16`,`uint32`,`uint64` * `float32`,`float64` * `bool` ## 實例 以 xxx_test.go 中添加 fuzzing 測試 ``` func Foo(a int, b string) (string, error) { if b == "a" { return "", errors.New("get error") } return b, nil } func FuzzFoo(f *testing.F) { f.Add(5, "hello") f.Fuzz(func(t *testing.T, i int, s string) { out, err := Foo(i, s) if err != nil && out != "" { t.Errorf("%q,%v", out, err) } }) } ``` 運行 ``` > go test -fuzz=FuzzFoo fuzz: elapsed: 0s, gathering baseline coverage: 0/128 completed fuzz: elapsed: 0s, gathering baseline coverage: 128/128 completed, now fuzzing with 12 workers fuzz: elapsed: 3s, execs: 1239647 (412614/sec), new interesting: 1 (total: 129) fuzz: elapsed: 6s, execs: 2546315 (435266/sec), new interesting: 1 (total: 129) fuzz: elapsed: 9s, execs: 3839784 (431412/sec), new interesting: 1 (total: 129) fuzz: elapsed: 12s, execs: 5107204 (423114/sec), new interesting: 1 (total: 129) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看