• 제목/요약/키워드: code clone detection

검색결과 8건 처리시간 0.02초

Domain Analysis of Device Drivers Using Code Clone Detection Method

  • Ma, Yu-Seung;Woo, Duk-Kyun
    • ETRI Journal
    • /
    • 제30권3호
    • /
    • pp.394-402
    • /
    • 2008
  • Domain analysis is the process of analyzing related software systems in a domain to find their common and variable parts. In the case of device drivers, they are highly suitable for domain analysis because device drivers of the same domain are implemented similarly for each device and each system that they support. Considering this characteristic, this paper introduces a new approach to the domain analysis of device drivers. Our method uses a code clone detection technique to extract similarity among device drivers of the same domain. To examine the applicability of our method, we investigated whole device drivers of a Linux source. Results showed that many reusable similar codes can be discerned by the code clone detection method. We also investigated if our method is applicable to other kernel sources. However, the results show that the code clone detection method is not useful for the domain analysis of all kernel sources. That is, the applicability of the code clone detection method to domain analysis is a peculiar feature of device drivers.

  • PDF

Tree-Pattern-Based Clone Detection with High Precision and Recall

  • Lee, Hyo-Sub;Choi, Myung-Ryul;Doh, Kyung-Goo
    • KSII Transactions on Internet and Information Systems (TIIS)
    • /
    • 제12권5호
    • /
    • pp.1932-1950
    • /
    • 2018
  • The paper proposes a code-clone detection method that gives the highest possible precision and recall, without giving much attention to efficiency and scalability. The goal is to automatically create a reliable reference corpus that can be used as a basis for evaluating the precision and recall of clone detection tools. The algorithm takes an abstract-syntax-tree representation of source code and thoroughly examines every possible pair of all duplicate tree patterns in the tree, while avoiding unnecessary and duplicated comparisons wherever possible. The largest possible duplicate patterns are then collected in the set of pattern clusters that are used to identify code clones. The method is implemented and evaluated for a standard set of open-source Java applications. The experimental result shows very high precision and recall. False-negative clones missed by our method are all non-contiguous clones. Finally, the concept of neighbor patterns, which can be used to improve recall by detecting non-contiguous clones and intertwined clones, is proposed.

공통 토큰에 기반한 서로 다른 언어의 유사성 검사 (Cross-Language Clone Detection based on Common Token)

  • 홍성문;김현하;이제형;박성우;모지환;도경구
    • 한국소프트웨어감정평가학회 논문지
    • /
    • 제14권2호
    • /
    • pp.35-44
    • /
    • 2018
  • 서로 다른 언어로 작성된 소스코드의 유사성 검사는 주로 요약구문트리를 기반으로 비교를 수행한다. 하지만 대규모의 소스코드를 실용적인 수준으로 비교하려면 토큰수준 기반에서 작동하는 유사성 검사 기술이 필요하다. 본 연구에서는 서로 다른 언어에서 생성되었지만 같은 의미를 지닌 토큰을 표현할 수 있는 공통 토큰을 정의하고, 소스코드에서 언어별 처리 과정을 거쳐 생성한 공통 토큰의 나열을 입력으로 소스코드의 유사성 검사를 수행하는 방법을 제안한다. 한국저작권위원회의 표절검사 도구 exEyes를 사용해서 서로 다른 언어로 작성된 동일한 코드를 대상으로 실험한 결과, 제안한 방법을 사용했을 때, 유사성 평가 성능이 향상됨을 보였다.

트리 기반 컨볼루션 신경망을 이용한 BigCloneBench 개선 (Improvement of BigCloneBench Using Tree-Based Convolutional Neural Network)

  • 박건우;홍성문;김현하;도경구
    • 한국소프트웨어감정평가학회 논문지
    • /
    • 제15권1호
    • /
    • pp.43-53
    • /
    • 2019
  • 기계 학습을 이용하여 의미가 유사한 코드 클론을 탐지하는 도구의 성능 평가에 빅클론벤치를 많이 활용한다. 하지만 빅클론벤치는 기계 학습에 최적화된 벤치마크가 아니기 때문에 그대로 기계 학습에 사용하면 잘못된 학습 데이터가 만들어질 수 있다. 본 연구에서는 빅클론벤치에서 제공하고 있는 코드 클론 데이터에서 누락된 타입-4 클론을 기계 학습을 이용하여 추가로 찾아 보완함으로써 빅클론벤치를 개선할 수 있음을 실험적으로 밝힌다. 트리 기반 컨볼루션 신경망을 이용한 기계 학습 모델을 사용해서 개선된 데이터를 학습했을 때, 기존의 데이터를 학습했을 때에 비해 기계 학습의 정확도 및 성능이 향상되었음을 확인하였다.

