JPS63131239A - Method for deciding quality of program - Google Patents

Method for deciding quality of program

Info

Publication number
JPS63131239A
JPS63131239A JP61276984A JP27698486A JPS63131239A JP S63131239 A JPS63131239 A JP S63131239A JP 61276984 A JP61276984 A JP 61276984A JP 27698486 A JP27698486 A JP 27698486A JP S63131239 A JPS63131239 A JP S63131239A
Authority
JP
Japan
Prior art keywords
information source
program
probability
generation
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP61276984A
Other languages
Japanese (ja)
Inventor
Mikio Okada
幹夫 岡田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP61276984A priority Critical patent/JPS63131239A/en
Publication of JPS63131239A publication Critical patent/JPS63131239A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To decide the abnormality of a program and the cause of abnormality before a program test by comparing the probability of the generation of information source elements constituting a program with the probability of the generation in a normal state. CONSTITUTION:A source program stored in a source code holding part 1 is decomposed into the information source elements in a following information source element decomposition part 2. The decomposed information source element data is inputted in a statistical data generation part 3 so that the probability of the generation every information source element is obtained based on the inputted data. The probability of the generation every information source element is obtained by dividing the total of the respective information source elements by the total of all the information source elements. A statistical analysis part 6 receives the probability of the generation every information element generated by the statistical data generation part 3 and forms a generation probability distribution figure. A comparison part 5 compares the distribution data of a standard distribution holding part 4 with the above-mentioned generation probability data.

Description

【発明の詳細な説明】 [概要] プログラムの品質判定方法であって、プログラムを構成
する情報源要素の発生確率を標準状態における発生確率
と比較してプログラムテストに入る前の段階でその品質
を判定する。
[Detailed Description of the Invention] [Summary] A method for determining the quality of a program, which compares the probability of occurrence of information source elements constituting the program with the probability of occurrence in a standard state to evaluate its quality at a stage before program testing. judge.

[産業上の利用分野] 本発明はプログラムの品質判定方法に関する。[Industrial application field] The present invention relates to a method for determining the quality of a program.

プログラムが大規模化するに伴って、テスト工数や保守
費用の削減のために、作成されたプログラムの品質を早
期に判定する方法が必要となってきた。従来は作成され
たプログラムを、テストの段階に入ってからその品質判
定を行っていた。しかしながら、プログラムテストの段
階に入ってからのプログラムの変更は容易でない場合が
多い。そこで、プログラム変更が比較的容易なプログラ
ムテストの前の段階での品質判定が要請される。
As programs have become larger in scale, there has been a need for a method to quickly determine the quality of created programs in order to reduce testing man-hours and maintenance costs. Conventionally, the quality of a created program was judged after it entered the testing stage. However, it is often not easy to change the program once it has entered the program testing stage. Therefore, quality determination is required at a stage prior to program testing, where program changes are relatively easy.

[従来の技術] 第6図は従来のプログラムの品質判定方法を示すフロー
チャートである。先ず、プログラムをオペレータとオペ
ランドに分解しくステップ(1))、分解したオペレー
タ、Aベランドを基に統計解析データを作成する(ステ
ップ■)。統計解析データが作成されたら、次にこの作
成した統計解析データを標準値と比較してプログラム品
質を判定する(ステップ■)。
[Prior Art] FIG. 6 is a flowchart showing a conventional program quality determination method. First, a program is decomposed into operators and operands (step (1)), and statistical analysis data is created based on the decomposed operators and A verandos (step (2)). Once the statistical analysis data has been created, the program quality is determined by comparing the created statistical analysis data with standard values (step ■).

第7図はオペレータの種類数と総数との関係をプロット
した図である。図中の゛・”点が1個のコンパイル単位
を表わしている。「1は統計回折プログラムを用いて作
成した近似曲線、破1!A領域は異常プログラムを示す
領域である。図中に示す数字は障害発生数を示している
。尚、第7図に示すようなプロットはオペランド総数と
オペランド種類数、オペランド総数とオペレータ総数、
オペランド種類数とオペレータ種類数についても作成で
き、これらプロットを基に異常プログラムの範囲を定め
ることができる。
FIG. 7 is a diagram plotting the relationship between the number of types of operators and the total number. The point ゛・'' in the figure represents one compilation unit. ``1 is an approximate curve created using a statistical diffraction program, broken 1!A region is an area indicating an abnormal program. The numbers indicate the number of failures.The plot shown in Figure 7 shows the total number of operands and the number of operand types, the total number of operands and the total number of operators,
The number of operand types and the number of operator types can also be created, and the range of abnormal programs can be determined based on these plots.

[発明が解決しようとする問題点] 従来のプログラムの品質判定方法は、オペレータ、オペ
ランドの種類数、総数に注目していたため異常プログラ
ムの抽出は可能であるが、抽出されたプログラムがどの
ように異常であるかを判定することは不明であった。従
って、プログラムの異常原因をつきとめたい場合にはソ
ースコードを克己して再度検討する必要があった。
[Problems to be solved by the invention] Conventional methods for determining program quality focus on the number of types and total number of operators and operands, making it possible to extract abnormal programs. It was unclear whether it was abnormal or not. Therefore, in order to find out the cause of a program abnormality, it was necessary to examine the source code again.

本発明はこのような点に鑑みてなされたものであって、
プログラムの異常及び異常原因を判定することができる
プログラムの品質判定方法を提供することを目的として
いる。
The present invention has been made in view of these points, and
It is an object of the present invention to provide a method for determining the quality of a program that can determine an abnormality in a program and the cause of the abnormality.

〔問題点を解決するための手段〕[Means for solving problems]

第1図は本発明方法の原理を示すフローチャートである
。先ず、プログラム(ソースプログラム)を情報源要素
毎に分解する(ステップ■)。ここで、情報源要素とは
例えば IF、Do、算術演算子、論理演算子、比較演輝子、算
術データ、列データ、ラベルデータ 等のプログラムを記述する因子をいう。プログラムを情
報源要素に分解したら、次に分解した情報源要素を各要
素毎に加算して各情報源要素の発生確率を求める(ステ
ップ■)。各情報源要素の発生確率は、各情報源要素の
総数を全ての情報源要素の総数で割ることにより算出で
きる。
FIG. 1 is a flow chart showing the principle of the method of the present invention. First, a program (source program) is decomposed into information source elements (step 2). Here, the information source elements refer to factors that describe programs such as IF, Do, arithmetic operators, logical operators, comparison operators, arithmetic data, column data, and label data. Once the program has been decomposed into information source elements, the decomposed information source elements are then added up for each element to determine the probability of occurrence of each information source element (step ■). The probability of occurrence of each information source element can be calculated by dividing the total number of each information source element by the total number of all information source elements.

次に求めた情報源要素毎の発生確率を標準確率分布と比
較してプログラムの品質判定を行う(ステップ■)。標
準確率分布は正常なプログラムにおける各情報源要素の
発生確率を予め求めておいたもので、この標準確率分布
の範囲を基準値として、この範囲を求めた情報源要素の
発生確率がはみ出した場合にはプログラムが異常だとい
うことになる。
Next, the quality of the program is determined by comparing the obtained probability of occurrence for each information source element with the standard probability distribution (step 2). The standard probability distribution is a predetermined probability of occurrence of each information source element in a normal program, and the range of this standard probability distribution is used as the reference value, and the probability of occurrence of the information source element calculated within this range is calculated in advance. If so, it means that the program is abnormal.

[作用] プログラムを構成する情報源要素の発生確率を標準状態
における発生確率と比較する。
[Operation] The probability of occurrence of the information source elements that make up the program is compared with the probability of occurrence in the standard state.

[実施例] 以下、図面を参照して本発明の実施例を詳細に説明する
[Example] Hereinafter, an example of the present invention will be described in detail with reference to the drawings.

第2図は、本発明方法を実施するシステム構成の一例を
示す図である。図において、1はソースプログラムを格
納するソースコード保持部、2はソースコード保持部1
に格納されているプログラムを読出して情報源要素に分
解する情報源要素分解部、3は情報源要素分解部2によ
り分解された情報源要素を各要素毎に加詐して発生確率
を求める統計データ作成部である。
FIG. 2 is a diagram showing an example of a system configuration for implementing the method of the present invention. In the figure, 1 is a source code holding unit that stores a source program, and 2 is a source code holding unit 1.
An information source element decomposition unit reads out a program stored in the computer and decomposes it into information source elements, and 3 is a statistic that calculates the probability of occurrence by modifying the information source elements decomposed by the information source element decomposition unit 2 for each element. This is the data creation section.

