header
Greatest common divisor

Tag:
Edit edit   Starstar

Program Information

Name: Greatest common divisor
Domain: Numerical program
Functionality: compute the greatest common divisor of two integers
Input: integers $u,v,x,y$
Output: $gcd()$ the greatest commom divisor

Reference

Automated Metamorphic Testing https://doi.org/10.1109/CMPSAC.2003.1245319; 
An Empirical Study on the Selection of Good Metamorphic Relations https://doi.org/10.1109/COMPSAC.2006.24

MR Information

MR1------

Description:
Property: $\left\{ \begin{array}{l} I_1=(u,v) \\ I_2=(v,u) \\ \end{array} \right.  \Rightarrow gcd(I_2)=gcd(I_1) \qquad \forall u,v \in N^*$ 
Source input: $I_1=(u,v)$
Source output: $gcd(I_1)$
Follow-up input: $I_2=(v,u)$
Follow-up output: $gcd(I_2)$
Input relation: $(u,v) \Rightarrow (v,u)$ where $\forall u,v \in N^*$
Output relation: $gcd(I_2)=gcd(I_1)$
Pattern:

MR2------

Description:
Property: $\left\{ \begin{array}{l} I_1=(u,v) \\ I_2=(k_1u,k_2v) \\ \end{array} \right.  \Rightarrow gcd(I_2) \geq gcd(I_1) \quad \forall u,v \in N^* \quad \forall k_1,k_2 \in N^*$ 
Source input: $I_1=(u,v)$
Source output: $gcd(I_1)$
Follow-up input: $I_2=(k_1u,k_2v)$
Follow-up output: $gcd(I_2)$
Input relation: $(u,v) \Rightarrow (k_1u,k_2v)$ where $\forall u,v \in N^* \quad \forall k_1,k_2 \in N^*$ 
Output relation: $gcd(I_2) \geq gcd(I_1)$
Pattern:

MR3------

Description:
Property: $k \cdot gcd(u,v)=gcd(k \cdot u,k \cdot v)$ for $u,v \in Z,u^2+v^2 > 0,k \in N^+$ 
Source input:  $(u,v)$
Source output:  $I_1=gcd(u,v)$
Follow-up input:  $(k\cdot u,k\cdot v)$
Follow-up output: $I_2=gcd(k\cdot u,k\cdot v)$ 
Input relation: $(u,v) \Rightarrow (k\cdot u,k\cdot v)$ where $u,v \in Z,u^2+v^2 > 0,k \in N^+$ 
Output relation:  $k\cdot gcd(I_1)=gcd(I_2)$
Pattern:

MR4------

Description:
Property: $ gcd(u,v)\cdot gcd(x,y)=gcd(u \cdot x,v \cdot y) $ 
Source input:  $(u,v),(x,y)$
Source output: $I_1=gcd(u,v),I_2=gcd(x,y)$ 
Follow-up input:  $(u \cdot x,v \cdot y)$
Follow-up output: $I_3=gcd(u \cdot x,v \cdot y)$
Input relation: $(u,v),(x,y) \Rightarrow (u \cdot x,v \cdot y)$ 
Output relation: $I_1\cdot I_2=I_3$ 
Pattern:
Insert title here