Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
328 commits
Select commit Hold shift + click to select a range
e5ebc93
feat: calculate LOC
eteRnaL198 Aug 24, 2025
c9306e8
feat: add Parser interface
eteRnaL198 Aug 27, 2025
9a36bbf
experiment
eteRnaL198 Aug 28, 2025
efe1a33
feat: enable to add inner class for java
eteRnaL198 Sep 7, 2025
98f8c62
rename experiment-for-kyutech to experiment
eteRnaL198 Oct 10, 2025
8f34d29
rename experiment to evaluation
eteRnaL198 Oct 10, 2025
5bca1ce
feat: set language
eteRnaL198 Oct 10, 2025
e415b36
chore: move file
eteRnaL198 Oct 10, 2025
598bc08
evaluate
eteRnaL198 Oct 11, 2025
a99f019
refactor evaluation
eteRnaL198 Oct 11, 2025
15cc09f
feat: add evaluation tool
eteRnaL198 Oct 14, 2025
a026410
Refactor test for CommitUrl extraction
eteRnaL198 Oct 14, 2025
ff50dd1
fix: add ) to standard description for csv method
eteRnaL198 Oct 14, 2025
b8cd381
feat: parse generics
eteRnaL198 Oct 15, 2025
ee36d16
fix: improve warning message for undetermined parameter types
eteRnaL198 Oct 15, 2025
f959b0c
chore: debug
eteRnaL198 Oct 15, 2025
4af1ab1
fix: skip comments in parameter extraction
eteRnaL198 Oct 15, 2025
4c38824
feat: remove generics<> in params for parsing
eteRnaL198 Oct 15, 2025
269af26
refactor: parse extend interfaces
eteRnaL198 Oct 15, 2025
71aa42b
fix: set constructor name as new
eteRnaL198 Oct 15, 2025
2136c4f
feat: evaluation calculator
eteRnaL198 Oct 15, 2025
9df0f10
for debug
eteRnaL198 Oct 15, 2025
aff324c
debug test
eteRnaL198 Oct 15, 2025
01801cd
luncher
eteRnaL198 Oct 15, 2025
5a3fed9
refactor: evaluation script
eteRnaL198 Oct 17, 2025
56c328f
chore: delete csv file
eteRnaL198 Oct 17, 2025
af5bffc
chore: delte txt file
eteRnaL198 Oct 17, 2025
1e0c261
chore: add oracle
eteRnaL198 Oct 17, 2025
80d4da4
chore: delete file
eteRnaL198 Oct 17, 2025
015fc51
chore: update Java VM arguments to increase maximum heap size
eteRnaL198 Oct 17, 2025
5446ff4
chore: delte files
eteRnaL198 Oct 17, 2025
be07688
add current best java evaluation data
eteRnaL198 Oct 19, 2025
4859941
chores: investigation
eteRnaL198 Oct 21, 2025
67f7f05
fix: make Language enum public for accessibility
eteRnaL198 Oct 21, 2025
27f2ef4
refactor: evaluation
eteRnaL198 Oct 21, 2025
aa7a060
refactor: evaluation debugger
eteRnaL198 Oct 21, 2025
91cd88f
chore: move c test files
eteRnaL198 Oct 21, 2025
3916a98
feat: improve comprehensiveness of c parser based on original c plugi…
eteRnaL198 Oct 26, 2025
bbc4fd2
chore: plugin maker
eteRnaL198 Oct 26, 2025
07c2680
chore: rename test file names
eteRnaL198 Oct 26, 2025
7baba2c
chore: rename
eteRnaL198 Oct 26, 2025
9759c96
chore: modify java test
eteRnaL198 Oct 26, 2025
4cea020
chore: modify test path
eteRnaL198 Oct 26, 2025
509fc40
rename csv
eteRnaL198 Nov 3, 2025
ac29489
refactor: tokenizer
eteRnaL198 Nov 10, 2025
ca52888
refactor: extract getNodeText util
eteRnaL198 Nov 11, 2025
64f8fe0
refactor: improve memory management
eteRnaL198 Nov 12, 2025
0b29ed8
investigation
eteRnaL198 Nov 12, 2025
10afbf7
refactor: call graph
eteRnaL198 Nov 15, 2025
9df39be
evaluation calculator
eteRnaL198 Nov 16, 2025
c782399
evaluation calculator result
eteRnaL198 Nov 16, 2025
3640e2d
add oracle
eteRnaL198 Nov 16, 2025
550d51a
detection result
eteRnaL198 Nov 16, 2025
2824f66
evaluation
eteRnaL198 Nov 16, 2025
6cda05a
investigation
eteRnaL198 Nov 16, 2025
026fc37
java test
eteRnaL198 Nov 16, 2025
6f2b794
java test
eteRnaL198 Nov 16, 2025
c6b228e
refactor java:
eteRnaL198 Nov 16, 2025
f113439
refactor language enum
eteRnaL198 Dec 2, 2025
0490bbb
rename plugin-maker to plugin-generator
eteRnaL198 Dec 5, 2025
e403985
refactor refdiff universal
eteRnaL198 Dec 5, 2025
83a74bd
refactor refdiff example
eteRnaL198 Dec 5, 2025
d8466f8
fix initialize cst root every time parse is called
eteRnaL198 Dec 5, 2025
449a45d
refactor: make php plugin extends base plugin
eteRnaL198 Dec 6, 2025
c3a82c1
refactor: c plugin extends base plugin
eteRnaL198 Dec 7, 2025
c16cde0
refactor: replace unused variable names with more descriptive identif…
eteRnaL198 Dec 7, 2025
201d621
investigation
eteRnaL198 Dec 7, 2025
359193b
add description format to core
eteRnaL198 Dec 7, 2025
20c9149
refactor: update test dependencies to JUnit 5 and enhance test loggin…
eteRnaL198 Dec 7, 2025
3ad0b1f
refactor: remove unused import in BasePlugin and enhance file filter …
eteRnaL198 Dec 7, 2025
699836e
evaluation
eteRnaL198 Dec 7, 2025
65f0144
current
eteRnaL198 Dec 7, 2025
b0bd16e
refactor: clean up unused imports in Debugger class
eteRnaL198 Dec 7, 2025
f544a81
refactor: remove unused imports and clean up test files
eteRnaL198 Dec 7, 2025
bb0174d
add calculation for investigation
eteRnaL198 Dec 7, 2025
76995f7
investigate java
eteRnaL198 Dec 7, 2025
32db478
add repo
eteRnaL198 Dec 7, 2025
9b1da57
Merge branch 'master' into investigate-on-thor
eteRnaL198 Dec 7, 2025
911e4ae
investigation
eteRnaL198 Dec 7, 2025
d584aa6
repoconfig
eteRnaL198 Dec 7, 2025
4061634
Merge branch 'investigate-on-thor'
eteRnaL198 Dec 10, 2025
4529abd
refactor js plugin to extend base plugin
eteRnaL198 Dec 10, 2025
f34bd42
refactor rename parser to plugin
eteRnaL198 Dec 10, 2025
7e2657f
refactor js plugin to use treesitterquery
eteRnaL198 Dec 10, 2025
102abd1
refactor to import junit jupiter test
eteRnaL198 Dec 10, 2025
75f6fdf
refactor: update lambda parameters to improve readability
eteRnaL198 Dec 11, 2025
41f8e6b
refactor js plugin
eteRnaL198 Dec 15, 2025
518afd6
refactor addNodeToParent
eteRnaL198 Dec 15, 2025
08550c3
refactor go plugin
eteRnaL198 Dec 15, 2025
c404063
fix: generateLocation
eteRnaL198 Dec 21, 2025
62edd4e
refactor investigation
eteRnaL198 Dec 21, 2025
9418109
plugin generator
eteRnaL198 Dec 21, 2025
a4e1532
move csv file
eteRnaL198 Dec 21, 2025
6901b5f
mv go result
eteRnaL198 Dec 21, 2025
c3bee05
mv java result
eteRnaL198 Dec 21, 2025
e3206b1
mv js result
eteRnaL198 Dec 21, 2025
c2d66bf
mv php result
eteRnaL198 Dec 21, 2025
1ee22b4
mv python result
eteRnaL198 Dec 21, 2025
0b33ee1
mv ruby result
eteRnaL198 Dec 21, 2025
a3dcae7
rm csv file
eteRnaL198 Dec 21, 2025
2b47d58
rm csv file
eteRnaL198 Dec 21, 2025
9cc9476
rm csv file
eteRnaL198 Dec 21, 2025
c61177d
rm csv file
eteRnaL198 Dec 21, 2025
fc7611c
rm csv file
eteRnaL198 Dec 21, 2025
63fafc5
csv file
eteRnaL198 Dec 21, 2025
daa1f44
refactor investigation
eteRnaL198 Dec 21, 2025
1e56932
add JSON dependency and refactor TsParser to use namespace
eteRnaL198 Dec 21, 2025
15c5938
mv borges
eteRnaL198 Dec 21, 2025
d3c26b9
add result
eteRnaL198 Dec 21, 2025
a445d5d
refactor investigation
eteRnaL198 Dec 21, 2025
6751561
Merge branch 'master' into investigate-on-thor
eteRnaL198 Dec 21, 2025
b0e1254
update repo
eteRnaL198 Dec 21, 2025
0e5e256
add log
eteRnaL198 Dec 21, 2025
50e618f
refactor investigation
eteRnaL198 Dec 21, 2025
bb4ec79
update JVM arguments for increased memory allocation
eteRnaL198 Dec 21, 2025
494dacc
reset commit count before processing commits
eteRnaL198 Dec 21, 2025
f46dccb
remove debug print statement from buildCst method
eteRnaL198 Dec 21, 2025
bd2e443
add investigation result for python
eteRnaL198 Dec 21, 2025
1b6b4cb
add investigation result for php
eteRnaL198 Dec 21, 2025
65e0c43
rename file
eteRnaL198 Dec 21, 2025
bd8f6d9
add investigation result for ruby
eteRnaL198 Dec 21, 2025
744409f
Merge branch 'investigate-on-thor'
eteRnaL198 Dec 21, 2025
9c36281
add investigation result for c
eteRnaL198 Dec 21, 2025
f549d77
Merge branch 'investigate-on-thor'
eteRnaL198 Dec 21, 2025
6004df8
add investigation result for go
eteRnaL198 Dec 21, 2025
9a74d07
add investigation result for js
eteRnaL198 Dec 21, 2025
001dc0a
Merge branch 'investigate-on-thor'
eteRnaL198 Dec 21, 2025
968aa9d
feat resume investigation
eteRnaL198 Dec 21, 2025
3b05a68
feat: add validation framework for multiple programming languages
eteRnaL198 Jan 8, 2026
9eea792
plugin valiadtor
eteRnaL198 Jan 8, 2026
d6fd1cb
mv template
eteRnaL198 Jan 8, 2026
f469ec0
refactor: clean up commented code for clipping BeforeLOC
eteRnaL198 Jan 8, 2026
bab11d4
feat: add clone script for repository management
eteRnaL198 Jan 8, 2026
060ca90
fix: add missing newline at end of .gitignore
eteRnaL198 Jan 8, 2026
76d546f
fix: handle exceptions in parameter extraction and improve logging
eteRnaL198 Jan 8, 2026
e91fd95
fix: update JUnit dependencies to version 5.10.0 and clean up Jackson…
eteRnaL198 Jan 8, 2026
f21c9a2
Refactor code structure for improved readability and maintainability
eteRnaL198 Jan 8, 2026
a068237
investigation
eteRnaL198 Jan 12, 2026
acb3e05
investigation
eteRnaL198 Jan 12, 2026
fc56c45
fix lang
eteRnaL198 Jan 12, 2026
6fec8b9
fix script
eteRnaL198 Jan 12, 2026
837fb5e
script
eteRnaL198 Jan 12, 2026
84dbd0a
chore
eteRnaL198 Jan 12, 2026
aef237e
fix investigation
eteRnaL198 Jan 13, 2026
ed7b220
inv
eteRnaL198 Jan 13, 2026
a2ac35f
investigation
eteRnaL198 Jan 13, 2026
42e5d3f
refactor
eteRnaL198 Jan 14, 2026
0360411
chore
eteRnaL198 Jan 14, 2026
dc0f12a
chore
eteRnaL198 Jan 14, 2026
6a300b8
improve js
eteRnaL198 Jan 14, 2026
3774c72
improve js parser
eteRnaL198 Jan 14, 2026
f2f4090
improve js
eteRnaL198 Jan 14, 2026
dee298a
improve js
eteRnaL198 Jan 15, 2026
5985a0d
improve js
eteRnaL198 Jan 15, 2026
0c711f3
js validation
eteRnaL198 Jan 15, 2026
3546376
make module export and export equal
eteRnaL198 Jan 15, 2026
b229e48
improve js one param
eteRnaL198 Jan 15, 2026
8199770
fix js test
eteRnaL198 Jan 15, 2026
c6999ca
improve js
eteRnaL198 Jan 15, 2026
b554b1f
complete js improvement
eteRnaL198 Jan 18, 2026
15457a1
lang validation
eteRnaL198 Jan 18, 2026
c546a52
script
eteRnaL198 Jan 18, 2026
a3f216d
Enhance parser functionality and add validation tests
eteRnaL198 Jan 19, 2026
44a89c3
Add parse failure tracking to CstRoot and enhance Location constructor
eteRnaL198 Jan 19, 2026
5f1c798
php test
eteRnaL198 Jan 19, 2026
ae77aec
Refactor package declarations and enhance expected node details in tests
eteRnaL198 Jan 19, 2026
dcfcb38
Remove debug print statement for function detection in JsPlugin
eteRnaL198 Jan 19, 2026
6ea7055
Add namespace suffix in GoParser's buildCst method
eteRnaL198 Jan 19, 2026
c5453d9
refactor investigation
eteRnaL198 Jan 19, 2026
944b187
inv
eteRnaL198 Jan 19, 2026
91779af
refactor investigation
eteRnaL198 Jan 19, 2026
d69a45f
chore
eteRnaL198 Jan 19, 2026
3ba16d0
chore investigation
eteRnaL198 Jan 21, 2026
746c1a8
fix
eteRnaL198 Jan 21, 2026
fd3b1ce
evaluation
eteRnaL198 Jan 21, 2026
dd39053
inv
eteRnaL198 Jan 21, 2026
3971d75
chore requirements version
eteRnaL198 Jan 21, 2026
d5b14cd
calc dist
eteRnaL198 Jan 21, 2026
3f4831e
chore
eteRnaL198 Jan 21, 2026
b17563c
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 21, 2026
de4a1ef
add png
eteRnaL198 Jan 21, 2026
5565358
show fliers false
eteRnaL198 Jan 21, 2026
b04354c
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 21, 2026
83399dc
add png
eteRnaL198 Jan 21, 2026
94db7c0
show means
eteRnaL198 Jan 21, 2026
c31d07c
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 21, 2026
f1bdaed
add png
eteRnaL198 Jan 21, 2026
dbf1e55
inv
eteRnaL198 Jan 21, 2026
d29e822
chore
eteRnaL198 Jan 21, 2026
4f8f7e4
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 21, 2026
59cca10
add count
eteRnaL198 Jan 21, 2026
13b1426
refactor
eteRnaL198 Jan 22, 2026
a267345
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
ad25605
add 2nd rank
eteRnaL198 Jan 22, 2026
2923fcd
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
58389c5
refactor
eteRnaL198 Jan 22, 2026
475bd9a
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
0620d2b
add dist png
eteRnaL198 Jan 22, 2026
e76bbc0
fix load csv
eteRnaL198 Jan 22, 2026
c3a375f
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
abf6c29
add dist png
eteRnaL198 Jan 22, 2026
73d2c97
add pdf
eteRnaL198 Jan 22, 2026
aa92737
style
eteRnaL198 Jan 22, 2026
1ef6218
add pdf
eteRnaL198 Jan 22, 2026
1be46fd
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
9ab15c0
add pdf
eteRnaL198 Jan 22, 2026
bf702d1
style
eteRnaL198 Jan 22, 2026
d6e33a3
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
d73a435
add pdf
eteRnaL198 Jan 22, 2026
c838881
fix java
eteRnaL198 Jan 22, 2026
da91733
chore investigate sh
eteRnaL198 Jan 22, 2026
62c9dea
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 22, 2026
5613b2d
add repo pdf
eteRnaL198 Jan 23, 2026
79006fe
java precision projects
eteRnaL198 Jan 23, 2026
4181329
fix inv executor
eteRnaL198 Jan 23, 2026
594e8e2
fix inv sh
eteRnaL198 Jan 23, 2026
2596674
fix for js inv sh
eteRnaL198 Jan 23, 2026
4d3f839
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 23, 2026
50a4e95
fix
eteRnaL198 Jan 23, 2026
b736315
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 23, 2026
d27ed2c
add pdf
eteRnaL198 Jan 23, 2026
24c79c6
sh for js inv
eteRnaL198 Jan 23, 2026
24f7e7c
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 23, 2026
8ae9033
add repo pdf
eteRnaL198 Jan 23, 2026
b2fb13f
fix graph
eteRnaL198 Jan 23, 2026
c845986
fix location when body is null
eteRnaL198 Jan 24, 2026
95b909a
add pdf
eteRnaL198 Jan 26, 2026
6294f8f
fix
eteRnaL198 Jan 26, 2026
452354d
add pdf
eteRnaL198 Jan 26, 2026
1c47916
fix inv
eteRnaL198 Jan 26, 2026
a723208
add pdf
eteRnaL198 Jan 26, 2026
6531e9b
:Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 26, 2026
4f12aa9
fix
eteRnaL198 Jan 26, 2026
4bd99e2
add rq2"
eteRnaL198 Jan 26, 2026
0b2fa9d
add loc
eteRnaL198 Jan 26, 2026
fa3a439
add loc repo
eteRnaL198 Jan 26, 2026
0b976bf
erge branch 'master' into investigate-on-thor
eteRnaL198 Jan 26, 2026
1135d70
order
eteRnaL198 Jan 26, 2026
2699b3e
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 26, 2026
bb00048
add pdf
eteRnaL198 Jan 26, 2026
4fe3612
fix inv
eteRnaL198 Jan 30, 2026
a75f802
Merge branch 'master' into investigate-on-thor
eteRnaL198 Jan 30, 2026
30fd6e3
add pdf
eteRnaL198 Jan 30, 2026
a2c3f91
add scatter loc
eteRnaL198 Jan 30, 2026
9e00013
fix loc
eteRnaL198 Feb 1, 2026
a20fe7b
Merge branch 'master' into investigate-on-thor
eteRnaL198 Feb 1, 2026
e1d738d
add loc
eteRnaL198 Feb 1, 2026
77335e5
fix inv
eteRnaL198 Feb 1, 2026
ece0166
Merge branch 'master' into investigate-on-thor
eteRnaL198 Feb 1, 2026
8762b4b
add pdf
eteRnaL198 Feb 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.gradle/
.idea/
.vscode/
build/
bin/
*/build/
*/bin/
*.iml
*.ipr
*.iws
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/.gradle/

.project

.DS_Store
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
java = "22"
13 changes: 13 additions & 0 deletions .settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=--init-script /var/folders/lc/w49l8hmn7c17ntytg27lfphw0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/lc/w49l8hmn7c17ntytg27lfphw0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
auto.sync=true
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Users/ikuya/.local/share/mise/installs/java/22.0.2
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "disabled",
"editor.formatOnSave": false,
"java.import.gradle.java.home": "/Users/ikuya/.local/share/mise/installs/java/22.0.2",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable",
}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Use the official Gradle image with JDK 17
FROM gradle:8.11-jdk17 AS build

# Set the working directory
WORKDIR /home/gradle/project

# Copy the entire project to the working directory
COPY . .

# Run the investigation task
# This will build the necessary dependencies and execute the main class
CMD ["gradle", ":investigation:runInvestigation"]
101 changes: 101 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Project Overview
ソースファイルを解析し、リファクタリングを検出するツールです。
多様な言語に対応するため、各言語のAST(Abstract Syntax Tree)を言語非依存な形式であるCST(Code Structure Tree)に変換する機能を持っています。
変更前後でCSTを比較することで、リファクタリングの検出を行います。
プラグインとコアの2つのモジュールで構成されており、プラグインは各言語のASTをCSTに変換する役割を担っています。
コアはrefdiff-coreモジュールで、プラグインを利用してCSTの比較を行います。
プラグインはrefdiff-universalモジュールに実装されており、各言語のASTをCSTに変換するためのコードが含まれています。