4は各情報源要素毎の標準的な発生確率データ(標準確
率分布)を格納する標準分布保持部、5は統計データ作
成部3から出力される各情報源要素毎の発生確率データ
と、標準分布保持部4から出力される標準確率分布とを
比較する比較部である。6は統計データ作成部3から出
力される各情報源要素毎の発生確率データを受けて発生
確率分布図を作成する統tt W?析部、7は比較部5
の出力及び統計解析部6の出力を受け、岐倹査プログラ
ムの品質の判定結果と発生確率分布図データを出力する
判定耶である。このように構成された装置の動作を説明
すれば、以下の通りである。
4 is a standard distribution holding unit that stores standard probability of occurrence data (standard probability distribution) for each information source element; 5 is occurrence probability data for each information source element output from the statistical data creation unit 3; This is a comparison unit that compares the standard probability distribution output from the standard distribution holding unit 4. 6 is a system that receives occurrence probability data for each information source element output from the statistical data creation section 3 and creates an occurrence probability distribution map. Analysis part, 7 is comparison part 5
This is a judgment unit that receives the outputs of the output and the output of the statistical analysis unit 6 and outputs the judgment result of the quality of the gif test program and the occurrence probability distribution map data. The operation of the device configured as described above will be explained as follows.

ソースコード保持部1に格納されていたソースプログラ
ムは、続く情報源要素分解部2で情報源要素に分解され
る。情報源要素分解部2で分解された各情報源要素デー
タは、統計データ作成部3に入る。統計データ作成部3
ば、入力データを基に各情報源要素毎の発生l1g串を
求める。@述したように、各情報源要素の発生確率は、
各情報源要素の総数を全ての情報源要素の総数で割るこ
とにより算出できる。
The source program stored in the source code holding unit 1 is decomposed into information source elements by the subsequent information source element decomposition unit 2. Each information source element data decomposed by the information source element decomposition section 2 enters the statistical data creation section 3. Statistical data creation section 3
For example, the occurrence of l1g for each information source element is determined based on the input data. @As mentioned above, the probability of occurrence of each information source element is
It can be calculated by dividing the total number of each information source element by the total number of all information source elements.

第3図、第4図はそれぞれ情報源要素である比較演算子
の度数分布例、DOオペレータの度数分布例を示す図で
ある。第3図の比較演算子の度数分布について説明する
。図において、縦軸は度数を、横軸は%をそれぞれ示し
ている。例えば8%の場合には、1個のプログラム単位
中の総情報源要素中の比較演算子の占める比率が8%以
上、10%未満であることを意味する。そして8%での
ところの度数18は、比較演算子の占める比率が8%以
上、10%未満であるプログラム単位が18個あったこ
とを示している。図より比較演算子の占める比率は12
%以上、14%未満の場合が一番多いことがわかる。従
って、比較演算子の占める比率が12%以上、14%未
満であるプログラムが通常であると言える。第4図のD
oオペレータの度数分布図についても同様である。
FIGS. 3 and 4 are diagrams showing an example of the frequency distribution of a comparison operator and a DO operator, respectively, which are information source elements. The frequency distribution of the comparison operators in FIG. 3 will be explained. In the figure, the vertical axis indicates frequency and the horizontal axis indicates percentage. For example, in the case of 8%, it means that the proportion of comparison operators in the total information source elements in one program unit is 8% or more and less than 10%. The frequency of 18 at 8% indicates that there were 18 program units in which the ratio of comparison operators was 8% or more and less than 10%. From the figure, the ratio of comparison operators is 12
It can be seen that the most common cases are % or more and less than 14%. Therefore, it can be said that a program in which the ratio of comparison operators is 12% or more and less than 14% is normal. D in Figure 4
The same applies to the frequency distribution diagram of the o operator.

