forked from googol/benchmark
112 lines
3.0 KiB
JSON
112 lines
3.0 KiB
JSON
"""
|
||
1、整体结构说明
|
||
{
|
||
"project": "project_name",
|
||
"file": "file_path",
|
||
"functions": [
|
||
{
|
||
"id": "function_id",
|
||
"methodname": "function_name",
|
||
"description": "function_description",
|
||
"methodbody": "function_body",
|
||
"deepth": overall_depth,
|
||
"difficulty": "function_difficulty",
|
||
"apis": [ list_of_apis_used_in_function ]
|
||
}
|
||
]
|
||
}
|
||
2、API结构说明
|
||
{
|
||
"apiname": "api_name",
|
||
"library": "library_name",
|
||
"id": "api_id",
|
||
"apisource": "api_source_type", // "custome" or "third_party"
|
||
"parameters": [
|
||
{
|
||
"name": "parameter_name",
|
||
"type": "parameter_type"
|
||
}
|
||
],
|
||
"returns": {
|
||
"name": "return_value_name",
|
||
"type": "return_value_type"
|
||
},
|
||
"deepth": api_depth,
|
||
"para_depend": [ list_of_parameter_dependencies ],
|
||
"chain_depend": [ list_of_chain_dependencies ],
|
||
"apis": [ list_of_nested_apis ]
|
||
}
|
||
3、思考
|
||
a.id应该从深度只有1的自定义函数开始编号,三方包是否需要id待定
|
||
b.deepth的定义:对于整体deepth,个人认为基于max deepth来定义更合理;对于api的deepth,就是这个api调用链的深度
|
||
4、方法
|
||
a、仍然使用jdt解析java代码
|
||
b、筛选:无对应的测试用例
|
||
"""
|
||
{
|
||
"project": "projectA",
|
||
"file": "src/com/example/Example.java",
|
||
"functions": [
|
||
{
|
||
"id": "*****1",
|
||
"methodname": "FunctionA",
|
||
"description": "This function does A",
|
||
"methodbody": "public void FunctionA() { /* ... */ }",
|
||
"deepth": 3, //对于apic来说是3 对于apib是2,maxdeepth来定义整体deepth更合理
|
||
"difficulty": "medium",
|
||
"apis": [
|
||
{
|
||
"apiname": "apiA",
|
||
"library": "",
|
||
"id": "*****2",
|
||
"apisource": "custome",
|
||
"parameters": [
|
||
{
|
||
"name": "param1",
|
||
"type": "String"
|
||
}
|
||
],
|
||
"returns": {
|
||
"name": "returnValue1",
|
||
"type": ""
|
||
},
|
||
"deepth": 2,
|
||
"para_depend": [],
|
||
"chain_depend": [],
|
||
"apis": [
|
||
{
|
||
"apiname": "apiC",
|
||
"library": "org.example",
|
||
"id": "*****4", //三方包是否需要id
|
||
"apisource": "third_party",
|
||
"parameters": [],
|
||
"returns": {
|
||
"name": "returnValue2",
|
||
"type": ""
|
||
},
|
||
"deepth": 1,
|
||
"para_depend": [],
|
||
"chain_depend": [],
|
||
"apis": []
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"apiname": "apiB",
|
||
"library": "org.example",
|
||
"id": "*****3", //三方包是否需要id
|
||
"apisource": "third_party",
|
||
"parameters": [],
|
||
"returns": {
|
||
"name": "returnValue3",
|
||
"type": ""
|
||
},
|
||
"deepth": 1,
|
||
"para_depend": [],
|
||
"chain_depend": [],
|
||
"apis": []
|
||
}
|
||
]
|
||
}
|
||
]
|
||
} |