code2vec을 이용한 유사도 감정 도구의 성능 개선 (Enhancing the performance of code-clone detection tools using code2vec)

  • 엄태호;홍성문;양준혁;장효석;도경구
    • 한국소프트웨어감정평가학회 논문지
    • /
    • 제17권1호
    • /
    • pp.31-40
    • /
    • 2021
  • 소스코드 표절은 원본 자료의 출처를 분명히 밝히지 않고 자신의 것처럼 사용하는 행위를 말한다. 소스코드 표절로 인한 문제는 법적인 분쟁을 다투는 경우까지 다양한 문제를 일으킨다. 소스코드의 표절 여부는 일반적으로 비교 대상 소프트웨어 프로젝트 내의 각 소스코드를 전수 비교하여 유사도를 측정하여 결정한다. 전수 비교는 표절 가능성이 전혀 없는 코드도 비교 대상에 포함하기 때문에 그만큼의 시간을 헛되이 소모한다. 소스코드 표절로 의심되는 비교 쌍만 선별하여 비교할 수 있으면 그만큼 비교 횟수는 줄어들게 되어 탐지 도구의 실행 속도를 향상시킬 수 있을 뿐만 아니라, 표절 가능성이 높은 부분만을 대상으로 탐지의 정확도를 높이는데 집중할 수도 있다. 본 논문에서는 code2vec 이라는 기계학습 모델을 활용하여 코드 클론으로 의심되는 소스코드들을 미리 분류하여 비교 횟수를 줄임으로써 소스코드 표절 탐지의 성능을 개선할 수 있음을 보인다.

코드클론 표본 집합체 자동 생성기 (Automatic Generation of Code-clone Reference Corpus)

  • 이효섭;도경구
    • 한국소프트웨어감정평가학회 논문지
    • /
    • 제7권1호
    • /
    • pp.29-39
    • /
    • 2011
  • 프로그램 내의 코드클론을 찾아주는 도구나 기술들을 평가하기 위해서는 해당 도구가 탐지하는 못하는 클론이 있는지 확인해야 한다. 이를 위해서 샘플 소스코드에 대해서 코드클론을 모두 모아놓은 표준 표본 집합체가 필요하다. 그런데 기존의 코드클론 표본 집합체는 여러 클론탐지 도구의 결과들을 참조해 수작업으로 구축하지만 평가 기준으로 사용하기에는 빠져있는 표본이 많다. 본 연구에서는 자동으로 코드클론 표본 집합체를 생성하는 방법을 제안하고 도구를 구현하였다. 이 도구는 프로그램 소스를 핵심구문트리로 변환한 뒤, 트리를 샅샅이 비교하여 클론 패턴을 찾아낸다. 본 도구는 오탐이 없으며, 특정한 패턴을 제외하고 미탐도 없어서 코드클론 표본 집합체를 자동으로 생성하기 적합하다. 실험결과 상용도구인 CloneDR에서 찾아낸 클론을 모두 포함하면서 2-3배 더 많은 클론들을 찾아내었고, Bellon의 기존 표본 집합체의 클론들을 거의 대부분 포함(93-100%)하면서 자동 구축한 표본 집합체의 크기가 훨씬 크다.

