Test-Driven Development as a Reliable Embedded Software Engineering Practice

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 developm

  • PDF / 1,588,763 Bytes
  • 40 Pages / 439.37 x 666.142 pts Page_size
  • 68 Downloads / 211 Views

DOWNLOAD

REPORT


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.

P. Cordemans (B) · S. Van Landschoot · J. Boydens KHBO Department of Industrial Engineering Science and Technology, Zeedijk 101, B-8400 Ostend, Belgium e-mail: [email protected] S. Van Landschoot e-mail: [email protected] J. Boydens e-mail: [email protected] E. Steegmans KU Leuven Department of Computer Science, Celestijnenlaan 200A, B-3001 Leuven, Belgium e-mail: [email protected]

M. A. Khan et al. (eds.), Embedded and Real Time System Development: A Software Engineering Perspective, Studies in Computational Intelligence 520, DOI: 10.1007/978-3-642-40888-5_4, © Springer-Verlag Berlin Heidelberg 2014

91

92

P. Cordemans et al.

1 Test-Driven Development Test-Driven Development (TDD) is a fast paced incremental software development strategy, based on automated unit tests. First, this section describes the rationale of TDD (Sect. 1.1). Then, it describes the core of TDD (Sect. 1.2). Next, the advantages and difficulties (Sect. 1.3) of developing by TDD are discussed. Finally, an overview of unit testing frameworks (Sect. 2) is given.

1.1 TDD Rationale As embedded systems are currently becoming more complex, the importance of their software component rises. Furthermore, due to the definite deployment of embedded software once it is released, it is unaffordable to deliver faulty software. Thorough testing is essential to minimize software bugs. The design of embedded software is strongly dependent on the underlying hardware. Co-design of hardware and software is essential in a successful embedded system design. However, during the design time, the hardware might not always be available, so software testing is often considered to be impossible. Therefore testing is mostly postponed until after hardware development and it is typically limited to debugging or ad-hoc testing. Moreover, as it is the last phase in the process, it might be shortened when the deadline is nearing. Integrating tests from the