## 2 Materials and Methods
### Reliability Assessment Method Based on Bayes Minimum Risk Decision  
#### 2.2.1 Reliability Assessment Scenario  
In this paper, the authors performed reliability assessment based on Bayesian reliability assessment [22], by focusing on the problem of accurately and objectively verifying software reliability requirements. Bayesian reliability assessment is a statistical theory based on the Bayesian interpretation of probability. The probability of an event represents the degree of belief that it will occur, and prior information is used to predict the posterior distribution of reliability. Consider the parameter, \(\theta\), to be a random variable. The existing information was used to obtain prior distribution, the sample \(X=(x_{1},x_{2},\ldots x_{n})\), the prior information and current information was integrated to calculate the posterior distribution and statistically infer the value of \(\theta\). The mathematical model can be expressed by \(f(x|\theta)\propto L(\theta|x)\pi(\theta)\), where \(\pi(\theta)\) denotes the prior probability density function of \(\theta\), \(f(x|\theta)\) denotes the posterior probability density function, and \(L(\theta|x)\) denotes the likelihood function. The authors proposed a two-stage reliability assessment of web service compositions--reliability growth stage and reliability demonstration stage. Assuming the reliability requirement to be \((p_{0},c)\), the probability of \(x\) failures in \(n\) test cases follows the binomial distribution--i.e., the probability of failure of the web service composition is \(p_{s}\), which follows \(Beta(a,b)\). Next, based on the aforementioned information obtained via reliability growth assessment, the distribution of the software failure probability, p, during reliability demonstration assessment was given by binary experiment--acceptable or rejected--the binomial sampling model with its conjugate beta distribution was widely used. The choice of the beta distribution as a prior is useful for several reasons: it is flexible enough to describe a variety of prior beliefs, it ensures that reliability is between \((0,1)\), and it is the conjugate prior for the binomial distribution [23; 24]. The prior probability density of \(p_{s}\) can be expressed as follows:  
\[\pi(p_{\rm s})=\frac{p^{n-1}(1-p)^{b-1}}{B(a,b)} \tag{7}\]where, \(B(a,b)=\int_{0}^{1}x^{a-1}(1-x)^{b-1}dx\). During the reliability growth stage, the prior probability density \(p_{s}\) is confirmed and \(\hat{p}_{s}\) (the estimate of \(p_{s}\)) is compared with the reliability requirement \(p_{0}\)--if \(\hat{p}_{s}\leq p_{0}\), reliability demonstration testing is conducted in the next step, if \(\hat{p}_{s}>p_{0}\), need to repair, reliability growth testing is conducted again. Assuming that there are \(x\) failures in \(n\) test cases, the posterior probability density of \(p_{s}\) of the web service composition is given by:  
\[ \begin{array}{rcl}f(p\big{|}x,n,a,b)&=&Be(a+x,b+N-x)\\ &=&\frac{p^{t+x-1}(1-p)^{b+n-x-1}}{B(a+x,b+n-x)}\end{array}  \tag{8}\]  
The expectation of the posterior probability density, \(p_{s}\), is:  
\[ \begin{array}{rcl}\hat{p}_{s}^{\prime}&=&E(p_{s}\big{|}x,n,a_{0},b_{0})\int_ {0}^{1}p_{s}B(a_{0}+x,b_{0}+n-x)dp_{s}\\ &=&\frac{a_{0}+x}{b_{0}+n-x}\end{array}  \tag{9}\]  
The posterior expected value of \(p_{s}\) is known to be the minimum secondary loss estimate of the software failure reliability. It is used as the estimated value of the current probability of the web service composition. If \(\hat{p}_{s}^{\prime}<p_{0}\), the current reliability of the web service composition satisfies the reliability requirement, and the reliability growth test is deemed to be complete. During the reliability demonstration stage, the posterior distribution \(p_{s}\) of the probability of failure during the growth test can be utilized, which integrates the information with the reliabilities of the web services and the web service composition. Thus, the distribution of failure probabilities can be obtained based on the prior information in the demonstration stage.