Danger! You're heading down a rabbit-hole here.
You will need to think very carefully about how you define triangle-triangle intersection and how you define correctness of the intersection algorithm. Some details to consider:
- How are you representing the triangle vertices? Are the coordinates integers? Are they floating-point real numbers, that you assume are exact? Are they floating-point real numbers, that you assume are approximating the "true" locations of the vertices up to some error interval?
- How are you defining intersection in the case where the two triangles are exactly coplanar? Coplanar up to machine precision? What about when the triangles lie on exactly parallel planes?
- What is the expected behavior in the literal corner case where the two triangles intersect at exactly one point? When they share a common edge? The same concerns as above regarding exact arithmetic vs. machine precision also apply here.
There are algorithms that perform exact triangle-triangle intersection, carefully accounting for all of the above complications. The keyword to search for is exact geometric predicates (see also this survey about geometric robustness).
Practical intersection algorithms used in rendering or game collision detection are not exact: they live somewhere on the correctness-performance Pareto front where some false positives and false negatives are acceptable in "tough" cases where triangles are nearly coplanar or nearly intersection-free.
Testing is not trivial regardless of if you're testing an exact predicate or a "practical" approximate algorithm. Coverage will almost necessarily be incomplete (unless you assume the triangle vertices are restricted to some bounded integer lattice). The distribution on triangle pairs you will encounter in practice (arising from 3D geometry animated by an artist, or generated via physical simulation) will not look at all the same as the distribution of triangle pairs where each vertex is uniformly sampled from a cube or sphere. In particular, automated testing based on random triangles will miss all of the most important corner cases (where triangles are barely intersecting or non-intersecting; where triangles are on nearly-coincident parallel planes; etc.)
My advice is:
- if you need exact geometric predicates, download an existing software package (which has been proved correct using formal verification). Don't try to roll your own.
- if you need a high-performance approximate algorithm, download an existing software package (there are many that have survived extensive testing on large-scale real-world data). Don't try to roll your own.
- If you are implementing an algorithm yourself for learning purposes, your approach is reasonable, but keep in mind that (a) it will be very difficult to get good coverage of all cases with randomized automated tests and (b) you will need to think very carefully about how to quantify correctness.