1. A method of generating test frames in specification-based testing, the method comprising the steps of: receiving a test design as an input, wherein the test design is represented as an extended context-free grammar (ECFG); constructing a context-free grammar graph based on the test design, wherein the context-free grammar graph comprises a plurality of paths; analyzing the context-free grammar graph to generate a first set of paths from the plurality of paths that satisfy one or more pre-conditions by examining each valid path from the plurality of paths, starting from a root node of the context-free grammar graph to a leaf node of the context-free grammar graph, wherein examining each valid path comprises the steps of: visiting a first node of the path; initially selecting a choice out of the first node based on depth-first traversal, wherein the-first node is a non-terminal; evaluating a pre-condition of the one or more pre-conditions associated with the choice and finally selecting the choice when the pre-condition associated with the choice is satisfied; visiting a next node of the path by visiting the choice out of the first node which satisfies the pre-condition; detecting cycles in the context-free grammar graph by maintaining a list of visited nodes; and iteratively repeating the steps of initially selecting the choice, finally selecting the choice, visiting the next node, and detecting cycles for each node of the path until the next node is a terminal; repeatedly expanding the cycles in the paths of the first set of paths, wherein repeatedly expanding the cycles comprises, for each of the cycles, determining if the cycle is guarded by a pre-condition of the one or more pre-conditions, expanding the cycle as long as the guarding pre-condition remains true when the cycle is guarded, and expanding the cycle a random number of times when the cycle is not guarded; and emitting a set of test frames as an output, wherein the set of test frames is a second set of paths obtained from the first set of paths that satisfy a frame constraint specified in the test design.