# プラグイン作成手順
## テストの生成
### Role
You are an expert at generating high-quality JUnit tests for a multi-language parser (UniversalPlugin) implemented in Java.
Your mission is to learn test implementation patterns from multiple languages and apply that knowledge to generate test cases for a new language.

### Context (Training Data)
To generate parser tests for the Go language, first, learn the language-independent common testing patterns from the following JavaScript and Ruby test implementations.

- Overview:
- Test Target Code: Code that covers various function or method or class definitions
- Test Target Ctags: Reference for Retrieving Line Numbers of Target Syntactic Elements
- Test Implementation: A JUnit test that parses the aforementioned file and verifies that function names, line numbers, argument lists, etc., are correctly extracted as CST nodes.

- Training Data 1: JavaScript
- Test Target Code
- @refdiff-universal/src/test/resources/js/syntax/class/dir/class.js
- @refdiff-universal/src/test/resources/js/syntax/file/dir/file.js
- @refdiff-universal/src/test/resources/js/syntax/function/function.js
- Test Target Ctags
- @refdiff-universal/src/test/resources/js/syntax/class/tags
- @refdiff-universal/src/test/resources/js/syntax/file/tags
- @refdiff-universal/src/test/resources/js/syntax/function/tags
- Test Implementation: @refdiff-universal/src/test/java/refdiff/parsers/universal/js/TestParser.java

