MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / find_testbed_program

Function find_testbed_program

src/program/infer/dynamic_infer.rs:277–291  ·  view source on GitHub ↗

Find a program that achieved the most coverage of an API.

(func: &str, deopt: &Deopt)

Source from the content-addressed store, hash-verified

275
276/// Find a program that achieved the most coverage of an API.
277fn find_testbed_program(func: &str, deopt: &Deopt) -> Vec<usize> {
278 let g_cov_map = get_api_cov_map(deopt);
279 let limit = 3;
280 if let Some(vector) = g_cov_map.get(func) {
281 let mut select = vec![];
282 for (i, (_, seed_id)) in vector.iter().enumerate() {
283 if i >= limit {
284 break;
285 }
286 select.push(*seed_id);
287 }
288 return select;
289 }
290 vec![]
291}
292
293fn get_corpora_coverage(
294 fuzzer_code: &Path,

Callers 1

inferFunction · 0.85

Calls 2

get_api_cov_mapFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected