## 3 Performance Measurement Mechanism for Java Codes
Defining Quality Indicators: Define the quality indicators to determine the quantitative measurement score and make the query for extracting the degree of coupling strength for high quality of the software. Figure 4 shows the types of coupling strength [34]. As the content coupling in a module increases, the density of coupling increases. In other words, as the degree of coupling strength increases, the complexity increases. Therefore, in order to improve software complexity, the degree of coupling strength must be lowered. In this study, we investigated how to extract data coupling and stamp coupling. For this purpose, we entered the information extracted from the SN into DB tables of SQLite, and thereafter defined queries to identify and measure coupling in source codes. Table 3 shows the example of source codes and queries used to extract data and stamp coupling. An example of a data coupling method is 'dataTest' of data class. This method directly enters the value of the basic scalar data type. An example of stamp coupling is to create a SampleDataClass, input the data, and pass the class as a parameter of stampTest of the stamp class. In addition, the query for extracting data coupling is called the class (REFER_CLASS_NAME) called from the SNDB_BY table, the name of the symbol (REFER_SYMBOL_NAME), and the name of the class (REFERRED_CLASS_NAME) and symbol (REFERRED_SBOL_NAME). The extracting query sets the condition of 'Referred_type' to'mi'. The query only detects the method call part. The query of stamp coupling receives the parameter (argument_types) data from the SNDB_MD (method definition) table. This query is entered in the 'isData_Stamp_True' method to determine the type of coupling. We defined queries to identify and measure coupling in source codes for other couplings such as control, external, common, and content. (5) Visualizing Code: The quality indicators are quantified using the extracted information. Thereafter, it extracts code data by using a query called 'GenerateDotContents'. The Graph Description Language (DOT) script quantifies the quality indicator value. Subsequently, the Graphviz tool displays quantified values from the DOT script. Finally, it extracts the data into an image file. Figure 4: Types of coupling strength. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Coupling** & **Sample Source Code** & **Query** \\ \hline \multirow{3}{*}{Data} & Data data = new Data(); & Select REFER_CLASS\_NAME, REFER_SYMBOL\_NAME, REFERREED\_CLASS\_NAME, Referred\_symbol\_name, from \\  & data dataTest(1, 1.01f, 2, 2); & SNDB\_BY where referred\_type = ‘mi’ \\ \hline \multirow{3}{*}{Stamp} & Stamp stmp = new Stamp(); & \\  & SampleDataClass sdc = new & Select argument\_types from SNDB\_MD where class\_name = \\  & SampleDataClass(1, 1.01f, 2, 2); & \"\" + class + \"\" and method\_name = \"\" + method + \"\" \\ \cline{1-1}  & Stmp.stampTest(sdc); & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Example of code and queries for extracting data and stamp coupling. Step 2: Patterns and Rules Checking for Performance Degradation Factors  
To visualize CPS-based code performance, we create patterns and rules for the performance degradation factors [28; 29]. Some factors of performance degradation are loop unrolling and loop down count, unnecessary control statements of the inner loops, and multiple if-then-else, among others. We used PMD (XPath) for rule extraction. Programming mistake detector (PMD) is JAVA's static analysis tool [6], which can identify non-standard and potential problems in source code that the compiler cannot find. The main function of PMD is to extract high-value classes by analyzing dead code, empty if/while statements, excessive and complex expressions, unoptimized code, redundant code, as well as cyclomatic complexity. For C/C++ code, CPCheck can automatically detect patterns by defining them in the source code as regular expressions and manually entering extraction paths [35].