samedi 29 juillet 2017

How to create a Web Application from scratch using BDD?

I want to start a pet project to get confident with creating Web Applications from scratch and I want to use BDD and TDD. I read in "Growing Object-Oriented Software: Guided by Tests" that we should start from the thinnest slice of the system that allows us to have a walking skeleton of the entire application so we have can have a quick feedback and start wondering about the production/deployment procedures.

After writing the acceptance test in BDD I would move to finer granularity tests such as Unit tests.

Imagining that the web application is about finding the superhero who is more similar to you, I would write a BDD scenario such as:

When I insert my information
Then the system should tell that the superhero I'm more similar to is "Batman"

I'm ignoring the authentication on purpose so we can focus on the main functionality of the system. This scenario assumes that there is a working infrastructure behind, so that the scenario above can be replicated automatically, end-to-end.

Assuming that I want to lay out the web application in different layers (Web Server, Application Server and Database), how can I implement this test? Supposing I want to use Selenium WebDriver to simulate the user, what layers must be mocked and what layer is going to be tested first? I also thought about starting from testing the API only, but that wouldn't be a end-to-end test, but we would test the application only partially.

Aucun commentaire:

Enregistrer un commentaire