統計解析部6は、統δ1データ作成部3により作成され
た各情報源要素毎の発生確率データを受けて、発生確率
分布図を作成づる。第5図はこのようにして作成された
発生確率分布の一例を示す図である。図において、横軸
は情報源要素の種類を、縦軸が発生確率を示す。図中、
実線で示すf!が?PI!、:+ll1l!プログラム
の発生確率分布曲線、破線で示すf2が4F!準確率分
布曲線である。標準確率分布曲線r2は、被計測プログ
ラムと同一の言語で書かれた過去のプログラムを基に作
成したものである。このグラフにより情報源要素のどの
要素に使い方の異常があるかを検出できる。比較演算子
の場合を例にとって説明すると、縦方向の線分lは標準
確率分布曲線f2がとり得る範囲を示す。即ち、被計測
プログラムの発生確率分布「1がr2に七分近()れば
、比較演算子についてはそのプログラムは正常、「2か
ら大きく離れれば異常ということになる。
The statistical analysis unit 6 receives the occurrence probability data for each information source element created by the statistical δ1 data creation unit 3 and creates an occurrence probability distribution map. FIG. 5 is a diagram showing an example of the occurrence probability distribution created in this manner. In the figure, the horizontal axis indicates the type of information source element, and the vertical axis indicates the probability of occurrence. In the figure,
f! shown by a solid line. but? PI! , :+ll1l! In the program occurrence probability distribution curve, f2 shown by the broken line is 4F! It is a quasi-probability distribution curve. The standard probability distribution curve r2 is created based on a past program written in the same language as the program to be measured. Using this graph, it is possible to detect which of the information source elements has an abnormal usage. Taking the case of a comparison operator as an example, a vertical line segment l indicates a range that the standard probability distribution curve f2 can take. In other words, if the occurrence probability distribution of the measured program is ``1'' close to r2 by 7 minutes, then the program is normal in terms of the comparison operator, and ``if it is far away from 2, it is abnormal.''

比較部5は標準分布保持部4より出力される標準確率分
布データと、統計データ1v成部3より出力される情報
源要素の発生確率データとを各情報源要素毎に比較し、
その比較結果を判定部7に出力する。判定部7は比較部
5からの比較結果を基に被検査プログラムが異常である
か正常であるかを判定し、その結果を出力する。例えば
、情報源要素” I F ”や“D O”の数が多い場
合にはプログラムのネスト(NEST)が深くなり、岬
害が発生しやすい。このような場合には’ I F ”
や” D O″の発生確率が高くなり、標準の発生確率
データよりも大きくなる。又、判定部7は併せて統計解
析部6で作成された発生確率分布データも出力する。こ
れら出力データは例えばCRTに表示され、或いはプリ
ンタにプリントアウトされる。
The comparison unit 5 compares the standard probability distribution data outputted from the standard distribution holding unit 4 and the occurrence probability data of the information source element outputted from the statistical data 1v generation unit 3 for each information source element,
The comparison result is output to the determination section 7. The determining unit 7 determines whether the program to be inspected is abnormal or normal based on the comparison result from the comparing unit 5, and outputs the result. For example, when the number of information source elements "I F" and "D O" is large, the nesting (NEST) of programs becomes deep, and misalignment is likely to occur. In this case, 'IF'
The probability of occurrence of "D O" becomes higher and larger than the standard occurrence probability data. Further, the determination unit 7 also outputs the occurrence probability distribution data created by the statistical analysis unit 6. These output data are displayed on a CRT, for example, or printed out on a printer.

