## 2 Materials and Methods
### Reliability Assessment Method Based on Bayes Minimum Risk Decision
#### 2.2.3 Bayes Prior Hyperparameter Solving Method Based on MMR  
In Bayesian reliability assessment, prior information is used to capture existing knowledge about unknown parameters. The efficiency and accuracy of the assessment is determined in terms of the prior probability distribution. An accurate prior distribution dramatically improves the required number of test cases [24]. The parameters of the prior distribution are referred to as hyperparameters, such as by \(a\) and \(b\) in (7). The values of the hyperparameters determine the accuracy of the prior probability distribution, which is an important factor in Bayesian decision-making [25]. A fundamental shortcoming of reliability assessment methods of web service compositions is that due to the accumulation of a large number of failures at each web service testing phase and a small number of failures in the web service composition testing phase, the lack of prior information makes the hyperparameters inaccurate and increases the risk of wrong decisions. In this section, the authors present a method for calculating a priori parameters based on an MMR, to minimize the risk of wrong Bayes decisions during reliability testing. The proposed method utilizes module-level prior information alongside the failure data of the constituent web services. In Section 2.2, the authors consider the reliability assessment of web services as a decision-making problem; if wrong testing happened, incorrect assessments induce the loss of accuracy. The authors used the loss function to describe the risk (12), which represents the loss induced by wrong assessment. To measure the loss accurately, the authors used the risk function to express the expected value of the loss. Consequently, the decision-making problem can be converted into that of identifying a method that minimizes the risk during testing. The loss function can be indicated in following:  
\[ \begin{array}{l}L_{0}=(\theta,d_{0})=a(\theta-\theta_{0})I(\theta>\theta_{0 })\\ L_{1}(\theta,d_{1})=a(\theta-\theta_{0})I(\theta\leq\theta_{0})\end{array}  \tag{12}\]  
where \(a\) denotes a positive constant and \(d=\{d_{0},d_{1}\}\) indicates the test results, so according to result of reliability testing, the decision rule is: \(d_{0}\) denotes that accepted \(H_{0}\), \(d_{1}\) denotes that rejected \(H_{0}\). \(I(\theta>\theta_{0})\) represents the actual failure probability of the web service composition being larger than the reliability requirement. On the other hand, \(I(\theta<\theta_{0})\) represents the actual failure probability of web service composition being smaller than the reliability requirement. \(L_{0}=(\theta,d_{0})\) denotes the custom risk corresponding to cases in which the software is accepted despite the failure probability being larger than the reliability requirement and \(L_{1}=(\theta,d_{1})\) denotes the producer risk corresponding to cases in which the software is rejected despite the failure probability being smaller than the reliability requirement. If the sample set is denoted by \(\Omega=\{x|x\rangle 0\}\), the parameter set is denoted by \(\Theta=\left\{\theta>0\big{|}\int_{\Omega}f(x|\theta)dx=1\right\}\), then, corresponding to the prior distribution \(G(\theta)\), the risk function of the decision function, \(\delta(x)\), is given by  
\[ \begin{array}{rcl}R(\delta(x),G(\theta))&=&E_{(x,\theta)}[L(\theta,\delta(x) )]\\ &=&\int_{\Theta}\!\!\left[\int_{\Omega}L(\theta,\delta)f(x|\theta)dx\right]\!dG (\theta)\end{array}  \tag{13}\]  
substituting (12) into (13) yields  
\[ \begin{array}{rcl}R(\delta(x),G(\theta))&=&\int_{\Theta}\int_{\Omega}[L_{0}( \theta,d_{0})f(x|\theta)\delta(x)+L_{1}(\theta,d_{1})f(x|\theta)(1-\delta(x))] dxdG(\theta)\\ &=&\int_{\Theta}\int_{\Omega}[a(\theta-\theta_{0})(1-I(\theta<\theta_{0})) \delta(x)+L_{1}(\theta,d_{1})(1-\delta(x))]f(x|\theta)dxdG(\theta)\\ &=&\int_{\Theta}\int_{\Omega}[a(\theta-\theta_{0})\delta(x)+L_{1}(\theta,d_{1 })]f(x|\theta)dxdG(\theta)\end{array}