There are two tests to determine if a piece is in Sonata Form. Firstly, we must look at the harmonies of the piece. The first sections (referred to as the Exposition) will begin in the tonic (I) and modulate to the dominant (V). To find this point, look for a perfect cadence (V-I progression) in the dominant key e.g. if the piece were in C major, look for D major-G major (V-I in G major). The second section will begin with a period of harmonic instability, modulating frequently, often moving through unusual key areas (this is referred to as the Development). The piece will then return to the tonic key for an extended period of time (the Recapitulation). This return will be marked by a perfect cadence in the tonic key.
Some early sonatas will only use one theme (a monothematic sonata), but the majority will use two themes, referred to as the 1st Subject and 2nd Subject. These two themes can be see in the Exposition and Recapitulation sections, and will be distinct in character, using different rhythms, articulations, dynamics, or textures. In the Exposition, the 1st Subject will be in the tonic key, while the 2nd Subject will be in the dominant key. In the Recapitulation, both subjects will be in the tonic key. To determine where these themes begin, look for perfect cadences, and make sure to check that the 2nd Subject appears in the tonic key in the Recapitulation.