Algebraic testing is an automated software testing method based on algebraic formal specifications. It tests if a program correctly implements an algebraic specification by checking if the equations of the specification are satisfied. One of the key techniques of algebraic testing is the use of observation contexts as a test oracle so that the comparison of values of structured data can be realised by comparing values of simple data types. This leads to a behavioural semantics of algebraic specifications and divides sorts into observable and non-observable. To represent the structure of object-oriented programs and to facilitate incremental integration testing, this paper extends the notion of observable sorts by introducing a partial ordering between sorts to represent the importation relation between classes. In this framework, the validity of test oracles is formally proved in final algebra semantics.