Another way to say "Accidents can occur when testing " is "When you test something, an accident can occur."