Case study

SpecFlow shifts test into development for Mediaclip

Introducing Mediaclip

Mediaclip is a software development company headquartered in Montreal, Canada. Mediaclip develops and distributes software for e-commerce product personalization by enabling content owners to deliver a rich user experience that increases sales and customer loyalty. Mediaclip customers typically embed their solutions into their websites and apps and white label them, for instance, photo books, calendars, posters, and more.

Challenges

-Different styles of scenario writing, therefore difficult to understand -Complexity and inconsistency of scenarios, therefore collaboration suffers

Solutions

-TDD to reduce efforts required for development -BDD to improve the readability of scenarios and speed of development

Why SpecFlow

-Readability and simplicity of test cases -Testing closer to development -Shared understanding and enhanced collaboration

The before-state

The development team was given a new challenge and started work on a .NET Core AngularJS web application. At the start of development, the team took the usual approach by writing specifications in regular documents and used SoapUINUnit, Protractor/Selenium to test APIs, C# unit tests, and UI, respectively. All other tests were carried out manually.

Tech stack

Testlink served as the test management tool to keep an overview of the testing activities. Every team member tried to contribute with their part; however, the tests tended to be very differently written based on everyone’s style. Also, testing different API scenarios were challenging to do in an easy-to-understand and readable way. Finally, working on the application had its challenges too, due to the method in which requirements were defined and documented.

It was clear that the current workflow, both in development and testing, needs to change for a smoother and more efficient way to work. To tackle this, the team introduced Test Driven Development (TDD) to help bring the size of the implementation chunks down and Behavior Driven Development (BDD) to help with the readability and speed of the tests. For BDD, SpecFlow got selected.


The team introduced Test-Driven Development (TDD) to help bring the size of the implementation chunks down and Behavior Driven Development (BDD) to help with the readability and speed of the tests. For BDD, SpecFlow got selected.

 


Read our recent article about how to start with BDD.

Learnings from the implementation of SpecFlow

During the implementation of SpecFlow, the team of about ten developers swiftly became familiar with Gherkin language, credit to its simplicity, and created their first few automated BDD scenarios in the first two sprints. After that, the TDD and BDD solutions kept growing at a good pace.

There were, however, some challenges along the way that took much longer to solve. Some of them are still an ongoing concern and provide room for optimization:

  • Test environment setup
  • Changes to the test environment by the running tests
  • Optimizing test execution time
  • Reusing existing automated steps
  • Treat your test code seriously
1

Test environment setup

Deploying the application and the APIs to a properly configured test environment in the build process became an additional requirement to the team as testing shifted closer to development. Some of the more sophisticated BDD tests needed multiple components running at the same time.

2

Changes to the test environment by the running tests:

The tests (BDD scenarios) were modifying the application. They created DB records, changed the state of some configuration data. The team had to agree on a concept to deal with this and make sure tests do not step on each other’s toes when they run and that the .Net Core application is in a similar starting state each time a test run is triggered.

3

Optimizing test execution time:

A test takes time to execute. Even if this is just a few seconds per test, it adds up as the suite of tests grows. Feedback becomes slower the more extensive the suite becomes. This is a balancing act that the team needs to manage carefully.

4

Reusing existing automated steps:

Keeping tests small in scope makes them much easier to maintain and quicker to run but creates many steps and step bindings. Writing them in a re-usable way took some practice. The next level of re-use was to string these steps together into larger tests which also influenced how the team had written the steps.

5

Treat your test code seriously:

A well-architected and current test code is as essential as the application code. If you do not treat it this way, it can quickly become a burden. Users lose trust in the results, and the feedback they are supposed to provide becomes meaningless.

The after-state

GIVENWHENTHEN
300 easy-to-understand SpecFlow tests
Reduced Feedback Cycle
Improved Software Quality

I can trust that the information in the SpecFlow files is correct and up to date.

Bertrand Provost

A portfolio of roughly 300 easy-to-understand SpecFlow tests is what the team takes great pride in. It helps them test their applications faster and more efficiently. Incorporating both TDD and BDD with SpecFlow, Mediaclip was able to shift their testing activities much closer to development. Their feedback cycles have been significantly reduced, their software quality improved and their confidence to release changes to production is higher than ever.

About Mediaclip

Mediaclip is the premier developer of white-label software for the creation of a wide range of personalized products. It enables printers, retailers, and content owners to deliver a rich user experience that increases sales and customer loyalty. Its solutions are currently integrated into hundreds of websites worldwide.

Ready to get started? It's free!

Use SpecFlow