Soil tests are typically done prior to building a new home to determine the composition of the soil and whether it can properly support a foundation. It is also required to obtain a building permit. Strong soil does not expand or contract excessively in regards to moisture, and it has a good density, and won’t greatly compact or settle after construction. If the soil is loose, easily compressed or full of absorptive clay, the building may require extra foundation support, otherwise cracking and crumbling can occur.
Testing is performed by licensed soil engineers, aka geotechnical engineers. They will take samples of the soil and test them for compatibility, and make recommendations such as grading, drainage, and/or foundation supports. These tests may also be useful when an existing building is having foundation problems, or when building additions or basements. They also test for toxins and contaminants such as lead, arsenic, copper, cadmium, zinc and barium, that may indicate the area is hazardous to human health.
Taken from website: https://legaleaglecontractors.com/soil-tests-for-new-homes/