Research Article

Automatic Analysis of Complex Interactions in Microservice Systems

Algorithm 1

Encoding an asynchronous interaction behavior.
Input: a microservice system Ba = (C, c0, F, M, Δ)
Output: a CSP# process
(1){buffer12,…, buffern−1n} = gen_buffers(Ba·C)
(2)set {buffer12,…, buffern−1n}’s size
(3)gen_message_variable(Ba·M})
(4)for MSi ∈ (MS1, MS2, …, MSn) do
(5) {σ1,…, σn} = trace(MSi)
(6)  for σj ∈ (σ1,…, σn) do
(7)   z = 1
(8)   while (m = getHead(σj))! = null
(9)    if type(m) = = “!”
(10)     Pz() = buffersrc(m)_dst(m)!action(m) ⟶ Pz+1()
(11)    else
(12)     Pz() = buffersrc(m)_dst(m)[xz = = action(m)]?action(m) ⟶ Pz+1()
(13)     z = z + 1
(14)    end if
(15)   end while
(16)   PMSi() = P1()
(17)  end for
(18)end for
(19)System () = PMS1()|||PMS1()|||…|||PMSn()