Research Article

Location-Based Test Case Prioritization for Software Embedded in Mobile Devices Using the Law of Gravitation

Algorithm 3

Location-based TCP using the law of gravitation.
Input: Test suite T
Output: Prioritized test suite T′
General process:
Begin
(1)Calculate m of each t in T
(2)Cluster devices according to Algorithm 1
(3)Create a FTS according to Algorithm 2
(4)Calculate m of each in FTS
(5)for each in T
(6)for each in FTS
(7)  Calculate r between and
(8)  Calculate of to
(9)end for
(10) Calculate P of
(11)end for
(12)Sort all t in T based on the descending order of P and obtain the new test execution order, being T′
(13)return T′
End