3) MBSwE approach 2: auto-generated code based on
input from specification dictionaries.
The process of auto-generating code from statechart mod-
els is presented in Figure 1. MagicDraw files (.mdxml)
contained statechart models and were used as input to
an in-house developed autocoder running in the Quantum
Framework to generate C code, referred to as AGC-M in this
paper. The parts that were auto-generated using statechart
models were typically the logic portions of that module.
The process used to auto-generate code from specification
dictionaries is shown in Figure 2. The dictionaries, which
contain command and telemetry data, were exported to
an XML format (.xml files), and then passed to two in-
house developed autocoders, which produced C source code
files, referred to as AGC-D in this paper. Code developed
using MBSwE approach 2 was mainly structural, with no
behavioral details. The upper part of Figure 2 (from right to
left) shows a Verification and Validation (V&V) approach
used by the mission. Using an automated event extractor,
XML files (AG-XML) with the command and telemetry
data were auto-generated from the handwritten code and
compared with the dictionary .xml files. If there was a
problem, changes were made and the process was repeated.
Out of 67 modules, only two were fully auto-generated:
one was 100% AGC-M and the other was 100% AGC-D.
The remaining modules with AGC contained handwritten
code. Additionally, some modules contained both AGC-M
and AGC-D. At module level these modules were classified
as AGC-M because, in most cases, they had more AGC-
M than AGC-D code. Each individual file was either 100%
handwritten, 100% AGC-M, or 100% AGC-D. The mission
used a consistent file naming convention, which allowed
us to accurately classify the files based on the specific
development method used.
Note that the three autocoders were developed in-house
with the same rigorousness as the flight software. We are
not aware of any faults found in AGC-M or AGC-D flight
software files that were due to faults in the autocoders.
The developers were allowed to choose whether to hand-
write the code or use the MBSwE approach 1. A total
of seven modules included AGC-M. In general, developers
felt that some specifics of the flight software could not be
accounted for by the used MBSwE tools. Several challenges
were related to the development and use of models. First,
extra effort was needed to develop the models, which
may be overlooked or underestimated. Further, it was an
open question when to stop including details in the model.
Developers also noted that models tend to obscure the lower
level details present in the AGC-M.
As expected, there were challenges related to the readabil-
ity of AGC-M because it is not intuitive and lacks comments.
Developers experience showed that the readability of AGC-
M improved once they acquired knowledge and understood
the patterns used by MagicDraw.
Model
MagicDraw
Statechart file
(.mdxml)
Statechart
Autocoder
Auto-
Generated
Source Code
(AGC-M)
AGC-M
running in
Quantum
Framework
Figure 1: MBSwE approach 1: Auto-code generation using
statechart models (AGC-M)
Dictionaries
XML
specification
files (.xml)
Autocoders
Auto-
Generated
Source Code
(AGC-D)
Autogenerated
XML Files
(AG-XML)
Automated
Event Extractor
Handwritten
Code
Figure 2: MBSwE approach 2: Auto-code generation using
dictionaries (AGC-D)
The software assurance practices of MBSwE based on
statechart models are described next. The developers con-
ducted design reviews using less detailed state charts, but did
not find testing statechart models to be very useful. The fact
that off-nominal cases were not available in the modeling
phase was a drawback. (They were incorporated into the
models later in the lifecycle.) Based on the experience
with previous missions, both models and AGC-M were
committed in the version control system; once committed,
AGC-M was not changed manually. Furthermore, the models
and AGC-M were always kept in-sync and AGC-M was
tested using the same process as handwritten code.
Mission developers experienced several challenges related
to the maintenance of the AGC-M. One challenge was due
to the fact that the mission’s flight software is a combination
of handwritten and auto-generated code. In addition, AGC-
M may be hard to maintain onboard because the modeling
suite, and thus the models, are not available on the onboard
computer console.
For the MBSwE approach 2, which resulted in AGC-D,
the dictionaries were used as requirements documents and
the code auto-generation ensured that the requirements were
in-sync with the code. In general, the development team
found the approach based on dictionaries much more useful
than MBSwE approach 1.
Development of the mission’s flight software took ad-
vantage of modules developed for previous missions, as
well as modules developed as part of a NASA generalized
framework. Specifically, a module was considered reused