Abstract
A promising trend in software practice is the increasing adoption of model-driven design. In this approach, a developer first constructs an abstract specification of the required program behavior in a language, such as Statecharts, Stateflow, or LUSTRE, and then uses a code generator to automatically translate the specification into an executable program. This approach has major advantages over more traditional approaches. First, because a specification is more concise, it is usually more understandable than code, and hence manual inspections can detect more errors in specifications than in code. Second, a specification is also more amenable to both user validation (e.g., via simulation) and formal verification, which together provide high confidence that the specification captures the desired behavior. Finally, the automatic generation of source code usually produces software with fewer errors than handcrafted code. This paper describes a case study in which Bob Paige’s program transformation system APTS was used to produce code generators that construct C source code from a requirements specification in the SCR (Software Cost Reduction) tabular notation. Two different code generation strategies were explored. The first strategy uses rewrite rules to transform the parse tree of an SCR specification into a parse tree for the corresponding C code. The second strategy associates a relation with each node of the specification parse tree. Each member of this relation acts as an attribute, holding the C code corresponding to the tree at the associated node; the root of the tree has the entire C program as its member of the relation. This paper describes the two code generators, how each was used to synthesize code for two example SCR requirements specifications, and lessons learned about APTS from the case study.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.