Похожие чаты

Who use Spock Framework in production? — what is your experience? —

did you face any problems?

5 ответов

19 просмотров

I used it and love it! But it has drawbacks also. Have to go out right now, will give you detailed info later today

Used it with grails mostly. Also used it java project that was a small part of larger ecosystem. Well, advantages are obvious: - it runs on top of junit (implemented as junit runner/extension), so you can mix spock with junit, so you can just try it in existing project and see how it goes (spock2 - junit5, spock1 - junit4, mix different versions is not a problem, but requires some build system configuration) - mocking in spock is a breeze - powerful, flexible, and concise - data driven tests are much more pleasant to use than ones in junit, and more important it's much easier to comprehend those when you read tests other developers written, compared to junit - has some nice in-built "extensions" (don't remember exactly how they are called, one most notable I remember is @Timeout(...)) - you can build your own extensions, and what's more important - it's very easy to do; I remember building something like this https://vertx.io/docs/vertx-unit/java/#_asynchronous_testing for testing async code, so application of it would be @Async(steps = 3) def "some test with 3 async steps verifications"(Async async) { doSomething().andThenOnAnotherThread(() -> async.success()); // ... } Building such stuff was a breeze, it needed very little effort to ingtegrate with spock. - groovy power asserts are probably the most important advantage. They are just super-awesome. Even assertj with all it's bunch of cool handy methods out there and readable error messages is nothing compared to groovy power asserts. Groovy asserts are more readable, require zero effort from you in terms of learning some api, and present you what you exactly need in 99% of cases. You know how they said in the movie - unfortunately, no one can be told what groovy power assert is. You have to see it for yourself. Now to the drawback. And here I can list only one, but it's huge. It is applicable only if you have non-groovy project. You have java project. You have java devs. You need to write tests for java code. And you decide to use groovy testing framework. Now you have two problems - you need to write tests and all your java devs have to learn groovy, at least the basics. And the thing is the more they learn - the more they use, and you become more and more dependent on groovy skills. So now when you need to find one more dev on the market you would need to have groovy in their skillset. This won't be a problem at all, if you'll manage to not use lots of groovy specific features in tests, but I wouldn't rely on it.

Rabestro- Автор вопроса
Dmytro Buryak
Used it with grails mostly. Also used it java proj...

Thank you for your comprehensive feedback! Can I quote and refer to you? Have you used this Framework in SAP Commerce (Hybris)? I ask this because the project where I propose to use it is a SAP solution.

Rabestro
Thank you for your comprehensive feedback! Can I ...

Yep, sure. But be careful to not make such decisions based only on feedback of some random guy on the internet)) Have no idea what this SAP is, never worked with it. So I can't give any advice here. But imho, if the *repository* (smallest isolated indivisible unit of building) where you want to use it is big enough and there will be more than 4-5 devs working with it, I wouldn't use spock. Because of the last point in my description - you would introduce one more technology/language that developers usually are not familiar with.

Похожие вопросы

Обсуждают сегодня

Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
Ну вот просто даже давайте вот как. Какой нибудь конкретный кейс, можете в пример привести, где бч работает и приносит прикладную пользу, а не просто что бы было? Не крипту.
Alexander Andreev
22
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
объясните пожалуйста, почему функция не работает должным образом? вроде должно брать активное окно сравнивать его размер с размером экрана, и если есть совпадение = true прове...
JF
9
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
да кстати заметил всюда почему то всех сюда прёт, ни в одном чате столько ботов не прёт как сюда.. Может чота надо доработать?
REDis
15
Мне вот любопытно. Уже сколько времени имею соблазн купить макбук, ибо подозреваю что очень уж удобен будет в связке с другой техникой от эпл которая у меня есть, да и сам по ...
Not Yeromin
14
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
Карта сайта