자바스크립트에 특화된 프로그램 종속성 그래프를 이용한 표절 탐지 (Plagiarism Detection Using Dependency Graph Analysis Specialized for JavaScript)

  • 김신형;한태숙
    • 한국정보과학회논문지:소프트웨어및응용
    • /
    • 제37권5호
    • /
    • pp.394-402
    • /
    • 2010
  • 자바스크립트는 현재 웹 사이트, 웹 어플리케이션에서 가장 많이 사용되는 스크립트 언어 중 하나이다. 자바스크립트로 작성된 프로그램은 원본 프로그램 형태로 클라이언트에게 전송되므로 무단 복제, 도용에 쉽게 노출된다. 때문에 자바스크립트 프로그램의 도용을 탐지하기 위한 연구가 필요하다. 현재 일반적으로 프로그램 표절 탐지를 위해 사용되는 자동화 도구들의 경우 고수준의 표절 기법에 적절히 대응하지 못한다. 반면에 프로그램 종속성 그래프에 기반을 둔 기존 연구들의 경우 자바스크립트의 동적인 특징을 적절히 반영하지 못한다. 또한 지나친 일반화로 인해 일부 틀린 판정(false positive)을 보이며 대상 프로그램의 크기가 클 경우 탐지 속도에 문제를 보이고 있다. 본 논문에서는 자바스크립트에 특화된 프로그램 종속성 그래프(이하 JS PDG)와 이를 사용한 도용 탐지 기법을 제안하여 이러한 문제를 해결하고자 한다. 본 논문에서 제안하는 JS PDG는 세분화된 노드 타입을 가지고 있어 기존 PDG와 비교해 보다 정확한 그래프 간 비교를 할 수 있도록 하며 포함하고 있는 노드 타입에 따라 정의되는 JS PDG의 타입은 탐색 범위를 분할을 가능하게 해 전체 도용 탐지 속도가 개선 될 수 있도록 한다. 실험 결과 기존 PDG에서 나타나는 틀린 판정을 확인할 수 있었으며 PDG간 비교 횟수가 줄어들어 도용 탐지 속도가 개선됨을 확인할 수 있었다.

