Тёмный

Svetlana Marina - Day-to-Day Property Based Testing in Scala - Compose Melbourne 2019 

Compose Conference
Подписаться 2,7 тыс.
Просмотров 407
50% 1

Day-to-Day Property Based Testing in Scala
Property-based testing is a popular testing concept, which came from the world of Functional Programming. QuickCheck in Haskell is an iconic framework, which introduced us to this idea. Today we can find testing libraries supporting PBT in any main-stream languages, including Scala, JavaScript, Ruby, Python, Java, etc.
We all like the idea of building high quality and robust code, covering all the possible and impossible edge cases. Maybe this is why many of us are getting hooked on the Property-based testing approach or at least we are not opposed to try it out.
It gives us an ability to run a single test case hundreds of times on a large range of data, covering edge cases we’ve never thought we had in the first place.
However, if you are like me and your day-to-day job is to create an API and save data into a database or maybe even send it over to another API, you also probably struggled to come up with a good application of this practice. It is easy and “very useful” to test that a reverse of a collection is still working. But, when it comes to if-else conditions, we find it hard to come up with the right property to test.
In this talk I would like to focus on a practical application of this concept, presenting some examples in ScalaCheck. I will start with a summary of what Property-based testing (PBT) framework equips you with and what should you expect from it. There will be basic examples demonstrating the power of PBT. But mostly, I will cover existing patterns and tips you can take to your normal life projects and use them to leverage this PBT tool.
About Svetlana Marina
Svetlana is a Software Engineer at ThoughtWorks. She likes delivering software into production and making this a joyful process. She's is a polyglot and during her career she had a chance to work with quite a set of different languages. The most impactful of them for her was Scala, which introduced her to the world of functional programming. Since then, she always tried to adopt FP concepts on her projects, even if they were in the mainstream non-fp languages.

Наука

Опубликовано:

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
Куда Анджилиша снова летит???
00:16
new proxy update
5:29
Просмотров
A beautiful math question for advanced students
10:38
Scala Testing
15:26
Просмотров 15 тыс.
How To Write Unit Tests in Python • Pytest Tutorial
35:34
Bidirectional Type Checking
41:31
Просмотров 6 тыс.
Don't throw exceptions in C#. Do this instead
18:13
Просмотров 251 тыс.
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00