Last week I was visiting the ElixirConf EU 2018.
Speakers were covering a bunch of interesting topics there.
One of the most interesting ideas I’ve got out of those talks was a “Property-based testing” topic.
That topic was covered by José Valim (the creator or Elixir) in the Keynote speech and then in more details by (a core team member) Andrea Leopardi.
Let’s try to figure out what is a Property-based testing.
Let’s talk about User Interface (UI) testing.
In the “Introduction to testing” article we have covered briefly what UI tests are standing on top of test pyramid. They cover several parts of functionality at once and check how do they work together.
Today we will see them in action.
Last time we have learned about general testing concepts and have talked about unit testing in Elixir.
Now let’s go further and learn how to add tests to Phoenix project.
We will learn how to write tests for Models and Controllers.
Testing is an important part of software development.
One might argue that projects can survive with manual testing only and many of them do.
But that raises a couple of questions:
- How hard is it to refactor some parts in those projects?
- Ain’t one have a fear to refactor the code which uncovered by tests?
- How much time does it take to check the changes one just did?
- Didn’t those changes break some other part of the project?
- How to prove that the code is working as it supposed to work?
Yes, it requires the time to write tests. But does it take less time to test the stuff manually over and over again?