Test-driven development in Agile PLM: an experimental test

Agile Methodology, Android Development, iOS Development

One of many reasons for Test-driven development is the mere speed of testing: with automation I’ve managed to increase app testing speeds 5-fold.

More and more software development processes are run with lean methodologies. However, application testing is very often neglected in order to reduce initial costs and time. In this article I want to present the results of my experiment which is a proof that using Test-driven development doesn’t only pay off, but it also significantly enhances the quality of an app.

What is Test-driven development?

Before I describe the process of my experiment let’s highlight the most important steps of Test-driven development:

  1. Analyzing possible user actions and implemented data
  2. Writing up potential scenarios and test data
  3. Creating a software pieces and testing it

If the app we are making is complex, working with TDD may initially extend the time needed for a test. But what can we gain instead?

Test-driven development in Agile PLM

Combined with Agile methodology, TDD controls code quality and app security. Thanks to problem analysis and mocking up input data (correct and faulty examples as well) we can foresee a lot of potential scenarios. Then we can detect weaknesses and properly secure them at the very beginning. If you’d like to learn more about TDD, this Wikipedia article covers it very well.

In Agile lifecycle management, the team is working in a time-sensitive environment. And no matter how experienced developers are, they are prone to making mistakes when under pressure, especially faulty assumptions about data input or user behaviour.

Test-driven development

Source: s2.quickmeme.com

Without automated tests, a developer must manually repeat the same steps over and over. He has to input the same data several times to check the correctness of a code action. It takes a lot of time, especially when the app is quite complex.

Test-driven development by example

For this article I’ve developed a mobile app which verifies a personal details form. To make the verification process more difficult, I’ve made a few extra conditions. For example, a surname must:

  • Be single/one-word
  • Consist of a-z characters
  • Start with a capital letter
  • Include at least 5 characters

Manual tests

Even though the number of conditions was so little, testing the correctness of the validator was difficult and it took about 20-30 minutes for the following: reinstall the app, input data and save the results. When it turned out that some conditions have to be changed, all the manual tests had to be retaken. As a result, the testing time of such a simple feature was extended to 2 hours. 

Test-driven development

I created the same app but this time in accordance with TDD guidelines. To make this experiment more credible, the time lag between these two attempts lasted about 2 weeks. I familiarized myself with all the requirements and started mocking up the test data (correct and incorrect examples). It took me about 15 minutes. In the beginning it was going smoothly, later I’ve turned to more fancy scenarios.

Having the data list at hand, I’ve created a project and wrote up unit tests. It took me around 15 minutes. Next, I started writing a code. Seeing the test data, I knew which cases I’d have to prepare my code for. Testing all data scenarios took less than a minute! If one of the tests failed, I implemented changes and with only one click restarted the whole process. Altogether, it took me about 10 minutes to test the code.

Test-driven development

Time required for manual and automated testing

Summing up, app verification with Test-driven development lasted 5 time shorter than with manual test. I could now spend the saved time programming new features or fixing bugs. Most importantly, we created a working app which is less vulnerable to user errors.

Conclusion

If you work in web or mobile app development, and you practice Agile PLM, you should consider using Test-driven Development. You can save time to do tests or create features, and your dev team will gain a better understanding of the code. Change management will be less of a hassle, which will keep your costs low and reduce the number of unexpected situations.

Check out other agile methodology related articles on our blog.

Kacper Obrzut Full-stack Development Lead

Kacper is our lead Full-stack Developer and an incurable optimist. At Zaven he constantly works hard to create engaging, useful and user-friendly apps. In his spare time, he devotes himself to his three passions: hiking, photography and UX-oriented IT development.

Popular posts

From Hype to Hard Hats: Practical Use Cases for AI chatbots in Construction and Proptech.

From Hype to Hard Hats: Practical Use Cases for AI chatbots in Construction and Proptech.

Remember the multimedia craze in the early 2000s? It was everywhere, but did it truly revolutionize our lives? Probably not. Today, it feels like every piece of software is labeled "AI-powered." It's easy to dismiss AI chatbots in construction as just another tech fad.

Read more
Fears surrounding external support. How to address concerns about outsourcing software development?

Fears surrounding external support. How to address concerns about outsourcing software development?

Whether you’ve had bad experiences in the past or no experience at all, there will always be fears underlying your decision to outsource software development.

Read more
What do you actually seek from external support? Identify what’s preventing you from completing a project on time and within budget

What do you actually seek from external support? Identify what’s preventing you from completing a project on time and within budget

Let’s make it clear: if the capabilities are there, a project is best delivered internally. Sometimes, however, we are missing certain capabilities that are required to deliver said project in a realistic timeline. These may be related to skills (e.g. technical expertise, domain experience), budget (hiring locally is too expensive) or just capacity (not enough manpower). What are good reasons for outsourcing software development?

Read more
Mobile Apps

Get your mobile app in 3 easy steps!

1

Spec out

with the help of our
business analyst

2

Develop

design, implement
and test, repeat!

3

Publish

get your app out
to the stores


back to top