This document proposes an optimization approach to automatically generate test cases for object-oriented software using state chart diagrams. It presents a methodology to: 1) Derive a state transition graph from a state chart diagram. 2) Extract information like states, transitions, and events from the state chart diagram. 3) Generate test cases that satisfy transition path coverage, path coverage, and action coverage criteria. 4) Minimize the set of test cases by calculating node coverage and removing redundant test cases. The methodology is demonstrated through a case study on an Automatic Ticket Machine system.