Field Studios of In-situ Aerobic Cometabolism of Chlorinated Aliphatic Hydrocarbons

  • Semprini, Lewts
    • 한국지하수토양환경학회:학술대회논문집
    • /
    • 한국지하수토양환경학회 2004년도 총회 및 춘계학술발표회
    • /
    • pp.3-4
    • /
    • 2004
  • Results will be presented from two field studies that evaluated the in-situ treatment of chlorinated aliphatic hydrocarbons (CAHs) using aerobic cometabolism. In the first study, a cometabolic air sparging (CAS) demonstration was conducted at McClellan Air Force Base (AFB), California, to treat chlorinated aliphatic hydrocarbons (CAHs) in groundwater using propane as the cometabolic substrate. A propane-biostimulated zone was sparged with a propane/air mixture and a control zone was sparged with air alone. Propane-utilizers were effectively stimulated in the saturated zone with repeated intermediate sparging of propane and air. Propane delivery, however, was not uniform, with propane mainly observed in down-gradient observation wells. Trichloroethene (TCE), cis-1, 2-dichloroethene (c-DCE), and dissolved oxygen (DO) concentration levels decreased in proportion with propane usage, with c-DCE decreasing more rapidly than TCE. The more rapid removal of c-DCE indicated biotransformation and not just physical removal by stripping. Propane utilization rates and rates of CAH removal slowed after three to four months of repeated propane additions, which coincided with tile depletion of nitrogen (as nitrate). Ammonia was then added to the propane/air mixture as a nitrogen source. After a six-month period between propane additions, rapid propane-utilization was observed. Nitrate was present due to groundwater flow into the treatment zone and/or by the oxidation of tile previously injected ammonia. In the propane-stimulated zone, c-DCE concentrations decreased below tile detection limit (1 $\mu$g/L), and TCE concentrations ranged from less than 5 $\mu$g/L to 30 $\mu$g/L, representing removals of 90 to 97%. In the air sparged control zone, TCE was removed at only two monitoring locations nearest the sparge-well, to concentrations of 15 $\mu$g/L and 60 $\mu$g/L. The responses indicate that stripping as well as biological treatment were responsible for the removal of contaminants in the biostimulated zone, with biostimulation enhancing removals to lower contaminant levels. As part of that study bacterial population shifts that occurred in the groundwater during CAS and air sparging control were evaluated by length heterogeneity polymerase chain reaction (LH-PCR) fragment analysis. The results showed that an organism(5) that had a fragment size of 385 base pairs (385 bp) was positively correlated with propane removal rates. The 385 bp fragment consisted of up to 83% of the total fragments in the analysis when propane removal rates peaked. A 16S rRNA clone library made from the bacteria sampled in propane sparged groundwater included clones of a TM7 division bacterium that had a 385bp LH-PCR fragment; no other bacterial species with this fragment size were detected. Both propane removal rates and the 385bp LH-PCR fragment decreased as nitrate levels in the groundwater decreased. In the second study the potential for bioaugmentation of a butane culture was evaluated in a series of field tests conducted at the Moffett Field Air Station in California. A butane-utilizing mixed culture that was effective in transforming 1, 1-dichloroethene (1, 1-DCE), 1, 1, 1-trichloroethane (1, 1, 1-TCA), and 1, 1-dichloroethane (1, 1-DCA) was added to the saturated zone at the test site. This mixture of contaminants was evaluated since they are often present as together as the result of 1, 1, 1-TCA contamination and the abiotic and biotic transformation of 1, 1, 1-TCA to 1, 1-DCE and 1, 1-DCA. Model simulations were performed prior to the initiation of the field study. The simulations were performed with a transport code that included processes for in-situ cometabolism, including microbial growth and decay, substrate and oxygen utilization, and the cometabolism of dual contaminants (1, 1-DCE and 1, 1, 1-TCA). Based on the results of detailed kinetic studies with the culture, cometabolic transformation kinetics were incorporated that butane mixed-inhibition on 1, 1-DCE and 1, 1, 1-TCA transformation, and competitive inhibition of 1, 1-DCE and 1, 1, 1-TCA on butane utilization. A transformation capacity term was also included in the model formation that results in cell loss due to contaminant transformation. Parameters for the model simulations were determined independently in kinetic studies with the butane-utilizing culture and through batch microcosm tests with groundwater and aquifer solids from the field test zone with the butane-utilizing culture added. In microcosm tests, the model simulated well the repetitive utilization of butane and cometabolism of 1.1, 1-TCA and 1, 1-DCE, as well as the transformation of 1, 1-DCE as it was repeatedly transformed at increased aqueous concentrations. Model simulations were then performed under the transport conditions of the field test to explore the effects of the bioaugmentation dose and the response of the system to tile biostimulation with alternating pulses of dissolved butane and oxygen in the presence of 1, 1-DCE (50 $\mu$g/L) and 1, 1, 1-TCA (250 $\mu$g/L). A uniform aquifer bioaugmentation dose of 0.5 mg/L of cells resulted in complete utilization of the butane 2-meters downgradient of the injection well within 200-hrs of bioaugmentation and butane addition. 1, 1-DCE was much more rapidly transformed than 1, 1, 1-TCA, and efficient 1, 1, 1-TCA removal occurred only after 1, 1-DCE and butane were decreased in concentration. The simulations demonstrated the strong inhibition of both 1, 1-DCE and butane on 1, 1, 1-TCA transformation, and the more rapid 1, 1-DCE transformation kinetics. Results of tile field demonstration indicated that bioaugmentation was successfully implemented; however it was difficult to maintain effective treatment for long periods of time (50 days or more). The demonstration showed that the bioaugmented experimental leg effectively transformed 1, 1-DCE and 1, 1-DCA, and was somewhat effective in transforming 1, 1, 1-TCA. The indigenous experimental leg treated in the same way as the bioaugmented leg was much less effective in treating the contaminant mixture. The best operating performance was achieved in the bioaugmented leg with about over 90%, 80%, 60 % removal for 1, 1-DCE, 1, 1-DCA, and 1, 1, 1-TCA, respectively. Molecular methods were used to track and enumerate the bioaugmented culture in the test zone. Real Time PCR analysis was used to on enumerate the bioaugmented culture. The results show higher numbers of the bioaugmented microorganisms were present in the treatment zone groundwater when the contaminants were being effective transformed. A decrease in these numbers was associated with a reduction in treatment performance. The results of the field tests indicated that although bioaugmentation can be successfully implemented, competition for the growth substrate (butane) by the indigenous microorganisms likely lead to the decrease in long-term performance.

  • PDF