Formal verification is a method of verifying the correctness of software or hardware systems using mathematical techniques and logic. It exhaustively explores all possible states and executions to prove that a system adheres to specified properties. Unlike traditional testing, which relies on a finite number of test cases, formal verification provides mathematical certainty and ensures correctness under all scenarios.