KR20060113168A - Source code analysys for source code inspector - Google Patents
Source code analysys for source code inspector Download PDFInfo
- Publication number
- KR20060113168A KR20060113168A KR1020050036083A KR20050036083A KR20060113168A KR 20060113168 A KR20060113168 A KR 20060113168A KR 1020050036083 A KR1020050036083 A KR 1020050036083A KR 20050036083 A KR20050036083 A KR 20050036083A KR 20060113168 A KR20060113168 A KR 20060113168A
- Authority
- KR
- South Korea
- Prior art keywords
- source code
- rule
- naming
- rules
- analyzed
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3696—Methods or tools to render software testable
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Abstract
Description
도1은 본 발명에 따른 소프트웨어 개발과 검증, 완성에 이르는 일련의 과정을 도식화하여 나타낸 도면1 is a diagram illustrating a series of processes leading to software development, verification, and completion according to the present invention.
도2는 본 발명에 따른 소스 코드 분석 시스템 구성을 나타낸 블록도2 is a block diagram showing a configuration of a source code analysis system according to the present invention.
도3은 본 발명에 따른 소스 코드 분석 시스템의 인터페이스 화면의 실시예를 나타낸 도면3 is a diagram showing an embodiment of an interface screen of a source code analysis system according to the present invention;
<도면의 주요 부분에 대한 부호의 설명><Explanation of symbols for the main parts of the drawings>
10: 소스코드 20: 소스코드 분석기10: Source Code 20: Source Code Analyzer
21: 작성규칙(DB) 30: 사용자 인터페이스21: Creation Rule (DB) 30: User Interface
210: 외형구성 분석모듈 220: 명명(이름 붙이기) 분석모듈210: external configuration analysis module 220: naming (naming) analysis module
230: 설명문 분석모듈 240: 부칙 분석모듈230: comment analysis module 240: annex analysis module
본 발명은 다수의 개발자가 참여하여 공동으로 소프트웨어를 개발하는 환경에서, 표준 소프트웨어 작성 규칙에 의거하여 각 개발자가 해당 소프트웨어 개발을 수행하였는지의 여부를 검증하기 위한 소스 코드 분석 방법에 관한 것이다.The present invention relates to a source code analysis method for verifying whether each developer has performed a corresponding software development based on standard software writing rules in an environment in which a plurality of developers participate and jointly develop software.
다수의 개발자가 참여하여 공동으로 소프트웨어를 개발하는 환경에서는 각각의 개발자 마다 소프트웨어를 분담하여 개발하고, 개발된 각각의 소프트웨어를 유기적으로 통합함으로써 하나의 완성된 소프트웨어를 구현할 수 있다.In an environment where multiple developers participate and develop software jointly, each developer can share the software and develop it, and each of the developed software can be organically integrated to implement one complete software.
그렇지만, 이와 같이 다수의 개발자가 참여하는 소프트웨어 개발 환경에서 각 개발자는 분담된 소프트웨어를 각자 마다의 고유한 특성에 기초하여 개발하기 때문에, 최종적으로 각각의 소프트웨어를 유기적으로 결합할 때 문제가 발생한다.However, in such a software development environment in which a large number of developers participate, each developer develops a shared software based on their own unique characteristics, and thus, a problem arises when finally combining the respective software organically.
이는, 표준 소프트웨어 작성 규칙이 있음에도 불구하고, 개발자 간의 상이한 이해의 정도와, 실수, 인성적인 특징 등으로 인하여 해당 규칙의 적용이 다른 양상으로 나타나기 때문이다. 이러한 경우 코드의 가독성(readbility)이 떨어지게 되므로 공동 소프트웨어 개발에 어려움이 따르고 있다.This is because, despite the fact that there are standard software writing rules, the application of the rules appears in different ways due to different levels of understanding, mistakes, and personality among developers. In this case, since the readability of the code is reduced, joint software development is difficult.
즉, 다수의 개발자가 공동으로 참여하는 소프트웨어 개발 환경에서는 위와 같은 문제점을 최소화하기 위하여 표준 소프트웨어 작성 규칙을 구비하게 되지만, 이러함에도 불구하고 개발자 간의 상이한 이해의 정도와 실수에 의한 누락, 표준 소프트웨어 작성 규칙의 불충분한 숙지에 의해서 공동 개발의 어려움이 따르고, 표준 소프트웨어 작성 규칙이 적용되지 않은 기존 소프트웨어의 재사용 등에 의해서 표준 소프트웨어 작성 규칙이 잘 지켜지지 않게 되며, 이로 인하여 종단에는 해당 소프트웨어-소스코드에 대한 가독성이 떨어지게 되는 문제점이 있다.In other words, in a software development environment in which a large number of developers jointly participate, standard software writing rules are provided to minimize the above problems, but despite this, different levels of understanding and mistakes by developers, and standard software writing rules are provided. Insufficient knowledge of the standard leads to difficulties of co-development, and re-use of existing software that does not apply the standard software writing rules makes it difficult to observe the standard software writing rules. There is a problem that fall.
따라서, 개발중이거나 혹은 개발 후의 코드를 분석하고, 그 개발된 소프트웨어가 사전에 서로 약속된 표준 소프트웨어 작성 규칙에 충실하였는지의 여부를 확 인할 수 있는 방법이 필요하다.Therefore, there is a need for a method that can analyze the code during development or after development and determine whether the developed software has adhered to the standard software writing rules promised to each other.
본 발명은 다수의 개발자가 참여하는 소프트웨어 개발 환경에서, 개발중이거나 개발 후의 코드를 분석하여 표준 소프트웨어 작성 규칙에 의거하여 작성되었는지의 여부를 검증하고, 각 개발자가 표준 소프트웨어 작성 규칙에 의거하여 소프트웨어를 개발할 수 있도록 하기 위한 소스 코드 분석방법을 제공하는데 그 목적이 있다.In the software development environment in which a large number of developers participate, the present invention analyzes the code during development or after development, and verifies whether it is written according to the standard software writing rules, and each developer uses the software according to the standard software writing rules. Its purpose is to provide a source code analysis method for development.
또한 본 발명은 서로 다른 표준 소프트웨어 작성 규칙이 적용된 소프트웨어라고 하더라도 표준 소프트웨어 작성 규칙에 위배되는 부분을 검출하여 이를 수정할 수 있도록 제시해 줌으로써, 서로 다른 개발자라고 하더라도 동일한 표준 소프트웨어 작성 규칙을 적용한 소프트웨어를 완성할 수 있도록 하고, 가독성이 확보된 소프트웨어를 개발 할 수 있는 환경을 제공할 수 있도록 한 소스 코드 분석방법을 제공하는데 그 목적이 있다.In addition, the present invention can be detected even if the software is applied to different standard software writing rules, and suggests that it can detect and correct the violation, it is possible for different developers to complete the software applying the same standard software writing rules The purpose of this study is to provide a source code analysis method that can provide an environment for developing software with legibility.
상기 목적을 달성하기 위한 본 발명의 소스 코드 분석방법은, 표준 소프트웨어 작성 규칙 데이터 베이스를 구성하는 단계, 분석 대상이 되는 개발 소프트웨어의 소스 코드를 분석하는 단계, 상기 표준 소프트웨어 작성 규칙과 상기 분석된 소스 코드를 비교하여 작성 규칙 준수 여부를 분석하는 단계, 상기 작성 규칙 준수 여부에 대한 결과를 출력하는 단계: 를 포함하여 이루어지는 것을 특징으로 한다.Source code analysis method of the present invention for achieving the above object comprises the steps of constructing a standard software creation rule database, analyzing the source code of the development software to be analyzed, the standard software creation rules and the analyzed source Comparing the code to analyze the compliance of the writing rule, and outputting a result for compliance with the writing rule: characterized in that comprises a.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 표준 소프트웨어 작성 규칙은 규칙의 특성에 기반하여 다수의 유형별로 분류하여 검증하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the standard software creation rule is characterized by verifying the classification by a plurality of types based on the characteristics of the rule.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 표준 소프트웨어 작성 규칙은 규칙의 특성에 기반하여, 외형 구성, 명명, 설명문, 기타 부칙의 4개 유형으로 분류하여 검증하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the standard software writing rule is characterized by classifying into four types of appearance configuration, naming, description, and other supplementary rules based on the characteristics of the rule.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 외형 구성은 문장이 놓이는 위치, 형태, 간격 등에 관한 정의를 포함하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the appearance configuration is characterized in that it includes a definition of the position, shape, spacing, etc. that the sentence is placed.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 명명 유형은 파일명, 변수명, 함수명, 상수명 등 프로그램 내에서 사용되는 각 토큰(TOKEN)의 이름을 명명하는 규칙에 관한 정의를 포함하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the naming type includes a definition of a rule for naming each token (TOKEN) used in a program such as a file name, a variable name, a function name, a constant name, and the like. It is done.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 설명문 유형은 설명문을 사용할 때의 위치나 형태에 관련된 준수 수항을 제시하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the description type is characterized by suggesting a compliance term related to the position or form when using the description.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 부칙 유형은 상기 외형 구성, 명명, 설명문을 제외한 나머지 작성 규칙에 관한 정의를 포함하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the annex type is characterized in that it includes a definition of the remaining rules, except the appearance configuration, naming, description.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 유형별 작성 규칙 검증을 위하여; 외형 구성 분석모듈, 명명 분석모듈, 설명문 분석모듈, 부칙 분석모듈을 더 포함하는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, for verifying the writing rule for each type; Appearance further comprises a configuration analysis module, naming analysis module, comment analysis module, annex analysis module.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 분석 결과의 출력 은 사용자 인터페이스 화면을 기반으로 하여 이루어지는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the output of the analysis result is characterized in that made on the basis of a user interface screen.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 분석 결과의 출력은 사용자 인터페이스 화면을 기반으로 하여, 적어도 프로젝트 관리창, 편집창, 결과 출력창을 포함하는 것을 특징으로 한다.In the source code analysis method according to the present invention, the output of the analysis result is characterized in that it comprises at least a project management window, an edit window, a result output window based on the user interface screen.
또한 상기 본 발명에 따른 소스 코드 분석방법에서, 상기 분석 결과의 출력은 대상 파일에 대한 통계 자료와 함수 호출 관계를 나타내 주는 것을 특징으로 한다.In addition, in the source code analysis method according to the present invention, the output of the analysis result is characterized in that it represents the statistical data and the function call relationship for the target file.
이와 같이 이루어지는 본 발명의 소스 코드 분석방법의 실시예를 첨부된 도면을 참조하여 상세히 설명하면 다음과 같다.When described in detail with reference to the accompanying drawings an embodiment of the source code analysis method of the present invention made as follows.
본 발명은 앞서 설명한 바와 같이 다수의 개발자가 참여하는 소프트웨어 개발 시, 각 개발자가 분담된 각자의 소프트웨어를 하나의 완성된 소프트웨어로 유기적으로 통합하였을 때 발생할 수 있는 제반 문제점들을 해결하기 위하여, 표준 소프트웨어 작성 규칙을 미리 선정하고, 해당 작성 규칙을 준수하여 각 개발자가 분담된 소프트웨어 개발을 수행하였는지의 여부를 검증하는 시스템이다.As described above, in the development of software in which a large number of developers participate, the standard software is prepared to solve various problems that may occur when each developer organically integrates their respective software into one completed software. It is a system that selects rules in advance and verifies whether each developer has carried out a shared software development by complying with the corresponding writing rules.
즉, 소스 코드 작성 규칙에 대한 준수 여부를 자동으로 검사하는 기능을 포함하고 있으며, 현재 수작업으로 진행되고 있는 피어 리뷰(peer review) 과정을 보완하는 툴로서 사용할 경우 보다 빠른 시간 내에 소스 코드 작성 규칙과 관련된 소스 코드의 결함을 발견해 낼 수 있다.In other words, it includes a function that automatically checks the compliance of the source code writing rules, and when used as a tool to supplement the peer review process that is currently manually performed, it is possible to use the source code writing rules and Detect related source code defects.
소프트웨어 개발 과정은 보통 요구분석, 설계, 코딩, 테스팅, 배포의 과정을 거치며, 이 과정은 한번의 패스로 끝나는 것이 아니라, 특정 단계에서 결함이 발생 했을 때 다시 이전 단계(들)를 수행하는 등, 유지 보수 과정을 반복적으로 수행하게 된다.The software development process usually involves requirements analysis, design, coding, testing, and distribution. This process does not end with a single pass, but rather when the fault occurs at a particular stage, the previous stage (s) is performed again. The maintenance process will be repeated.
최종적인 소프트웨어의 개발 목표는 소프트웨어의 품질을 향상시키는 것이고 각 단계는 나름대로의 방법론을 바탕으로 이 목표를 이루고자 한다. 소프트웨어 테스팅 과정 역시 이러한 노력 중의 한 단계로 소프트웨어 개발 도중에 발생할 수 있는 결함을 가정하고 그러한 오류들을 발견해 내는 활동으로 간주할 수 있다.The ultimate goal of software development is to improve the quality of the software, and each step is based on its own methodology. The software testing process is also a step in this effort, assuming faults that can occur during software development and identifying them as activities.
소프트웨어 테스팅은 크게 정적 테스팅(정적 분석)과 동적 테스팅(동적 분석)으로 나뉜다.Software testing is largely divided into static testing (static analysis) and dynamic testing (dynamic analysis).
정적 테스팅은 소스 코드의 외형을 면밀히 분석함으로써 잠재적인 에러를 검출해 내는 작업으로서, 프로그램의 실행과 연관될 필요가 없는 테스팅을 말한다.Static testing is the task of detecting potential errors by closely analyzing the appearance of source code, and is testing that does not need to be associated with program execution.
본 발명과 같이, 기존의 C언어의 문법에 새로이 준수해야 할 규칙을 추가함으로써 모든 프로그램들이 외형상 일관성을 유지하도록 한 후, 해당 규칙의 준수 여부를 검사하는 것도 정적 분석의 한 예라고 할 수 있다.As in the present invention, it is an example of static analysis that adds a rule to be newly adhered to the syntax of the existing C language so that all programs maintain the appearance consistency and then checks the compliance of the rule. .
이와 같이 정적 테스팅은 일련의 프로그래밍 규칙, 즉 코딩 규칙을 기반으로 하는 것이 대부분이다. 이 외에도 정적 테스팅은 실제로 프로그램을 수행하지 않으면서도 수행 순서에 따라 코드를 따라가면서 여러 가지 결함을 찾아내는 검사를 포함하며, 소스 코드 수준의 여러 가지 통계 자료를 생성하는 활동을 포함한다.As such, static testing is mostly based on a set of programming rules, or coding rules. In addition, static testing involves checking for defects by following code in order of execution without actually executing the program, and includes generating various statistics at the source code level.
동적 테스팅은 프로그램을 실제로 수행시킨 후, 실행되는 과정을 관찰함으로써 프로그램의 문제점을 발견하기 위한 작업을 말하며, 보통 입력 데이터와 출력 데이터로 구성된 테스트 케이스와 함께 수행된다.Dynamic testing refers to the task of finding a problem with a program by actually executing the program and then observing how it is executed, usually with a test case consisting of input data and output data.
본 발명은 주로 프로그램의 가독성을 높이기 위한 외형과 관련된 규칙을 포함하고 있으며, 이를 통한 코드 검증(code inspection)은 정적 분석의 한 종류로서 소프트웨어 테스팅을 위한 초기 단계라고 할 수 있다. 프로그램 코딩 스타일을 일관성있게 유지함으로써 가독성을 높이는 일은 향후 유지 보수 과정에서의 비용을 감소시킬 뿐 아니라, 궁극적으로 에러 검출을 용이하게 함으로써 소프트웨어의 품질을 향상시키는 수단이라 할 수 있다.The present invention mainly includes rules related to appearance for enhancing program readability, and code inspection through this is a kind of static analysis, which is an early stage for software testing. Increasing readability by keeping the programming coding style consistent is a means of improving the quality of the software by reducing the cost of future maintenance and ultimately facilitating error detection.
현재 코드 검증은 피어 리뷰(peer review) 형식으로 수작업에 의해서 수행되고 있으며, 오류 검사를 위한 체크리스트를 사용하고 있다. 본 발명은 수작업으로 수행되고 있는 코드 검증을 보완하는 툴로서, 오류 검사 목록 중 자동화가 가능한 항목들을 자동화함으로써 검사 시간을 대폭 줄이고, 보다 정확하게 검증 작업을 수행할 수 있도록 한다. 또한 코딩 규칙 외에도 대상 파일에 대한 통계 자료와 함수 호출 관계를 나타내 줌으로써 코드 분석을 위한 기초 자료로 활용할 수 있도록 하였다.Currently, code verification is performed by hand in the form of peer review, using a checklist for error checking. The present invention is a tool to complement the code verification that is performed by hand, by reducing the inspection time significantly by automating the items that can be automated in the error check list to be able to perform the verification operation more accurately. In addition to coding rules, statistics and function call relations of target files are shown to be used as basic data for code analysis.
도1은 본 발명에 따른 소스 코드 분석 과정을 보여준다. 제 1 단계(S10)는 표준 소프트웨어(SW) 작성 규칙을 사전에 작성하고, 이 작성된 표준 소프트웨어 작성 규칙을 각각의 개발자들이 숙지하는 단계이다. 제 2 단계(S20)는 각각의 개발자들이 분담하여 소프트웨어 개발을 실행하는 단계이다. 이 단계에서 각 개발자들은 상기 표준 소프트웨어 작성 규칙을 준수해야 하지만, 실제로는 각 개발자 간의 규칙 이해의 정도 차이나, 개발자의 인적 특성 등에 기초하여 볼 때 해당 소프트웨어 작성 규칙을 완벽하게 준수하기는 어렵다.1 shows a source code analysis process according to the present invention. The first step S10 is a step in which a standard software (SW) writing rule is prepared in advance, and each developer is familiar with the written standard software writing rule. The second step (S20) is a step in which each developer shares and executes software development. At this stage, each developer must comply with the above standard software writing rules, but in reality, it is difficult to fully comply with the software writing rules based on the difference in understanding of the rules between the developers, or the personal characteristics of the developers.
제 3 단계(S30)는 소스 코드를 검증하는 단계이다. 즉, 각각의 개발자들이 분담하여 작성한 소프트웨어들을 입력으로 하고, 상기 표준 소프트웨어 작성 규칙을 데이터 베이스로 하여, 각각의 소프트웨어들이 작성 규칙을 준수하고 있는지의 여부를 자동으로 검사하는 일련의 과정이다. 그 첫 단계(S31)는 표준 소프트웨어 작성 규칙을 데이터 베이스화하는 단계이다. 즉, 앞서 제 1 단계(S10)에서 통상 문서의 형태로 작성된 표준 소프트웨어 작성 규칙을 데이터 베이스화 함으로써, 개발된 소프트웨어가 작성 규칙을 준수하고 있는지의 여부를 자동으로 검증할 수 있는 기반을 제공하게 되는 것이다. 다음 단계(S32)는 각각의 개발자가 분담하여 개발된 소프트웨어를 분석하고, 그 분석된 소스 코드를 상기 데이터 베이스화된 표준 소프트웨어 작성 규칙과 비교하는 단계이다. 다음 단계(S33)는 상기 비교 결과 해당 소프트웨어가 표준 소프트웨어 작성 규칙을 준수하고 있는지의 여부를 판별하고, 그 결과를 출력해 줌으로써 각각의 개발자들로 하여금 표준 소프트웨어 작성 규칙에 근거한 소프트웨어 수정 및 완성이 이루어질 수 있도록 하는 단계이다.The third step S30 is a step of verifying the source code. In other words, it is a series of processes for automatically checking whether each of the software complies with the writing rules by using the software written by each developer as input and using the standard software writing rule as a database. The first step S31 is to database the standard software creation rule. In other words, by making a database of standard software writing rules written in the form of a normal document in the first step S10, it provides a basis for automatically verifying whether the developed software complies with the writing rules. . The next step (S32) is to analyze the software developed by each developer, and compare the analyzed source code with the database-based standard software writing rules. The next step (S33) is to determine whether the corresponding software complies with the standard software writing rules as a result of the comparison, and output the results to each developer to modify and complete the software based on the standard software writing rules Steps to make it possible.
제 4 단계(S40)는 위와 같은 검증과 수정 및 보완 과정을 거쳐서 최종적으로 표준 소프트웨어 작성 규칙을 완전하게 준수한, 동일한 코딩 규칙이 일관성 있게 적용된 소프트웨어의 개발이 완료되는 단계이다.The fourth step (S40) is a step in which the development of software consistently applying the same coding rules that completely comply with the standard software creation rules through the above verification, modification and supplementation process is completed.
도2는 본 발명에 따른 소스 코드 검증 시스템의 구성을 보여준다. 본 발명의 소스 코드 검증 시스템은 그 실시예로, 개발 환경에서 운영체제로 윈도우 98, 2000, XP 등을 사용하였고, 컴파일러는 Visual C++ 6.0을 사용하였으며, 라이브러리(소스 코드 분석기)는 Lex[Flex], Yacc[Bison], 라이브러리(화면 인터페이스)로 는 Visual C++ MFC를 기반으로 하였다. 또한 본 발명에 따른 소스 코드 검증 시스템의 사용 환경은 운영체제로 윈도우 98, 2000, XP 등을 사용할 수 있고, 하드웨어로는 256M RAM 이상을 기반으로 한다.2 shows a configuration of a source code verification system according to the present invention. As an example, the source code verification system of the present invention used Windows 98, 2000, XP, etc. as the operating system in the development environment, the compiler used Visual C ++ 6.0, and the library (source code analyzer) was Lex [Flex], Yacc [Bison], a library (screen interface), is based on Visual C ++ MFC. In addition, the operating environment of the source code verification system according to the present invention can be used as the operating system Windows 98, 2000, XP, etc., the hardware is based on more than 256M RAM.
도2를 참조하면 본 발명에 따른 소스 코드 검증 시스템은 소스 코드(10), 소스코드 분석기(20), 사용자 인터페이스(30)로 이루어진다. 소스 코드 분석기(20)는 앞서 설명한 표준 소스트웨어 작성 규칙(DB)(21)을 포함한다. 또한 소스 코드 분석기(20)는 표준 소프트웨어 작성 규칙의 유형별로 해당 소스 코드의 분석을 수행하기 위한 모듈을 포함하는 구성도 가능한데, 예를 들면 표준 소프트웨어 작성 규칙을 효율적으로 검증하기 위하여, 외형 구성, 명명 구성, 설명문, 부칙 등의 4개 유형으로 나누어 검증한다고 가정할 때, 각각에 대한 외형 구성 분석 모듈(210), 명명 분석 모듈(220), 설명문 분석 모듈(230), 부칙 분석 모듈(240)을 포함한다.Referring to FIG. 2, the source code verification system according to the present invention includes a
도3은 상기 사용자 인터페이스(30)의 예를 보여준다. 이 사용자 인터페이스를 살펴보면 프로젝트 관리창(100), 편집창(200), 결과 출력창(300)으로 구성됨을 알 수 있다. 프로젝트 관리창(100)은 작업 대상 관리를 위한 것으로, 현재 편집 중인 대상 파일에 관한 정보를 표현해 주며, 편집창(200)은 해당 소스 코드를 표현해 주며, 결과 출력창(300)은 표준 코딩 규칙을 잘 적용하고 있는지의 여부, 특히 작성 규칙을 위배한 경우 해당 내용을 표현해 주고 있다.3 shows an example of the
다음의 표1은 표준 소프프웨어 작성 규칙을 유형별로 분류한 예를 보여준다. 본 발명에서는 표준 소프트웨어 작성 규칙을 외형 구성, 명명(이름 붙이기), 설명문, 기타(부칙)의 4개 유형으로 구분하였다. 외형 구성은 문장이 놓이는 위치, 형 태, 간격 등에 관한 정의이며, 향후 프로그램 재검토 시 논리적 흐름에 대한 효과적인 검토가 가능하게 한다.Table 1 below shows an example of categorizing standard software writing rules by type. In the present invention, the standard software writing rules are divided into four types: appearance configuration, naming (naming), description, and other (additional rules). The appearance structure is the definition of the position, shape, and spacing where the sentence is placed, and enables the effective review of the logical flow in the future review of the program.
아래의 표2는 외형 구성에 관한 세부 규칙의 예를 보여준다.문장의 구조를 비롯하여 문장이 놓이는 위치와 형태 및 간격 등에 관해서 정의하고 있음을 알 수 있다.Table 2 below shows an example of the detailed rules regarding the composition of the appearance: it can be seen that it defines the structure of the sentence as well as the position, form, and spacing of the sentence.
외형 구성의 세부 규칙은 들여쓰기, 제어문과 반복문의 깊이 제한, 제어문 내 조건문의 다음 줄 이동, 제어문 및 반복문 내에서의 주석 사용, 스위치(switch) 문에서의 디폴트(default) 문 사용, 단순 배정 문의 '=' 정렬, 리스트 내에서의 공백 사용, 수식 중간에서의 줄바꿈, 함수 호출문에서의 다음 줄 위치, 변수 선언 시 정렬, 파일 내 구성 요소들의 순서, 제어문 및 반복문 시작 시 블록 사용, 무한 루프, 재귀 호출, 라인당 하나의 문장 사용 등에 관한 규칙을 제시한다.The detailed rules of appearance configuration include indentation, limiting the depth of control and loop statements, moving the next line of conditional statements within control statements, using comments within control and loop statements, using default statements in switch statements, and simple assignment statements. '=' Sorting, whitespace in lists, line breaks in formulas, next line position in function invocations, sorting when declaring variables, ordering of components in files, using blocks at the beginning of control and loop statements, infinite loops Rules about recursive calls, the use of one statement per line, and so on.
세부 규칙에 관한 사항 중에서 한 가지 예를 들어, 들여쓰기 규칙의 경우는 각 라인 별 수준에 맞게 들여쓰기를 해야 한다는 규칙이며, 이는 프로그램의 가독성을 높이기 위한 목적에 의하고, 에러와 경고의 구분은 에러로 처리하기로 하며, 참고 사항으로 옵션을 통해 탭의 크기를 지정할 수 있다는 등의 규칙을 정의한다.For example, in the case of indentation rule, the indentation rule should be indented at the level of each line. This is for the purpose of improving program readability. The distinction between error and warning is error. As a reference, define rules such as specifying the size of a tab through options.
앞서 나열한 외형 구성의 제반 규칙들은 실제로 특정 프로그램에 의존적일 수 있는 사항이고, 여기에 설명되는 내용으로 제한될 수는 없을 것이다. 그렇지만, 궁극적으로는 특정 소프트웨어 개발과 관련하여 사용하는 코딩 규칙의 다양성이 전제되기 때문에, 표준 소프트웨어 작성 규칙의 세부 내용은 얼마든지 적응적으로 변경될 수 있다. 비록 변경된다고 하더라도 본 발명에서 제안하는 방법을 토대로 하여 소스 코드 검증이 이루어질 것임은 당해 기술분야에서 너무나 자명한 사항에 해당한다.The rules of appearance outlined above are actually things that may be dependent on a particular program and should not be limited to what is described here. However, because of the premise of the variety of coding rules used in relation to specific software development, the details of standard software writing rules can be changed adaptively. Although changed, it is too obvious in the art that source code verification will be performed based on the method proposed by the present invention.
다음의 표3은 명명(이름 붙이기)에 관한 세부 규칙의 예를 보여준다. 명명에 관한 규칙은 파일명, 변수명, 함수명, 상수명 등 프로그램 내에서 사용되는 각 토큰(TOKEN)의 이름을 작성하는 규칙이다. 이로써 이름만으로도 의미 파악이 가능하게 한다.Table 3 below shows an example of the detailed rules for naming. The naming convention is the convention for creating the names of each token (TOKEN) used in the program, including file names, variable names, function names, and constant names. This makes it possible to grasp the meaning only by name.
명명에 관한 세부 규칙은 변수와 함수 이름의 길이, 파일 이름에 '_' 사용 금지, 변수 이름에 '_' 사용금지, 변수 이름의 첫 글자로 소문자 사용, Multi-purpose 변수 이름에 관한 규칙(Multi-purpose 변수의 경우 [range][type][변수명]의 순서로 구성], 상수 이름은 대문자 사용, 함수 이름의 첫 글자는 대문자 사용, 함수 이름에 '_' 사용금지 등의 규칙이 적용된다.Detailed rules for naming include the length of variable and function names, the use of '_' in file names, the use of '_' in variable names, the use of lowercase letters as the first letter of variable names, and the rules for multi-purpose variable names. -purpose variable consists of [range] [type] [variable name]], constant name should be capitalized, first letter of function should be capitalized, '_' not allowed in function name, etc. .
또한, 함수 이름 명명 규칙(함수 이름은 [layer]_[module]_[function name]의 순으로 구성], 함수 및 변수명은 대문자로만 구성 금지, 수식에 숫자 사용 금지, 부울 변수의 명명 규칙(부울 변수는 참, 거짓을 암시하는 이름 사용), 열거형 상수의 명명 규칙(열거형 멤버의 이름은 동일한 접두사나 접미사를 갖도록 함), 사용되지 않는 지역변수(함수 내에서 사용되지 않는 지역변수가 있어서는 안됨), 사용되지 않는 전역변수(함수 내에서 사용되지 않는 전역변수가 있어서는 안됨), 호출되지 않는 함수(정의된 함수는 반드시 1회 이상 호출되어야 함) 등에 관한 규칙이 적용된다.Also, function name naming conventions (function names are organized in the order of [layer] _ [module] _ [function name]]; function and variable names must not be capitalized only; no numbers can be used in formulas; Variables use names that imply true or false), naming conventions for enumerated constants (enumerate enum members have the same prefix or suffix), unused local variables (unless local variables are used within a function Rules for unused global variables (must not have unused global variables within a function), uncalled functions (defined functions must be called more than once), and so on.
다음의 표4는 설명문에 관한 세부 규칙의 예를 보여준다. 설명문 규칙은 설명문을 사용할 때의 위치나 형태와 관련된 준수 사항을 제시한다. 이로써, 코드 자체만으로 설명이 부족한 경우에 대응할 수 있고, 설명문을 사용함으로써 소스 코드를 읽는 작업자의 이해를 도울 수 있는 기반을 조성해 준다.Table 4 below shows an example of the detailed rules of explanation. The comment rule sets out the requirements regarding the location or form of the comment. In this way, the code itself can cope with a lack of explanation, and the description can be used as a basis for helping the reader to understand the source code.
설명문에 관한 세부 규칙으로는 한 줄로 주석을 기록할 경우에 "//"를 사용한다던가, 두 줄 이상에 걸쳐 주석을 기록할 경우에는 "/**/"을 사용한다던가, 특수한 경우에만 문장 끝에 주석을 사용(코드 문장과 같은 라인에 주석을 기록할 수 있는 경우로는 변수 선언, 반복문의 끝일 경우만 허용한다는 의미) 한다던가, 특정 경우에만 End-line 설명문 사용이 가능하다는 등의 규칙을 정의한다.For detailed rules about comments, use "//" to write comments on a single line, "/ ** /" to write comments on more than one line, or comment at the end of a sentence only in special cases. Define rules such as declaring variables in the case where comments can be written on the same line as a code statement, allowing only at the end of a loop statement, or using end-line descriptions only in certain cases. .
다음의 표5는 부칙(기타)에 관한 세부 규칙의 예를 보여준다. 이는 앞서 설명한 외형 구성, 명명, 설명문 등의 유형에 속하지 않는 여러 가지 규칙들을 포함한다.Table 5 below shows an example of the detailed rules for additional rules. It includes a number of rules that do not belong to the type of appearance, naming, description, etc. described above.
여기에는 헤더 파일에서 헤더 파일 포함을 금지한다던가, goto문 사용 금지에 관한 규칙, 조건문 내에서 TRUE,FALSE의 사용을 금지한다던가, 정수형에 대한 재정의의 허용에 관한 내용, 참, 거짓을 위한 문자 상수의 정의에 관한 내용, Bmp 데이터의 포함을 금지시키는 내용(즉, bmp와 같은 데이터 파일과 소스 코드를 분리하여 처리), 구조체 선언 시 중첩 제한에 관한 내용, 소스 파일 내에서 형 정의 및 전역 변수 사용 금지에 관한 내용, #ifdef, #else, #endif 사용을 금지한다는 내용, #define 상수의 관리에 관한 내용, #if, #elif 문에서 0,1 사용을 금지하는 내용, 파일당 라인 수의 제한에 관한 내용, 라인당 문자수 제한에 관한 내용, 알려지지 않은 에러에 관한 내용 등을 정의한다.This includes prohibiting the inclusion of header files in header files, rules on the prohibition of using goto statements, prohibiting the use of TRUE and FALSE in conditional statements, and allowing permission to redefine integers. The definition of constants, the prohibition of inclusion of Bmp data (that is, separate source code from data files such as bmp), nesting restrictions when declaring structures, type definitions and global variables within source files Information about prohibition of use, information about prohibiting the use of #ifdef, #else, and #endif, information about managing #define constants, prohibiting the use of 0,1 in #if and #elif statements, and the number of lines per file. Defines the limit, the limit on the number of characters per line, and the unknown error.
지금까지 설명한 바와 같이 소스 코드 검증을 위하여 표준 소프트웨어 작성 규칙을 4개의 유형으로 구분하고, 각각의 유형별 세부 규칙을 적용하여 해당 소프트웨어가 그 작성 규칙을 준수하고 있는지의 여부를 판단할 수 있게 된다.As described above, the standard software writing rules are divided into four types for source code verification, and detailed rules for each type are applied to determine whether the corresponding software complies with the writing rules.
앞서 설명한 표준 소프트웨어 작성 규칙의 예를 토대로 하여, 도1 및 도2의 소스 코드 검증 시스템 동작을 보다 더 상세하게 살펴본다.Based on the example of standard software writing rules described above, the operation of the source code verification system of FIGS. 1 and 2 will be described in more detail.
각각의 개발자들은 분담된 소프트웨어를 개발하고 그 개발된 소프트웨어의 소스 코드(10)가 본 검증 시스템의 입력으로 제공된다. 사용자 인터페이스(20)는 도3에 예시한 바와 같은 인터페이스 화면을 토대로 하여 사용자와 검증 시스템 간의 인터페이스를 제공한다.Each developer develops a shared software and
소스코드 분석기(20)는 데이터 베이스로 구축된 상기 작성 규칙(21)을 가지고 있다. 소스코드 분석기(20)는 효율적인 검증을 위하여 상기 작성 규칙의 각 유형별로 분석 모듈을 구비할 수 있다.The
입력된 소스코드(10)는 외형구성 분석모듈(210)에 의해서 그 소프트웨어의 외형 구성이 분석(parsing)된다. 분석된 소스코드 외형 구성은 작성규칙(21)의 외형 구성 규칙(표2 참조)과 비교된다. 작성규칙(21)의 외형 구성 규칙과 분석된 소스코드 외형 구성의 비교 결과는 결과 출력창(300)에 그 규칙을 위배한 내용에 대하여 상세하게 표시된다.The
입력된 소스코드(10)는 명명 분석모듈(220)에 의해서 그 소프트웨어의 명명 구성이 분석된다. 분석된 소스코드 명명 구성은 작성규칙(표3 참조)과 비교된다. 작성규칙(21)의 명명 구성 규칙과 상기 분석된 소스코드 명명 구성의 비교 결과는 결과 출력창(300)에 그 규칙을 위배한 내용에 대하여 상세하게 표시된다.The
입력된 소스코드(10)는 설명문 분석모듈(230)에 의해서 그 소프트웨어의 설명문 구성이 분석된다. 분석된 소스코드 설명문 구성은 작성규칙(표4 참조)과 비교된다. 작성규칙(21)의 설명문 구성과 상기 분석된 소스코드 설명문 구성의 비교 결과는 결과 출력창(300)에 그 규칙을 위배한 내용에 대하여 상세하게 표시된다.The
입력된 소스코드(10)는 부칙 분석모듈(240)에 의해서 그 소프트웨어의 기타 구성들이 분석된다. 분석된 소스코드 구성은 작성규칙(표5 참조)과 비교된다. 작성규칙(21)의 기타 부칙들과 상기 분석된 소스코드 구성의 비교 결과는 결과 출력창(300)에 그 규칙을 위배한 내용에 대하여 상세하게 표시된다.The
이와 같은 검증 결과는 각각의 소프트웨어 개발자들에게 통지되며, 각 개발자들은 이 검증 결과를 토대로 하여 해당 규칙에 위배된 내용들을 작성규칙에 근거하여 수정 및 보완하게 된다.Such verification results are notified to each software developer, and each developer can revise and supplement the violation of the rules based on the written rules based on the verification results.
그리고, 다시 위와 같은 검증 과정을 반복함으로써, 표준 소프트웨어 작성규칙에 위배된 사항이 발견되지 않았을 경우, 해당 소프트웨어의 유기적 통합이 이루어진다.Then, by repeating the above verification process, if a violation of the standard software writing rules is not found, the organic integration of the corresponding software is performed.
물론, 다수의 개발자들이 분담하여 개발한 소프트웨어의 유기적 통합 후, 상기 완성된 소프트웨어에 대해서도 위와 같은 검증 과정을 거치게 함으로써, 최종적으로 완전하게 작성규칙이 준수된 소프트웨어를 개발 완료할 수 있게 될 것이다.Of course, after the organic integration of the software shared by a number of developers, the completed software is subjected to the above verification process, and finally, the software that completely complies with the rules of writing will be developed and completed.
본 발명은 서로 다른 표준 소프트웨어 작성 규칙이 적용된 소프트웨어라고 할지라도 그 소스코드의 작성규칙 준수 여부를 자동으로 검증하고 그 결과를 제공해 줌으로써, 분담 개발된 소프트웨어의 수정 및 보완 작업이 용이하게 된다.According to the present invention, even if software having different standard software writing rules is applied, it automatically checks whether the source code complies with the writing rules and provides the result, thereby making it easy to modify and supplement the developed software.
따라서, 소프트웨어 개발 시간의 절약과 효율성 제고에 도움이 될 수 있으며, 특히 서로 다른 표준 소프트웨어 작성규칙을 적용한 소프트웨어를 생산할 수 있게 되어 가독성이 뛰어난 소프트웨어 개발 기반이 제공된다.Therefore, it can help to save time and efficiency of software development, and in particular, it is possible to produce software with different standard software writing rules, thus providing a highly readable software development foundation.
또한, 일관성있는 표준 소프트웨어 작성 규칙의 적용으로, 분담 개발된 소프트웨어 간의 유기적 통합과 수정, 보완, 검증 등의 효율성을 극대화할 수 있다.In addition, the application of consistent standard software writing rules can maximize the efficiency of organic integration, modification, complementation, and verification among shared software.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020050036083A KR20060113168A (en) | 2005-04-29 | 2005-04-29 | Source code analysys for source code inspector |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020050036083A KR20060113168A (en) | 2005-04-29 | 2005-04-29 | Source code analysys for source code inspector |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20060113168A true KR20060113168A (en) | 2006-11-02 |
Family
ID=37651569
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020050036083A KR20060113168A (en) | 2005-04-29 | 2005-04-29 | Source code analysys for source code inspector |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20060113168A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011152980A2 (en) * | 2010-06-01 | 2011-12-08 | Microsoft Corporation | Static analysis using interactive and integration tools |
KR101690075B1 (en) * | 2015-12-18 | 2016-12-27 | 주식회사 한글과컴퓨터 | Method for materialization issues in the source code files based on log |
KR101984294B1 (en) * | 2017-12-19 | 2019-05-30 | 광운대학교 산학협력단 | System and method for analyzing source code based on dynamic analysis |
CN113204484A (en) * | 2021-04-30 | 2021-08-03 | 中国航天系统科学与工程研究院 | Software life cycle-oriented equipment software testability design method |
-
2005
- 2005-04-29 KR KR1020050036083A patent/KR20060113168A/en active Search and Examination
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011152980A2 (en) * | 2010-06-01 | 2011-12-08 | Microsoft Corporation | Static analysis using interactive and integration tools |
WO2011152980A3 (en) * | 2010-06-01 | 2012-03-08 | Microsoft Corporation | Static analysis using interactive and integration tools |
US8443342B2 (en) | 2010-06-01 | 2013-05-14 | Microsoft Corporation | Static analysis using interactive and integration tools |
KR101690075B1 (en) * | 2015-12-18 | 2016-12-27 | 주식회사 한글과컴퓨터 | Method for materialization issues in the source code files based on log |
KR101984294B1 (en) * | 2017-12-19 | 2019-05-30 | 광운대학교 산학협력단 | System and method for analyzing source code based on dynamic analysis |
CN113204484A (en) * | 2021-04-30 | 2021-08-03 | 中国航天系统科学与工程研究院 | Software life cycle-oriented equipment software testability design method |
CN113204484B (en) * | 2021-04-30 | 2023-11-14 | 中国航天系统科学与工程研究院 | Software life cycle oriented equipment software testability design method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7512929B2 (en) | Apparatus and method for managing design of a software system using dependency structure | |
US9037915B2 (en) | Analysis of tests of software programs based on classification of failed test cases | |
US20180300226A1 (en) | System and method for equivalence class analysis-based automated requirements-based test case generation | |
US20080046867A1 (en) | Software testing by groups | |
CN109189479B (en) | Parallel automatic verification method for processor instruction set | |
US10664382B2 (en) | System and method for tool chain data capture through parser for empirical data analysis | |
JP2012208830A (en) | Program test device, program test method and program | |
Alcocer et al. | Performance evolution matrix: Visualizing performance variations along software versions | |
CN111414402A (en) | Log threat analysis rule generation method and device | |
KR20060113168A (en) | Source code analysys for source code inspector | |
US6853963B1 (en) | Analyzing an extended finite state machine system model | |
JP2012190063A (en) | Data generation device and data generation program | |
Black | Static analyzers: Seat belts for your code | |
Kelly et al. | A case study in the use of defect classification in inspections | |
CN110659200B (en) | Method and system for comparing and analyzing source code and target code of aviation onboard software | |
Flemström et al. | Exploring test overlap in system integration: An industrial case study | |
US8645815B2 (en) | GUI evaluation system, GUI evaluation method, and GUI evaluation program | |
Kudrjavets et al. | The unexplored terrain of compiler warnings | |
CN105389164B (en) | Computer-implemented method for generating control device program code and related message management environment | |
Holl et al. | Constraint checking in distributed product configuration of multi product lines | |
Larrea et al. | White-Box Testing Framework for Object-Oriented Programming. An Approach Based on Message Sequence Specification and Aspect Oriented Programming | |
Hayat et al. | A goal based framework by adopting square process for privacy and security requirement engineering | |
Hovorushchenko et al. | Information technology for prediction of software quality level | |
CN112100086B (en) | Software automation test method, device, equipment and computer readable storage medium | |
KR102610914B1 (en) | Method for automatic test scenario generation from hysteresis curve |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
AMND | Amendment | ||
E601 | Decision to refuse application | ||
J201 | Request for trial against refusal decision | ||
AMND | Amendment | ||
E801 | Decision on dismissal of amendment | ||
B601 | Maintenance of original decision after re-examination before a trial | ||
J301 | Trial decision |
Free format text: TRIAL DECISION FOR APPEAL AGAINST DECISION TO DECLINE REFUSAL REQUESTED 20070425 Effective date: 20071217 |