これにより操(ヤ者は被検査プログラムの品質をプログ
ラムテストの前段階で知ることができる。
This allows the operator to know the quality of the program being tested before the program is tested.

[発明の効果] 以上詳細に説明したように、本発明によれば、プログラ
ムを構成する情報源要素の発生確率を標準状態における
発生確率と比較することによりプログラムの異常及び異
常原因をプログラムテスト前に判定することができるプ
ログラムの品質判定方法を実現することができ、実用上
の効果が大きい。
[Effects of the Invention] As described in detail above, according to the present invention, abnormalities in a program and the cause of the abnormality can be identified before a program test by comparing the probability of occurrence of information source elements constituting a program with the probability of occurrence in a standard state. It is possible to realize a program quality judgment method that can judge the quality of a program, which has a great practical effect.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明方法の原理を示すフローチャート、第2
図は本発明方法を実施するシステムの構成例を示寸図、
第3図、第4図はそれぞれ情報源要素(比較演算子、D
Oオペレータ)の度数分布例を示ず図、第5図は発生確
率分布の一例を示す図、第6図は従来のプログラム品質
判定方法を示ずフローチャート、第7図はオペレータの
種類数と総数との関係をプロットした図である。 第2図において、 1はソースコード保持部、 2は情報m′f!素分解部、 3は統計データ作成部、 4は標準分布保持部、 5は比較部、 6は統計解析部、 7は判定部である。 本究明方泌の原理を示すフローチャート第1図 本質明方法を実施するシステム横72例を示寸又第25
司 *− 州 鶴のプログラム品質判定方法を示すフローチャート第6
図 セフΔ−※當矩
Figure 1 is a flowchart showing the principle of the method of the present invention;
The figure is a dimensional diagram showing an example of the configuration of a system implementing the method of the present invention.
Figures 3 and 4 show information source elements (comparison operator, D
Figure 5 is a diagram showing an example of the occurrence probability distribution, Figure 6 is a flowchart of a conventional program quality determination method, and Figure 7 is a diagram showing the number of types and total number of operators. It is a diagram plotting the relationship between In FIG. 2, 1 is a source code holding unit, 2 is information m'f! 3 is a statistical data creation section, 4 is a standard distribution holding section, 5 is a comparison section, 6 is a statistical analysis section, and 7 is a judgment section. Flowchart illustrating the principle of this research method.
Tsukasa * - Flowchart No. 6 showing Shutsuru's program quality judgment method
Figure sef Δ−※to rectangle

Claims (1)

【特許請求の範囲】 プログラムを情報源要素毎に分解し(ステップ(1))
、 分解した情報源要素を各要素毎に加算して各情報源要素
の発生確率を求め(ステップ(2))、求めた情報源要
素毎の発生確率を標準確率分布と比較してプログラムの
品質判定を行う(ステップ(3))ようにしたことを特
徴とするプログラムの品質判定方法。
[Claims] Decompose the program into information source elements (step (1))
, Add the disassembled information source elements for each element to find the probability of occurrence of each information source element (step (2)), compare the obtained probability of occurrence for each information source element with the standard probability distribution, and calculate the probability of occurrence of each information source element. A method for determining the quality of a program, characterized in that the quality is determined (step (3)).
JP61276984A 1986-11-20 1986-11-20 Method for deciding quality of program Pending JPS63131239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61276984A JPS63131239A (en) 1986-11-20 1986-11-20 Method for deciding quality of program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61276984A JPS63131239A (en) 1986-11-20 1986-11-20 Method for deciding quality of program

Publications (1)

Publication Number Publication Date
JPS63131239A true JPS63131239A (en) 1988-06-03

Family

ID=17577147

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61276984A Pending JPS63131239A (en) 1986-11-20 1986-11-20 Method for deciding quality of program

Country Status (1)

Country Link
JP (1) JPS63131239A (en)

Similar Documents

Publication Publication Date Title
CN111459700A (en) Method and apparatus for diagnosing device failure, diagnostic device, and storage medium
CN111563606A (en) Equipment predictive maintenance method and device
US5862382A (en) Program analysis system and program analysis method
CN112463530A (en) Anomaly detection method and device for micro-service system, electronic equipment and storage medium
CN111722863A (en) Method and device for updating wind control model
JPS63131239A (en) Method for deciding quality of program
CN115293735A (en) Unmanned factory industrial internet platform monitoring management method and system
JP2010282441A (en) Apparatus for calculating inter-module dependent strength, method and program for measuring inter-module dependent strength
Yan et al. Revisiting the correlation between alerts and software defects: A case study on myfaces, camel, and cxf
JPH05216651A (en) Program quality evaluation system
CN110515796B (en) Cortex learning-based anomaly detection method and device and terminal equipment
JP2006059276A (en) Source code evaluating system
CN113962507A (en) Intelligent convenient industry-wide data analysis system and method based on SPC
Mehnert et al. An algorithmic module toolkit to support quality management for building performance
JP2001060110A (en) Device and method for evaluating abnormal plant phenomenon and storage medium
CN113468158B (en) Data restoration method, system, electronic equipment and medium
KR102666692B1 (en) Processing system and processing method
JPH0363838A (en) Software program inspection system
CN115060307A (en) Safety detection method, device, equipment and medium for special equipment of nuclear power plant
IT9021931A1 (en) TEST SYSTEM FOR EXPERT SYSTEM
Zage et al. Design and code metrics through a DIANA-based tool
CN117433646A (en) Temperature monitoring and early warning method and system
CN113849540A (en) Fault prediction model training and prediction method, device, electronic equipment and medium
CN117520201A (en) Reverse ambiguity test method and device, electronic equipment and storage medium
JPH09325171A (en) Deficiency detection method and apparatus