Abstract
With the significance, ubiquity, and complexity of information technology continuously rising, the corresponding quality assurance becomes increasingly important and challenging. Consequently, numerous tools, techniques, paradigms, and strategies that facilitate the quality assurance of the developed applications have emerged. Test-driven development (TDD) is one of those strategies. In contrast to the traditional approach, it places testing ahead of the actual implementation, which, in turn, also heavily influences the system’s design. With the approach being rather complex, naturally, guidance on its correct application is one of the most relevant aspects for many practitioners. To provide assistance to them, but also to researchers concerned with the domain, the publication at hand identifies twenty guidelines for the practical application of TDD in software engineering, by conducting a structured literature review. In doing so, it provides a solid foundation for the implementation of corresponding endeavors as well as a starting point for further discussion.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
For many years, information technology has become increasingly pervasive, and consequently, its importance has also risen [1]. Moreover, this trend is not expected to end soon [2]. This leads to an ongoing demand for new and improved software products to satisfy the emerging needs [3]. Yet, developing software is a highly challenging task, which is prone to errors and in case of complex systems, potentially susceptible to unintended side effects and compatibility issues [4, 5]. Furthermore, badly designed or erroneously implemented software solutions can have detrimental impacts on the utilizing organizations [6]. Additionally, due to the increasing technical possibilities and the corresponding emergence of opportunities for new applications and use cases, the complexity of the developed solutions has also increased [7]. Thus, tools, techniques, paradigms, and strategies that facilitate the quality assurance of the developed applications are of high relevance for practitioners as well as for researchers [8] and therefore heavily and broadly discussed in the scientific literature [9,10,11,12,13,14,15].
Test-driven development (TDD) is one of those strategies. Even though, due to its holistic nature, it can be seen rather as a philosophy instead of just a testing approach [16]. While it is not a new concept and has already been scientifically discussed for a long time [17], it has not yet reached maturity, and therefore, the corresponding discourse is still ongoing and highly relevant. With the approach being rather complex, since the developers now also have to fill the role of testers at the same time, naturally, guidance on its correct application is one of the most relevant aspects for many practitioners. To provide guidance to them, but also to researchers concerned with the domain, by conducting a structured literature review, the publication at hand aims to identify the implementation guidelines and best practices identified in the existing literature with the goal of providing a solid foundation that any future endeavors can subsequently build upon. This culminates in the following research question (RQ):
RQ: Which guidelines for the application of test-driven development in software engineering can been identified in the scientific literature?
To answer the RQ, the ensuing text is structured as follows. After the introduction, an overview of the concept of TDD is given. Subsequently, the protocol of the conducted literature review is outlined. Afterward, the findings of the review are presented. Finally, a conclusion is given, and limitations as well as potential prospects for future research are discussed.
2 Test-Driven Development
When consulting the literature [18], the application of TDD is highlighted as a promising way of improving an implementation’s quality as long as the accompanying increase in development time and effort is deemed an acceptable trade-off.
The approach aims at improving the quality of the regarded product by mainly influencing two aspects. On the one hand, the test coverage shall be increased, helping in finding and subsequently remedying issues that occurred during the implementation of the respective artifact. On the other hand, TDD also influences the design process itself, leading to a more manageable and better preplanned structure that helps in avoiding mistakes and incompatibilities [19, 20]. While its main application area is the software development domain, it is also applicable to the special case of the implementation of big data applications [21], process modeling [22], or the development of ontologies [23, 24]. However, the main focus for this publication is the application of TDD in the development of software.
When following the “traditional” way of developing software, after envisioning a feature or change that is supposed to be realized, it is implemented and subsequently tested. In contrast, in the test-driven approach, the order of implementation and testing is swapped. Therefore, after the desired change is conceived, it is partitioned into the smallest reasonable pieces [25]. For those, to assure that the required functionality is provided, one or more tests are written. Afterward, the tests are executed and supposed to fail, since the actual functionality has not yet been implemented [26]. Only then, the productive code is written to provide the new functionality. Factors like the code’s elegance are not yet regarded, instead the simplest solution is sought after. Once finished, the code has to pass the previously written tests [20]. When successful, the code is refactored to improve aspects like its readability or the adherence to standards and best practices [26]. While doing so, the functionality is constantly validated against the tests.
As mentioned before, this approach not only affects the test coverage, but by having small working packages instead of large tasks, also the software’s design. Furthermore, this focus on incremental modifications [27], intertwining the testing and implementation, provides the developer with more immediate feedback, since it results in short testing cycles [28]. While usually the majority of tests is specifically written for those small units, also other tests such as integration, system, or acceptance tests can be used in TDD [29]. Moreover, to fully harness the potential of TDD without occupying the developer’s attention by forcing them to run the tests manually, TDD is often used in conjunction with test automation in a continuous integration (CI) context [30, 31]. In doing so, to assure that the newest code addition or change does not negatively affect the already existing parts of the implementation, a CI server automatically starts and reruns all applicable tests once a new code commit is registered by the versioning system.
3 The Literature Review
To answer the RQ, a structured literature review (SLR) is conducted that is oriented on recognized methodologies, namely the approaches of Webster and Watson [32], Levy and Ellis [33], and Okoli [34]. In the following, the whole process is described as detailed as possible, allowing successive researchers to retrace and evaluate its steps. This, in turn, facilitates a better judgment regarding this contribution’s value for their own endeavors and also allows to build upon if desired [35]. To increase understandability, the process is also visualized in Fig. 1.
Because Scopus is considered the most extensive scientific abstract and citation database while simultaneously providing the user with powerful tools for searching and filtering, it was chosen for the purpose of this literature review [36, 37].
Since the publication at hand aims to give guidance on how to apply the TDD methodology, a variety of relevant search terms and different spellings were used to cover the relevant literature. To assure the relevancy of the results to the TDD domain, the title had to contain either “test driven development”, “test-driven development”, or “testdriven development”.
Further, to identify the works that provide guidance how TDD should (not) be conducted, the title, abstract or keywords had to contain “best practice”, “best-practice”, “pattern*”, “guideline*”, “guidance”, “antipattern*”, or “anti-pattern*”.
The overall search term, therefore, looks as follows:
(TITLE (“test driven development” OR “test-driven development” OR “testdriven development”) AND TITLE-ABS-KEY (“best practice*” OR “best-practice*” OR “pattern*” OR “guideline*” OR “guidance” OR “antipattern*” OR “anti-pattern*”)).
By using this search term, 22 publications were identified (December 22, 2021) for further consideration. Subsequently, to determine those that are actually relevant to this work’s topic, a multi-stepped filter process was conducted. For this, the inclusion and exclusion criteria listed in Table 1 were applied.
In the first phase of the filter process, the respective titles were read and if it became apparent that a paper does not fit the scope, it was excluded. This reduced the number of contributions to 18. Afterward, for those that remained, the abstract and keywords were considered to narrow down the list even further. Again, if a paper was deemed clearly not fitting, it was excluded, while in case of uncertainty, it was carried over to the next phase. This resulted in a set of eleven contributions. For these, as the next step in the filter process, the introduction and conclusion were read. Subsequently, nine articles remained. Ultimately, as the last step, these were skimmed in total, leading to a final set of five relevant publications, which are listed in Table 2.
4 Findings
In [38], which is the earliest paper considered in this review, a technique for the application of TDD to the development of graphical user interfaces (GUI) is presented. It is based on a model-view-presenter pattern, which is a variation of the common model-view-control-pattern. The approach focuses on a strong decoupling of the data handling and application logic behind a GUI and its visual presentation. This, in turn, allows to implement small changes to the GUI (e.g., placement of buttons, grouping of objects, display stile for indicators), without affecting the business logic, granting more flexibility, and less implementation risk. At the same time, for the testing, mock objects can be used, decreasing the complexity. Additionally, by starting with the implementation of the presenter, the requirements of the customer can be gathered and solidified, avoiding to start developing the model without having comprehensive knowledge of what is actually needed. This also helps to not get lost in focusing on rather insignificant visual details or fattening the view component with business logic, which also increases the difficulty of testing. Overall, this paper presents a strong case for the decoupling of components in a TDD setting, while also proposing a technique for its utilization when it comes to the development of GUIs. Furthermore, to save time and avoid complications, it highlights the importance of structuring the developers’ work in a way that the requirements can be gathered before starting with the implementation of the actual logic.
During the same year, an analysis of two TDD endeavors was published [39], focusing on how such projects should be conducted. In this work, the importance of conviction to the approach and if possible, guidance through experienced TDD applicants was highlighted. Moreover, it was stressed that TDD is not an end in itself, therefore, the tests should be directed at parts that might actually break. This means that writing tests for every single component of the program, like “getter” or “setter” methods, are a waste of time that should be avoided. However, while writing unit tests are the backbone of TDD, it is also necessary to create integration tests to verify the interplay of those units. Accordingly, these two types of tests can be considered the minimum. Generally, the application of different types of automated tests is recommended to increase the coverage of the validation. Further, every test should bring business value. With respect to the costs, it is necessary to find a balance between manual tests and test automation, with the former also being necessary to assure the correct look and feel of the system and helping to increase its usability. In addition, the reusability of test components is emphasized as a way of reducing the test creation’s required effort and complexity. Again, the use of mock objects for testing purposes is highlighted as a way of acting more resource efficient. Besides the quality assurance aspect, it is also highlighted that TDD helped in accurately determining the application’s requirements based on the customer’s test data, emphasizing its influence on the software’s design.
While [40] is more focused on exploring the consequences of applying TDD, it also provides some insights on its actual implementation and comprises experience reports of actual TDD projects. Besides the need for test automation, it especially highlights the necessity of support by domain experts and customers to determine the relevant user stories and requirements as well as to perform customer centered acceptance tests. For the described projects, the user stories that the acceptance tests were based upon were required to stand alone, be discrete for implementation, should be usable as a function, provide business value, and were supposed to be testable. Further, the stories were heavily limited in scale to increase comprehensibility, manageability, and testability. Besides assuring the quality, the tests build for these user stories were also used to define and refine the requirements of the developed components, since big upfront design is prone to false assumptions and might be hard to implement, whereas a smaller scale and more direct task (in the form of developing the tests) can help avoiding those pitfalls. Consequently, in TDD, the tests are not just tests but become part of the system’s specification as well. However, the testing aspect is also not to be neglected. The developed tests should be actively utilized for frequent regression tests and in case of occurring failures, immediate fixing of the corresponding issues is required. Furthermore, the work highlights the combination of TDD with other techniques, such as pair programming, as well as the use of design patterns. However, it is also emphasized that these patterns have to be used for the right reasons and to provide a benefit and not just as an end to itself. Regarding the system’s architecture, it is stated that a certain architectural foundation is necessary, but that its specifics only emerge over time as the development progresses.
The journey of the test-driven development of a framework is outlined in [41]. There, the use of mocks is also endorsed. However, this is amended by the recommendation to avoid mocking external components or APIs. During the described development, an external API was used. Since it was rather extensive, creating a complete mock would have been extremely time consuming. Instead, the author “introduced a new class into the framework that encapsulated the use of the external API and only mocked this new element instead of the complicated API” [41], which reduced the complexity and increased the decoupling of the developed framework from the external API’s details. As an additional design challenge, not everything should be mocked. Only these parts that should be externally exposed should also be mocked, which makes this decision already an important part of the system’s design. Another point highlighted in the work is that big refactorings are to be expected in the development of a complex system, since the requirements might exceed the possibilities of the previous iteration. This should, however, not be considered as a mistake of the previous design, but as a natural part of its evolution. Finally, it is highlighted that the developer should consciously drive the design through the tests in the desired direction, since good design not magically appears just by writing test.
The most extensive consideration of generally applicable guidelines for TDD in the studied literature set is given in [42]. It is also the only book chapter. Therefore, it is emphasized that the scope of a TDD session as well as the tests should be clearly defined before its start and that test design should be cohesive, meaning that similar components should be tested in a similar fashion and that related tests should be grouped. Further, test routines should be reused when possible. Moreover, the significance of mock objects is once more highlighted, while it is also pointed out that they should only be used for external dependencies and not for (class-) internal ones. Another important point is to focus on fulfilling the current requirements, instead of trying to predict and preempt potential future necessities. Consequently, large refactorings are part of the design process and not an indicator of the previous failures. It is also stated that TDD can (and probably should) be combined with other design techniques that focus on different aspects, such as domain specific design. To solve design problems, the use of patterns should be considered. Additionally, since the big picture of architectural design is out of the scope of TDD, and the use of reference architectures or otherwise predetermined structures is recommended.
Even though the number of papers that sufficed the review criteria was rather small and they all had slightly varying areas of focus, when aggregated, they yield valuable findings on how to conduct a TDD endeavor. To make those insights more accessible and therefore, facilitate their utilization by practitioners as well as researchers, as the main contribution of this paper, they are condensed into the set of guidelines that is depicted in Table 3.
5 Conclusion
By means of a structured literature review, the publication at hand has identified twenty guidelines for the application of the TDD approach for the development of software. Those are also the main contribution of this work. Practitioners can use them as guidance for their own projects, whereas researchers can build upon them when striving to advance software testing in general or TDD in particular. Overall, those guidelines are rather extensive and cover many aspects of the domain. However, despite Scopus, the database for the search, being the largest of its kind, it has to be noted that the found publications were still rather old, and that their number was quite low. Therefore, future work that aims to validate or amend the guidelines should be directed into two directions, a broadening of the search and on conducting additional practical experiments.
References
Deb S (2014) Information technology, its impact on society and its future. Adv Comput 4:25–29
Theis TN, Wong H-SP (2017) The end of Moore’s law: a new beginning for information technology. Comput Sci Eng 19:41–50
Sommerville I (2016) Software engineering. Pearson, Boston, Columbus, Indianapolis, New York, San Francisco, Hoboken, Amsterdam, Cape Town, Dubai, London, Madrid, Milan, Munich, Paris, Montreal, Toronto, Delhi, Mexico City, São Paulo, Sydney, Hong Kong, Seoul, Singapore, Taipei, Tokyo
Fazzini M, Orso A (2017) Automated cross-platform inconsistency detection for mobile apps. In: 2017 32nd IEEE/ACM international conference on automated software engineering (ASE), IEEE, pp 308–318
Gmeiner J, Ramler R, Haslinger J (2015) Automated testing in the continuous delivery pipeline: a case study of an online company. In: 2015 IEEE eighth international conference on software testing, verification and validation workshops (ICSTW), IEEE, pp 1–6
Staegemann D, Volk M, Vu T, Bosse S, Häusler R, Nahhas A, Pohl M, Turowski K (2020) Determining potential failures and challenges in data driven endeavors: a real world case study analysis. In: Proceedings of the 5th international conference on internet of things, big data and security, pp 453–460. SCITEPRESS—Science and Technology Publications (2020)
Damasiotis V, Fitsilis P, O’Kane JF (2018) Modeling software development process complexity. Int J Inf Technol Proj Manage 9:17–40
Khan AA, Keung JW, Fazal-E-Amin, Abdullah-Al-Wadud M (2017) SPIIMM: toward a model for software process improvement implementation and management in global software development. IEEE Access 5, 13720–13741
Pizzoleto AV, Ferrari FC, Offutt J, Fernandes L, Ribeiro M (2019) A systematic literature review of techniques and metrics to reduce the cost of mutation testing. J Syst Softw 157:110388
Staegemann D, Volk M, Turowski K (2021) Quality assurance in big data engineering—a meta review. CSIMQ, 1–14 (2021)
Sneha K, Malle GM (2017) Research on software testing techniques and software automation testing tools. In: 2017 international conference on energy, communication, data analytics and soft computing (ICECDS), pp 77–81. IEEE
Uzun B, Tekinerdogan B (2018) Model-driven architecture based testing: a systematic literature review. Inf Softw Technol 102:30–48
dos Santos J, Martins LEG, Santiago Júnior VA de, Povoa LV, dos Santos LBR (2020) Software requirements testing approaches: a systematic literature review. Requirements Eng 25, 317–337
Pereira NS, Lima P, Guerra E, Meirelles P (2021) Towards automated playtesting in game development. In: Proceedings of SBGames 2021
Staegemann D, Volk M, Pohl M, Häusler R, Nahhas A, Abdallah M, Turowski K (2021) A preliminary overview of the situation in big data testing. In: Proceedings of the 6th international conference on internet of things, big data and security, pp 296–302. SCITEPRESS—Science and Technology Publications
Munir H, Wnuk K, Petersen K, Moayyed M (2014) An experimental evaluation of test driven development versus test-last development with industry professionals. In: Shepperd M, Hall T, Myrtveit I (eds) Proceedings of the 18th EASE, pp 1–10. ACM Press, New York, USA
Hill M (2002) Sharpening the axe for test driven development. In: Goos G, Hartmanis J, van Leeuwen J, Wells D, Williams L (eds) Extreme programming and agile methods—XP/Agile Universe 2002, 2418. Springer, Berlin Heidelberg, Berlin, Heidelberg, pp 269–270
Staegemann D, Volk M, Lautenschlager E, Pohl M, Abdallah M, Turowski K (2021) Applying test driven development in the big data domain—lessons from the literature. In: 2021 international conference on information technology (ICIT), pp 511–516. IEEE
Shull F, Melnik G, Turhan B, Layman L, Diep M, Erdogmus H (2010) What do we know about test-driven development? IEEE Softw 27:16–19
Crispin L (2006) Driving software quality: how test-driven development impacts software quality. IEEE Softw 23:70–71
Staegemann D, Volk M, Jamous N, Turowski K (2020) Exploring the applicability of test driven development in the big data domain. In: Proceedings of the ACIS 2020
Slaats T, Debois S, Hildebrandt T (2018) Open to change: a theory for iterative test-driven modelling. In: Weske M, Montali M, Weber I, Vom Brocke J (eds) Business process management, 11080. Springer International Publishing, Cham, pp 31–47
Keet CM, Ławrynowicz A (2016) Test-driven development of ontologies. In: Sack H, Blomqvist E, d’Aquin M, Ghidini C, Ponzetto SP, Lange C (eds) The semantic web. Latest advances and new domains, 9678, pp 642–657. Springer International Publishing, Cham
Davies K, Keet CM, Lawrynowicz A (2019) More effective ontology authoring with test-driven development and the TDDonto2 tool. Int J Artif Intell Tools 28
Fucci D, Erdogmus H, Turhan B, Oivo M, Juristo N (2017) A dissection of the test-driven development process: does it really matter to test-first or to test-last? IIEEE Trans Softw Eng 43:597–614
Beck K (2015) Test-driven development. By Example. Addison-Wesley, Boston
Williams L, Maximilien EM, Vouk M (2003) Test-driven development as a defect-reduction practice. In: Proceedings of the 14th ISSRE, IEEE, pp 34–45
Janzen D, Saiedian H (2005) Test-driven development concepts, taxonomy, and future direction. Computer 38:43–50
Sangwan RS, Laplante PA (2006) Test-driven development in large projects. IT Prof 8:25–29
Shahin M, Ali Babar M, Zhu L (2017) Continuous integration, delivery and deployment: a systematic review on approaches, tools. Chall Pract IEEE Access 5:3909–3943
Karlesky M, Williams G, Bereza W, Fletcher M (2007) Mocking the embedded world. Test-driven development, continuous integration, and design patterns. In: Embedded systems conference on UBM electronics
Webster J, Watson RT (2002) Analyzing the past to prepare for the future: writing a literature review. MISQ 26, xiii–xxiii
Levy Y, Ellis JT (2006) A systems approach to conduct an effective literature review in support of information systems research. Inform Sci J 9:181–212
Okoli C (2015) A guide to conducting a standalone systematic literature review. CAIS 37:879–910
Vom Brocke J, Simons A, Niehaves B, Reimer K, Plattfaut R, Cleven A (2009) Reconstructing the giant. On the importance of rigour in documenting the literature search process. In: Proceedings of the ECIS 2009
Fosso Wamba S, Angéla MNC, Bosco EEJ (2019) Big data, the internet of things, and smart city research: a literature review and research agenda. In: Reyes-Munoz A, Zheng P, Crawford D, Callaghan V (eds) EAI international conference on technology, innovation, entrepreneurship and education, 532, pp 263–276. Springer International Publishing, Cham
Elsevier: Scopus® Expertly curated abstract & citation database, https://www.elsevier.com/solutions/scopus. Accessed 22 Dec 2021
Alles M, Crosby D, Erickson C, Harleton B, Marsiglia M, Pattison G, Stienstra C (2006) Presenter first: organizing complex GUI applications for test-driven development. In: AGILE 2006 (AGILE’06), pp 276–288. IEEE
Kum W, Law A (2006) Learning effective test driven development—software development projects in an energy company. In: Proceedings of the first international conference on software and data technologies, pp 159–164. SciTePress—Science and Technology Publications
Parsons D, Lal R, Lange M (2011) Test driven development: advancing knowledge by conjecture and confirmation. Future Internet 3:281–297
Guerra E (2014) Designing a framework with test-driven development: a journey. IEEE Soft 31:9–14
Guerra E, Aniche M (2016) Achieving quality on software design through test-driven development. In: Software quality assurance, Elsevier, pp 201–220
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Staegemann, D., Volk, M., Pohl, M., Haertel, C., Hintsch, J., Turowski, K. (2023). Identifying Guidelines for Test-Driven Development in Software Engineering—A Literature Review. In: Yang, XS., Sherratt, S., Dey, N., Joshi, A. (eds) Proceedings of Seventh International Congress on Information and Communication Technology. Lecture Notes in Networks and Systems, vol 465. Springer, Singapore. https://doi.org/10.1007/978-981-19-2397-5_30
Download citation
DOI: https://doi.org/10.1007/978-981-19-2397-5_30
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-19-2396-8
Online ISBN: 978-981-19-2397-5
eBook Packages: EngineeringEngineering (R0)