Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent components and swaps them if they are in the wrong order. More efficient algorithms such as timsort, or merge sort are used by the sorting library build into popular programming languages such as Python and Java.

The only significant advantage that bubble sort has over most other algorithms, even quicksort, but not insertion sort, is that the ability to detect that the list is sorted efficiently is build into the algorithm. Therefore, bubble sort is not a practical sorting algorithm.

```
package BubbleSort
import (
"math/rand"
"sort"
"testing"
"time"
)
func BubbleSort(array []int) {
swapCount := 1
for swapCount > 0 {
swapCount = 0
for itemIndex := 0; itemIndex < len(array)-1; itemIndex++ {
if array[itemIndex] > array[itemIndex+1] {
array[itemIndex], array[itemIndex+1] = array[itemIndex+1], array[itemIndex]
swapCount += 1
}
}
}
}
func TestBubbleSort(t *testing.T) {
random := rand.New(rand.NewSource(time.Now().UnixNano()))
array1 := make([]int, random.Intn(100-10)+10)
for i := range array1 {
array1[i] = random.Intn(100)
}
array2 := make(sort.IntSlice, len(array1))
copy(array2, array1)
BubbleSort(array1)
array2.Sort()
for i := range array1 {
if array1[i] != array2[i] {
t.Fail()
}
}
}
```