@article{oai:ipsj.ixsq.nii.ac.jp:02009076, author = {川本,琢人 and 肥後,芳樹 and Takuto Kawamoto and Yoshiki Higo}, issue = {4}, journal = {情報処理学会論文誌}, month = {Apr}, note = {コードクローンは,ソフトウェアの一貫性のない変更を助長し,ソフトウェアの保守性を低下させる.コードクローンのリファクタリングはソフトウェアの保守性を高く保つために有効であると考えられる.リファクタリング手法の1つにメソッド抽出リファクタリングある.このリファクタリングは一般に,識別子名の違いや空白文字の違いを含むコードクローンに対して適用できる.文単位の差異を含むコードクローンであっても,ラムダ式を用いて互いに異なる動作をパラメータ化するとメソッドの抽出リファクタリングによるリファクタリングが可能になる.しかしラムダ式はプログラミング言語によって仕様が様々に異なる.最適な手法はプログラミング言語ごとに熟慮を要する.本稿ではC#を対象にラムダ式を用いたメソッドの抽出リファクタリングの手法を提案する.提案手法を実際のプロジェクトのクローンペア2,714件に対して適用したところ,全体の11.6%のクローンペアで正確なリファクタリングが確認された.また,24.0%のクローンペアでリファクタリング後のソースコードはビルドを通過し,62.6%のクローンペアをリファクタリング不可能と判断した., Code clones encourage inconsistent software changes and degrade software maintainability. Refactoring code clones is considered effective for improving software maintainability. One refactoring technique is Extract Method refactoring. This refactoring is generally effective for code clones that differ in identifier names and whitespace. Even for code clones containing statement-level differences, Extract Method refactoring becomes possible by parameterizing the differing behaviors using lambda expressions. However, the detailed specifications of lambda expressions vary significantly across programming languages. Therefore, the optimal approach requires careful consideration for each programming language. This paper proposes an Extract Method refactoring technique using lambda expressions specifically for C#. When the proposed technique was applied to 2,714 clone pairs from actual projects, 11.6% of the clone pairs were accurately refactored. Furthermore, the refactored source code passed the build process for 24.0% of the clone pairs, while 62.6% of the clone pairs were determined to be unrefactorable.}, pages = {748--761}, title = {C#におけるラムダ式を用いたメソッドの抽出リファクタリングによるコードクローン集約}, volume = {67}, year = {2026} }