- Training Data 2: Ruby
- Test Target Code: @refdiff-universal/src/test/resources/ruby/syntax/method.rb
- Test Target Ctags: @refdiff-universal/src/test/resources/ruby/syntax/tags
- Test Implementation: @refdiff-universal/src/test/java/refdiff/parsers/universal/ruby/TestParser.java

### Output Requirements
- Generation Language: The output test code must be Java.
- Inference and Application:
- Infer the language's node types and use them, such as NodeTypes.FUNCTION and NodeTypes.STRUCT.
- Accurately map the code structure (packages, functions, type definitions, etc.) to ExpectedNode records.
- Naming Convention: The method name should clearly describe the feature of the language being tested, for example, shouldParseGoFunctionsAndStructsCorrectly.
- Structure Replication: Strictly reproduce the structure of the learned tests (use of SourceFolder, collection of CstNodes, creation of an ExpectedNode list, and the verification loop using assertThat).
- Format: Output the generated code as a complete Java method, suitable for being placed in a new refdiff/parsers/universal/go/TestParser.java file.


## プラグインの実装
### 役割
あなたは、Tree-sitterが出力したASTを解析し、指定された CstNode 形式に変換するJavaコードを生成する専門家です。

- 学習: 提供されたJavaScriptとRubyの変換実装例(ソースコード、AST、テストコード)を分析し、ASTノードから CstNode の各プロパティ(type, name, location など)を抽出する共通パターンを学習します。
- 分析: 新しい言語(Go)のAST (ast.txt) の構造を理解し、CSTにマッピングすべき構文要素(関数、メソッドなど)を特定します。
- 実装: 学習したパターンと分析結果を基に、Go言語のASTをCSTに変換するJavaコードを生成します。

