Skip to main content

Test-Driven Development as a Reliable Embedded Software Engineering Practice

  • Chapter
  • First Online:
Embedded and Real Time System Development: A Software Engineering Perspective

Part of the book series: Studies in Computational Intelligence ((SCI,volume 520))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    All code snippets are based on the UnitTest++ framework.

  2. 2.

    CxxTest [32] is a C++ testing framework, which was written in Python.

  3. 3.

    This expression is included nevertheless, for the sake of completeness.

References

  1. B.W. Boehm, Software Engineering Economics (Prentice-Hall Advances in Computing Science and Technology Series) (Prentice Hall PTR, 1981)

    Google Scholar 

  2. K. Beck, Test-Driven Development: By Example (Addison-Wesley, 2003)

    Google Scholar 

  3. M. Fowler, Refactoring: Improving the Design of Existing Code (Addison-Wesley, 1999)

    Google Scholar 

  4. R. Martin, Clean Code: A Handbook of Agile Software Craftmanship (Prentice Hall, 2008)

    Google Scholar 

  5. B. George, L. Williams, A structured experiment of test-driven development. J. Inf. Softw. Technol. Elsevier (2004)

    Google Scholar 

  6. M. Siniaalto, Test driven development: empirical body of evidence. Technical report, ITEA (2006)

    Google Scholar 

  7. 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)

    Article  Google Scholar 

  8. 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

    Google Scholar 

  9. N. Van Schooenderwoert, Embedded extreme programming: an experience report, in Embedded Systems Conference (ESC), Boston, 2004

    Google Scholar 

  10. N. Van Schooenderwoert, Embedded agile: a case study in numbers, in Embedded Systems Conference (ESC), Boston, 2006

    Google Scholar 

  11. B. Greene, Using agile testing methods to validate firmware. Agile Alliance Newsl. 4, 79–81 (2004)

    Google Scholar 

  12. P. Hamill, Unit Test Frameworks (O’Reilly, 2004)

    Google Scholar 

  13. N. Llopis, Games from within: exploring the c++ unit testing framework jungle, http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle

  14. Jtn002-minunit-a minimal unit testing framework for c, http://www.jera.com/techinfo/jtns/jtn002.html

  15. Embedded unit testing framework for embedded c, http://embunit.sourceforge.net/embunit/ch01.html

  16. Unity-test framework for c, http://sourceforge.net/apps/trac/unity/wiki

  17. N. Llopis, C. Nicholson, Unittest++, http://unittest-cpp.sourceforge.net/

  18. Cpputest, http://www.cpputest.org/

  19. Googletest, google c++ testing framework, http://code.google.com/p/googletest/

  20. G. Meszaros, xUnit Test Patterns: Refactoring Test Code (Addison-Wesley, 2007)

    Google Scholar 

  21. M. Fowler, Inversion of control containers and the dependency injection pattern (2004), http://martinfowler.com/articles/injection.html

  22. R. Koss, J. Langr, Test driven development in c. C/C++ Users J. (2002)

    Google Scholar 

  23. J. Grenning, Test-Driven Development for Embedded C (The Pragmatic Bookshelf, 2011)

    Google Scholar 

  24. 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

    Google Scholar 

  25. 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

    Google Scholar 

  26. P. Cordemans, S. Van Landschoot, J. Boydens, Test-driven development in the embedded world, in Proceedings of the First Belgium Testing Days Conference, 2011

    Google Scholar 

  27. J. Grenning, Test-driven development for embedded c++ programmers. Technical report, Rennaisance Software Consulting, 2002

    Google Scholar 

  28. J. Grenning, Progress before hardware. Agile Alliance Newsl. 4, 74–79 (2004)

    Google Scholar 

  29. J. Grenning, Test driven development for embedded software, in Proceedings of the Embedded Systems Conference 241, 2007

    Google Scholar 

  30. Host / target testing with the ldra tool suite, http://www.ldra.com/host_trg.asp

  31. Corba/e: industry-standard middleware for distributed real-time and embedded computing (2008), http://www.corba.org/corba-e/corba-e_flyer_v2.pdf

  32. Cxxtest, http://cxxtest.tigris.org/

  33. 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

    Google Scholar 

  34. 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

    Google Scholar 

  35. M. Fletcher, W. Bereza, M. Karlesky, G. Williams, Evolving into embedded development, in Proceedings of Agile 2007, 2007

    Google Scholar 

  36. M. Karlesky, W. Bereza, C. Erickson. Effective test driven development for embedded software, in Proceedings of IEEE 2006 Electro/Information Technology Conference, 2006

    Google Scholar 

  37. 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

    Google Scholar 

  38. 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

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Piet Cordemans .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics