Skip to main content Accessibility help
×
Hostname: page-component-8448b6f56d-tj2md Total loading time: 0 Render date: 2024-04-25T01:19:07.150Z Has data issue: false hasContentIssue false

8 - Software Engineering with Spark

Published online by Cambridge University Press:  05 October 2015

John W. McCormick
Affiliation:
University of Northern Iowa
Peter C. Chapin
Affiliation:
Vermont Technical College
Get access

Summary

In the preceding chapters we have concentrated on the details of the Spark language. In this chapter, we look at a broader picture of how Spark might be used in the context of a software engineering process. The Spark 2014 Toolset User's Guide (Spark Team, 2014b) lists three common usage scenarios:

  1. Conversion of existing software developed in Spark 2005 to Spark 2014

  2. Analysis and/or conversion of legacy Ada software

  3. Development of new Spark 2014 code from scratch

We start by examining each of these scenarios in more detail, discussing the interplay between proof and testing, and then presenting a case study to illustrate some issues arising when developing new Spark 2014 code from scratch.

Conversion of Spark 2005

Converting a working Spark 2005 program to Spark 2014 makes sense when that program is still undergoing active maintenance for enhanced functionality. The larger language and the enhanced set of analysis tools provided by Spark 2014 offer a potential savings in development time when adding functionality to an existing Spark 2005 program.

As Spark 2014 is a superset of Spark 2005, the conversion is straight forward. Section 7.2 of the Spark 2014 Toolset User's Guide (Spark Team, 2014b) provides a short introduction to this conversion. Appendix A of the Spark 2014 Reference Manual (Spark Team, 2014a) has information and a wealth of examples for converting Spark 2005 constructs to Spark 2014. Explanations and examples are provided for converting subprograms, type (ADT) packages, variable (ASM) packages, external subsystems, proofs, and more. Should you need to constrain your code to the Spark 2005 constructs but wish to use the cleaner syntax of Spark 2014, you may use pragma Restrictions (Spark 05) to have the analysis tools flag Spark 2014 constructs that are not available in Spark 2005.

Dross et al. (2014) discuss their experiences with converting Spark 2005 to Spark 2014 in three different domains. AdaCore has a Spark 2005 to Spark 2014 translator to assist with the translation process. At the time of this writing, this tool is available only to those using the pro versions of their GNAT and Spark products.

We illustrate a simple example of converting a Spark 2005 package to Spark 2014. The package encapsulates a circular buffer holding temperature data, for example, from an analog to digital converter.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2015

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×