### 前提
生成するコードは、以下の仕様を持つ CstNode オブジェクトを作成する必要があります。
- `CstNode`: 構文木のノードを表します。以下の重要なプロパティを持っています。
- type: ノードの種類 (例: GoNodeTypes.FUNCTION_DECLARATION)
- name: ノードの単純名 (例: myFunction)
- localName: 修飾子や引数を含むローカル名 (例: myFunction(arg1, arg2))
- namespace: ノードが属する名前空間 (例: main)
- location: ファイルパス、開始/終了位置・行番号などの情報
- parameters: 関数の引数リスト (例: ["arg1", "arg2"])

### コンテキスト (学習データ)
JavaScriptとRubyの例から、ASTからCSTへの変換ロジックを学習してください。特に、ASTの特定のノードタイプから CstNode のプロパティをどのように埋めているかに注目してください。

- 概要:
- 元のソースファイル: Tree-sitterが解析したソースコードファイル
- ASTファイル: Tree-sitterが出力したASTのテキストファイル
- テストファイル: JUnitテストで、ASTからCSTへの変換を検証するコード
- 変換処理ファイル: ASTをCSTに変換する処理が実装されたJavaクラス

#### 学習データ1: JavaScript
- ファイル参照:
- 元のソースファイル:
- @plugin-maker/context/js/src/class.txt
- @plugin-maker/context/js/src/file.txt
- @plugin-maker/context/js/src/function.txt
- ASTファイル:
- @plugin-maker/context/js/ast/ast-class.txt
- @plugin-maker/context/js/ast/ast-file.txt
- @plugin-maker/context/js/ast/ast-function.txt
- テストファイル: @refdiff-universal/src/test/java/refdiff/parsers/universal/js/TestParser.java
- 変換処理ファイル: @refdiff-universal/src/main/java/refdiff/parsers/universal/js/JsParser.java

#### 学習データ2: Ruby
- ファイル参照:
- 元のソースファイル: @plugin-maker/context/ruby/src/method.rb
- ASTファイル: @plugin-maker/context/ruby/ast/ast-method.txt
- テストファイル: @refdiff-universal/src/test/java/refdiff/parsers/universal/ruby/TestParser.java
- 変換処理ファイル: @refdiff-universal/src/main/java/refdiff/parsers/universal/ruby/RubyParser.java

# 出力要件
- 出力言語: Java
- 品質: 提供されたテストファイル (TestParser.java) を修正することなく、すべてのテストケースをパスすること。
- コーディングスタイル: refdiff-universal プロジェクト内の既存のJavaコードのスタイルに合わせてください。
- 依存関係: プロジェクトに既に存在するクラスやライブラリのみを使用してください。新たな外部依存を追加しないでください。
- 出力形式: 実装されたJavaメソッドのコードブロックのみを出力してください。解説や説明はコードの前に簡潔に記述するだけに留めてください。
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'eclipse'
}


allprojects {
group = 'com.github.aserg-ufmg'
version = '2.0.0'
Expand All @@ -16,7 +17,7 @@ subprojects {
}

wrapper {
gradleVersion = '6.4.1'
gradleVersion = '8.11'
}


Expand Down
Binary file added evaluation/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions evaluation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/bin/
/build/
/.gradle/
/.settings/
.classpath
.project
/temp/
/repository/
/repo-for-analysis/
/script/logs/
22 changes: 22 additions & 0 deletions evaluation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```bash
./gradlew runEvaluation --args='java'
./gradlew runEvaluation --args='c precision'
./gradlew runEvaluation --args='js recall'
./gradlew runEvaluation --args='js precision head'
```

For a specific directory:
- Switch boolean flag `IS_FOR_REPO`
- Modify the path in `COMMIT_PATH`
- Switch LANGUAGE in `LANG`
- Set the desired LanguagePlugin

```bash
./gradlew runDebug
```

```bash
./build/install/evaluation/bin/evaluation java
./build/install/evaluation/bin/evaluation javascript precision
./build/install/evaluation/bin/evaluation javascript head
```
58 changes: 58 additions & 0 deletions evaluation/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
plugins {
id 'java'
id 'eclipse'
id 'application'
}

dependencies {
implementation 'org.eclipse.jdt:org.eclipse.jdt.core:3.16.0'

implementation("io.github.bonede:tree-sitter:0.22.6")
implementation("io.github.bonede:tree-sitter-javascript:0.23.1")
implementation("io.github.bonede:tree-sitter-ruby:0.23.1")
implementation("io.github.bonede:tree-sitter-go:0.23.3")
implementation("io.github.bonede:tree-sitter-java:0.23.4")

implementation project(':refdiff-core')
implementation project(':refdiff-universal')
implementation project(':refdiff-c')
implementation project(':refdiff-java')

testImplementation 'junit:junit:4.11'
}

application {
mainClass = 'evaluation.Executor'
}

task runEvaluation(type: JavaExec) {
group = 'Application'
description = 'Runs the performance evaluation executor. Args: <language> [metric]'
classpath sourceSets.main.runtimeClasspath
mainClass = 'evaluation.Executor'
}

task runEvalDebug(type: JavaExec) {
group = 'Application'
description = 'Runs the Debugger class for debugging purposes.'
classpath sourceSets.main.runtimeClasspath
mainClass = 'evaluation.Debugger'
}

task runCalculator(type: Exec) {
group = 'Application'
description = 'Runs the CSV processing Python script.'

workingDir 'calculator'
commandLine 'sh', '-c', 'venv/bin/python -m src.main'

standardOutput = System.out
errorOutput = System.err
}

task runSandbox(type: JavaExec) {
group = 'Application'
description = 'Runs the Large AST Benchmark.'
classpath sourceSets.main.runtimeClasspath
mainClass = 'evaluation.Sandbox'
}
4 changes: 4 additions & 0 deletions evaluation/calculator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
venv/
__pycache__/
*.pyc
.DS_Store
22 changes: 22 additions & 0 deletions evaluation/calculator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Compare the detection result with the oracle and calculate precision, recall.
Output the result that merges the detection result and the oracle as a CSV file.
Basically, run this script after running detection for oracle data.

```bash
python3 -m venv venv
source venv/bin/activate
python3 -m src.main -l java -d ../detection-result/1027-1130-java.csv
venv/bin/python -m src.main -l c -m precision -d ../detection-result/1027-0837-c-precision.csv
# or venv/bin/python
```

```bash
python3 -m unittest
```

## Random Sampling
To randomly sample from the merged result CSV file, use `random.py` which outputs a randomly sampled CSV file to `/calculator/sampled/sampled-{lang}-head-{date}-seed{seed}.csv`.

```bash
venv/bin/python -m src.manual.random
```
6 changes: 6 additions & 0 deletions evaluation/calculator/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
numpy==2.3.3
pandas==2.3.3
python-dateutil==2.9.0.post0
pytz==2025.2
six==1.17.0
tzdata==2025.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
EXTRACT:
TP: 3.0
FP: 0.0
FN: 6.0
TN: 1.0
Precision: 1.0000
Recall: 0.3333

INLINE:
TP: 3.0
FP: 0.0
FN: 5.0
TN: 2.0
Precision: 1.0000
Recall: 0.3750

MOVE:
TP: 14.0
FP: 1.0
FN: 7.0
TN: 0.0
Precision: 0.9333
Recall: 0.6667

MOVE_RENAME:
TP: 12.0
FP: 0.0
FN: 6.0
TN: 2.0
Precision: 1.0000
Recall: 0.6667

RENAME:
TP: 20.0
FP: 0.0
FN: 3.0
TN: 2.0
Precision: 1.0000
Recall: 0.8696

Total:
TP: 52.0
FP: 1.0
FN: 27.0
TN: 7.0
Precision: 0.9811
Recall: 0.6582

Loading