Abstract
Due to embedded co-design considerations, testing embedded software is typically deferred after the integration phase. Contrasting with the current embedded engineering practices, Test-Driven Development (TDD) promotes testing software during its development, even before the target hardware becomes available. Principally, TDD promotes a fast feedback cycle in which a test is written before the implementation. Moreover, each test is added to a test suite, which runs at every step in the TDD cycle. As a consequence, test-driven code is well tested and maintainable. Still, embedded software has some typical properties which impose challenges to apply the TDD cycle. Essentially, uploading software to target is generally too time-consuming to frequently run tests on target. Secondary issues are hardware dependencies and limited resources, such as memory footprint or processing power. In order to deal with these limitations, four methods have been identified and evaluated. Furthermore, a number of relevant design patterns are discussed to apply TDD in an embedded environment.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
All code snippets are based on the UnitTest++ framework.
- 2.
CxxTest [32] is a C++ testing framework, which was written in Python.
- 3.
This expression is included nevertheless, for the sake of completeness.
References
B.W. Boehm, Software Engineering Economics (Prentice-Hall Advances in Computing Science and Technology Series) (Prentice Hall PTR, 1981)
K. Beck, Test-Driven Development: By Example (Addison-Wesley, 2003)
M. Fowler, Refactoring: Improving the Design of Existing Code (Addison-Wesley, 1999)
R. Martin, Clean Code: A Handbook of Agile Software Craftmanship (Prentice Hall, 2008)
B. George, L. Williams, A structured experiment of test-driven development. J. Inf. Softw. Technol. Elsevier (2004)
M. Siniaalto, Test driven development: empirical body of evidence. Technical report, ITEA (2006)
N. Nagappan, M. Maximilien, T. Bhat, L. Williams, Realizing quality improvement through test driven development: results and experiences of four industrial teams. Empirical Softw. Eng. 13, 289–302 (2008)
M. Müller, F. Padberg, About the return on investment of test-driven development, in International Workshop on Economics-Driven Software Engineering Research EDSER-4, 2003
N. Van Schooenderwoert, Embedded extreme programming: an experience report, in Embedded Systems Conference (ESC), Boston, 2004
N. Van Schooenderwoert, Embedded agile: a case study in numbers, in Embedded Systems Conference (ESC), Boston, 2006
B. Greene, Using agile testing methods to validate firmware. Agile Alliance Newsl. 4, 79–81 (2004)
P. Hamill, Unit Test Frameworks (O’Reilly, 2004)
N. Llopis, Games from within: exploring the c++ unit testing framework jungle, http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle
Jtn002-minunit-a minimal unit testing framework for c, http://www.jera.com/techinfo/jtns/jtn002.html
Embedded unit testing framework for embedded c, http://embunit.sourceforge.net/embunit/ch01.html
Unity-test framework for c, http://sourceforge.net/apps/trac/unity/wiki
N. Llopis, C. Nicholson, Unittest++, http://unittest-cpp.sourceforge.net/
Cpputest, http://www.cpputest.org/
Googletest, google c++ testing framework, http://code.google.com/p/googletest/
G. Meszaros, xUnit Test Patterns: Refactoring Test Code (Addison-Wesley, 2007)
M. Fowler, Inversion of control containers and the dependency injection pattern (2004), http://martinfowler.com/articles/injection.html
R. Koss, J. Langr, Test driven development in c. C/C++ Users J. (2002)
J. Grenning, Test-Driven Development for Embedded C (The Pragmatic Bookshelf, 2011)
J. Boydens, P. Cordemans, E. Steegmans, Test-driven development of embedded software, in Proceedings of the Fourth European Conference on the Use of Modern Information and Communication Technologies, 2010
P. Cordemans, S. Van Landschoot, J. Boydens, Migrating from debugging to testing embedded software, in Proceedings of the 9th International Conference and Workshop on Ambient Intelligence and Embedded Systems (AmiEs), 2010
P. Cordemans, S. Van Landschoot, J. Boydens, Test-driven development in the embedded world, in Proceedings of the First Belgium Testing Days Conference, 2011
J. Grenning, Test-driven development for embedded c++ programmers. Technical report, Rennaisance Software Consulting, 2002
J. Grenning, Progress before hardware. Agile Alliance Newsl. 4, 74–79 (2004)
J. Grenning, Test driven development for embedded software, in Proceedings of the Embedded Systems Conference 241, 2007
Host / target testing with the ldra tool suite, http://www.ldra.com/host_trg.asp
Corba/e: industry-standard middleware for distributed real-time and embedded computing (2008), http://www.corba.org/corba-e/corba-e_flyer_v2.pdf
Cxxtest, http://cxxtest.tigris.org/
P. Cordemans, J. Boydens, S. Van Landschoot, Embedded software development by means of remote prototyping, in Proceedings of the 20th International Scientific and Applied Science Conference: Electronics-ET, 2011
P. Cordemans, J. Boydens, S. Van Landschoot, E. Steegmans, Test-driven development strategies applied to embedded software, in Proceedings of the Fifth European Conference on the Use of Modern Information and Communication Technologies, 2012
M. Fletcher, W. Bereza, M. Karlesky, G. Williams, Evolving into embedded development, in Proceedings of Agile 2007, 2007
M. Karlesky, W. Bereza, C. Erickson. Effective test driven development for embedded software, in Proceedings of IEEE 2006 Electro/Information Technology Conference, 2006
M. Karlesky, W. Bereza, G. Williams, M. Fletcher, Mocking the embedded world: test-driven development, continuous integration, and design patterns, in Proceedings of the Embedded Systems Conference 413, 2007
S. Burbeck, Applications programming in smalltalk-80(tm): how to use model-view-controller (mvc) (1992), http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Cordemans, P., Van Landschoot, S., Boydens, J., Steegmans, E. (2014). Test-Driven Development as a Reliable Embedded Software Engineering Practice . In: Khan, M., Saeed, S., Darwish, A., Abraham, A. (eds) Embedded and Real Time System Development: A Software Engineering Perspective. Studies in Computational Intelligence, vol 520. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40888-5_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-40888-5_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-40887-8
Online ISBN: 978-3-642-40888-5
eBook Packages: EngineeringEngineering (R0)