Writing Testable Software: An empirical study of code quality in systems written with Test Driven Development
Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Software development can be thought of in two fairly distinct ways: on one hand, it is a scientific area in which scientific method is applied in terms of quantifiable measurements and empirical studies. On the other hand (as with many other principles) it is based on craftsmanship in which the best practices emerge with experience.TDD is one such practice, emerging from the community of software developers as a means of developing higher quality software.
This thesis aimed to study whether or not TDD actually leads to an increase in quality. This was conducted by developing a client application for a company in southern Sweden called TN Datakonsult AB. The application receives and visualizes signals from industrial processes. An API with the intent to capture this data over HTTP was developed in C#. This API was written by using TDD, while the client that consumed the API was written without tests as a control group. The code metrics that were calculated were cyclomatic complexity, lines of code, depth of inheritance, code coverage and class coupling.
The results shows that many of the benefits associated with TDD are derived from the ability to track that the application under development is behaving as expected at any given time. This is a quality aspect which is particularly difficult to measure, even though the code metrics pre-sented will assist the developer to keep track of the state of the application.
Place, publisher, year, edition, pages
2012. , 57 p.
TDD, Test Driven Development, Software Testing, Code metrics, Unit test
Software Engineering Information Systems
IdentifiersURN: urn:nbn:se:miun:diva-17481OAI: oai:DiVA.org:miun-17481DiVA: diva2:572938
Jennehag, Ulf, Dr