go__fuzz_demo/fuzz.mm
2022-02-04 22:07:21 +01:00

167 lines
11 KiB
XML

<map version="freeplane 1.9.8">
<!--To view this file, download free mind mapping software Freeplane from https://www.freeplane.org -->
<node TEXT="Fuzz testing" FOLDED="false" ID="ID_696401721" CREATED="1610381621824" MODIFIED="1644005120089" STYLE="oval">
<font SIZE="18"/>
<hook NAME="MapStyle">
<properties edgeColorConfiguration="#808080ff,#ff0000ff,#0000ffff,#00ff00ff,#ff00ffff,#00ffffff,#7c0000ff,#00007cff,#007c00ff,#7c007cff,#007c7cff,#7c7c00ff" fit_to_viewport="false" associatedTemplateLocation="template:/standard-1.6.mm"/>
<map_styles>
<stylenode LOCALIZED_TEXT="styles.root_node" STYLE="oval" UNIFORM_SHAPE="true" VGAP_QUANTITY="24 pt">
<font SIZE="24"/>
<stylenode LOCALIZED_TEXT="styles.predefined" POSITION="right" STYLE="bubble">
<stylenode LOCALIZED_TEXT="default" ID="ID_271890427" ICON_SIZE="12 pt" COLOR="#000000" STYLE="fork">
<arrowlink SHAPE="CUBIC_CURVE" COLOR="#000000" WIDTH="2" TRANSPARENCY="200" DASH="" FONT_SIZE="9" FONT_FAMILY="SansSerif" DESTINATION="ID_271890427" STARTARROW="DEFAULT" ENDARROW="NONE"/>
<font NAME="SansSerif" SIZE="10" BOLD="false" ITALIC="false"/>
<richcontent CONTENT-TYPE="plain/auto" TYPE="DETAILS"/>
<richcontent TYPE="NOTE" CONTENT-TYPE="plain/auto"/>
</stylenode>
<stylenode LOCALIZED_TEXT="defaultstyle.details"/>
<stylenode LOCALIZED_TEXT="defaultstyle.attributes">
<font SIZE="9"/>
</stylenode>
<stylenode LOCALIZED_TEXT="defaultstyle.note" COLOR="#000000" BACKGROUND_COLOR="#ffffff" TEXT_ALIGN="LEFT"/>
<stylenode LOCALIZED_TEXT="defaultstyle.floating">
<edge STYLE="hide_edge"/>
<cloud COLOR="#f0f0f0" SHAPE="ROUND_RECT"/>
</stylenode>
<stylenode LOCALIZED_TEXT="defaultstyle.selection" BACKGROUND_COLOR="#4e85f8" BORDER_COLOR_LIKE_EDGE="false" BORDER_COLOR="#4e85f8"/>
</stylenode>
<stylenode LOCALIZED_TEXT="styles.user-defined" POSITION="right" STYLE="bubble">
<stylenode LOCALIZED_TEXT="styles.topic" COLOR="#18898b" STYLE="fork">
<font NAME="Liberation Sans" SIZE="10" BOLD="true"/>
</stylenode>
<stylenode LOCALIZED_TEXT="styles.subtopic" COLOR="#cc3300" STYLE="fork">
<font NAME="Liberation Sans" SIZE="10" BOLD="true"/>
</stylenode>
<stylenode LOCALIZED_TEXT="styles.subsubtopic" COLOR="#669900">
<font NAME="Liberation Sans" SIZE="10" BOLD="true"/>
</stylenode>
<stylenode LOCALIZED_TEXT="styles.important" ID="ID_67550811">
<icon BUILTIN="yes"/>
<arrowlink COLOR="#003399" TRANSPARENCY="255" DESTINATION="ID_67550811"/>
</stylenode>
</stylenode>
<stylenode LOCALIZED_TEXT="styles.AutomaticLayout" POSITION="right" STYLE="bubble">
<stylenode LOCALIZED_TEXT="AutomaticLayout.level.root" COLOR="#000000" STYLE="oval" SHAPE_HORIZONTAL_MARGIN="10 pt" SHAPE_VERTICAL_MARGIN="10 pt">
<font SIZE="18"/>
</stylenode>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,1" COLOR="#0033ff">
<font SIZE="16"/>
</stylenode>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,2" COLOR="#00b439">
<font SIZE="14"/>
</stylenode>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,3" COLOR="#990000">
<font SIZE="12"/>
</stylenode>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,4" COLOR="#111111">
<font SIZE="10"/>
</stylenode>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,5"/>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,6"/>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,7"/>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,8"/>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,9"/>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,10"/>
<stylenode LOCALIZED_TEXT="AutomaticLayout.level,11"/>
</stylenode>
</stylenode>
</map_styles>
</hook>
<hook NAME="AutomaticEdgeColor" COUNTER="8" RULE="ON_BRANCH_CREATION"/>
<node TEXT="Stability" POSITION="right" ID="ID_1566955674" CREATED="1644005111575" MODIFIED="1644005113503">
<edge COLOR="#ff0000"/>
<node TEXT="previously expected for 1.17" ID="ID_39363677" CREATED="1644005327589" MODIFIED="1644005333886"/>
<node TEXT=" experimental in Go 1.18" ID="ID_275502674" CREATED="1644005114111" MODIFIED="1644005115679"/>
<node ID="ID_1915016090" CREATED="1644005129871" MODIFIED="1644005129871"><richcontent TYPE="NODE">
<html>
<head>
</head>
<body>
<span charset="utf-8" style="color: rgb(36, 41, 47); font-family: -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji; font-size: 14px; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none"><font color="rgb(36, 41, 47)" face="-apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji" size="14px">l not be covered by the Go 1 compatibility promise</font></span>
</body>
</html>
</richcontent>
</node>
<node TEXT="Excluded in 1.18" ID="ID_1206768362" CREATED="1644005195315" MODIFIED="1644005199651">
<node TEXT="-race" ID="ID_1490916255" CREATED="1644005199987" MODIFIED="1644005204276"/>
<node TEXT="-msan" ID="ID_1666537382" CREATED="1644005204794" MODIFIED="1644005207044"/>
<node TEXT="deduplication of crashes to support -keepfuzzing" ID="ID_594044161" CREATED="1644005217258" MODIFIED="1644005228027"/>
<node TEXT="special options during fuzzing" ID="ID_467939596" CREATED="1644005233705" MODIFIED="1644005238739"/>
<node TEXT="dictionary support" ID="ID_1679946267" CREATED="1644005244273" MODIFIED="1644005246819"/>
<node TEXT="customizable coverage during while" ID="ID_1966016577" CREATED="1644005255800" MODIFIED="1644005267377"/>
<node TEXT="custom generators for the mutator" ID="ID_1835277965" CREATED="1644005296630" MODIFIED="1644005301055"/>
<node TEXT="structured fuzzing for struct and other non-primitive types" ID="ID_1276420749" CREATED="1644005306709" MODIFIED="1644005318406"/>
</node>
<node TEXT="It&apos;s a pseudo-random edge case generator, not a test tool" ID="ID_1252266711" CREATED="1644005880223" MODIFIED="1644005890030"/>
</node>
<node TEXT="New" POSITION="right" ID="ID_53871213" CREATED="1644005143053" MODIFIED="1644005147926">
<edge COLOR="#ff00ff"/>
<node TEXT="in *_test.go files" ID="ID_1820951446" CREATED="1644007729971" MODIFIED="1644007735716"/>
<node TEXT="testing.F" ID="ID_588571184" CREATED="1644005148524" MODIFIED="1644005152815"/>
<node TEXT="go test" ID="ID_1030420523" CREATED="1644005156197" MODIFIED="1644008484121">
<node ID="ID_86941885" CREATED="1644008485020" MODIFIED="1644008485020"><richcontent TYPE="NODE">
<html>
<head>
</head>
<body>
<p>
-fuzz [&lt;regexp&gt;]
</p>
</body>
</html>
</richcontent>
<node TEXT="first run the unit tests, then fuzz" ID="ID_554470978" CREATED="1644008330413" MODIFIED="1644008338511"/>
<node TEXT="ignores -count and -cpu" ID="ID_1446220468" CREATED="1644008612217" MODIFIED="1644008636856"/>
</node>
<node TEXT="-fuzztime t" ID="ID_530752979" CREATED="1644008472286" MODIFIED="1644008477905">
<node TEXT="t is a time.Duration OR &quot;&lt;n&gt;x&quot; to run x times" ID="ID_1881651999" CREATED="1644008501758" MODIFIED="1644008530269"/>
</node>
<node TEXT="-fuzzminimizetime t" ID="ID_741834242" CREATED="1644008542604" MODIFIED="1644008556468">
<node TEXT="same a -fuzztime, default 60s" ID="ID_1792855690" CREATED="1644008581626" MODIFIED="1644008591044"/>
</node>
<node TEXT="not affected by -failfast" ID="ID_895647724" CREATED="1644008740573" MODIFIED="1644008748983"/>
</node>
<node TEXT="FuzzXXX(f testing.F)" ID="ID_147416887" CREATED="1644005163204" MODIFIED="1644005177332"/>
<node TEXT="f.Add(testcase)" ID="ID_1658071340" CREATED="1644008109648" MODIFIED="1644008116760">
<node TEXT="add case to the fuzz corpus" ID="ID_1461934202" CREATED="1644008139526" MODIFIED="1644008147159"/>
</node>
<node TEXT="f.Fuzz(func (t *testing.T, any number of any type of arguments))" ID="ID_15184861" CREATED="1644007194194" MODIFIED="1644007503801">
<node TEXT="Argument types: []byte, string, bool, byte, rune, float32, float64, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64" ID="ID_1888588131" CREATED="1644007372372" MODIFIED="1644007377557"/>
<node TEXT="crashing on a call to that function is a success identifying a bug" ID="ID_1614500493" CREATED="1644007314166" MODIFIED="1644007335477"/>
<node TEXT="function may call f.Failed() and f.Name()" ID="ID_274533165" CREATED="1644007421642" MODIFIED="1644007477449"/>
<node TEXT="function may not call other f.* methods, but t.* methods" ID="ID_130969231" CREATED="1644007478415" MODIFIED="1644007499568"/>
</node>
<node TEXT="returns on failure or -fuzztime reached" ID="ID_1134207496" CREATED="1644007612002" MODIFIED="1644007623201"/>
<node TEXT="testdata/fuzz/ contains successful (crashing) values" ID="ID_59049885" CREATED="1644005480542" MODIFIED="1644008382821"/>
<node TEXT="All f.* methods may be called outside the Fuzz called function" ID="ID_1985936618" CREATED="1644007560139" MODIFIED="1644007587483"/>
<node TEXT="go clean -fuzzcache" ID="ID_740028572" CREATED="1644007939640" MODIFIED="1644007943561"/>
</node>
<node TEXT="General issues" POSITION="left" ID="ID_1779709393" CREATED="1644005364690" MODIFIED="1644005368493">
<edge COLOR="#00ffff"/>
<node TEXT="/does/ find some classes of issues, but" ID="ID_800714167" CREATED="1644005397050" MODIFIED="1644005405531"/>
<node TEXT="CPU+storage cost" ID="ID_1964129434" CREATED="1644005369579" MODIFIED="1644005381123"/>
<node TEXT="cost/benefit ratio unclear" ID="ID_1875709238" CREATED="1644005385330" MODIFIED="1644005389547"/>
<node TEXT="bugs found tend to be marginal cases, often leading to exploits" ID="ID_1520165036" CREATED="1644005713868" MODIFIED="1644005726333"/>
</node>
<node TEXT="Usage" POSITION="left" ID="ID_1528177694" CREATED="1644005501477" MODIFIED="1644005502901">
<edge COLOR="#00007c"/>
<node TEXT="Provide an initial corpus (optional)" ID="ID_977300777" CREATED="1644005503701" MODIFIED="1644005511838"/>
<node TEXT="Run for &quot;some time&quot;" ID="ID_984966560" CREATED="1644005512716" MODIFIED="1644005825067"/>
<node TEXT="When crashes are found, keep them" ID="ID_1143685132" CREATED="1644005534195" MODIFIED="1644005544619"/>
<node TEXT="Create non-regression/unit test for found crashes" ID="ID_202223825" CREATED="1644005545667" MODIFIED="1644005563868"/>
<node TEXT="Do NOT run it on all builds" ID="ID_1250193109" CREATED="1644005649358" MODIFIED="1644005654799">
<node TEXT="It&apos;s a development tool" ID="ID_948176831" CREATED="1644005749138" MODIFIED="1644005752626"/>
<node TEXT="Not a build/security checking tool" ID="ID_257905500" CREATED="1644005753249" MODIFIED="1644005768420"/>
</node>
<node TEXT="When rebuilding, reuse the locally cached corpus and restart at first step" ID="ID_264628874" CREATED="1644005787546" MODIFIED="1644005805546"/>
<node TEXT="Summary: go test -fuzz → crash found → go test FAIL → write fix → go test PASS&quot; cycle" ID="ID_1374287264" CREATED="1644007841612" MODIFIED="1644007843966"/>
</node>
</node>
</map>