Is the Screenplay Pattern Better Than Page Objects? With John Smart
We had an interesting session this year at the Automation Guild Conference with John Ferguson Smart, creator of the Serenity framework on the Screenplay Pattern. It created a lot of interest and conversation among Guild attendees and speakers alike; so much so that someone in the group recommended that I create a separate podcast dedicated to the topic … so here it is!
About John Smart
John Smart is an international speaker, consultant, author and trainer well known in the Agile community for his many books, articles and presentations, particularly in areas such as BDD, TDD, test automation, software craftsmanship and team collaboration. John is the author of the best-selling BDD in Action, as well as Jenkins: The Definitive Guide and Java Power Tools. He is also very active in the Open Source community, John also leads development on the innovative Serenity BDD test automation library, described as the “best opensource selenium webdriver framework”.
Quotes & Insights from this Test Talk
- The essence of what we're talking about here is not just writing automated tests that check various aspects of a website or an application. When we start to do something like screenplay,
we're actually changing our perspective on automated tests. Rather than just writing tests that verify whether the application works after the fact, which is the more traditional way of writing automated tests, we're actually moving towards a more proactive approach, a more dynamic approach; we're actually using automated tests to help us focus on what is really important – to give feedback to the business, to give feedback to the team, to enable us, empower us, to deliver applications and new features much faster. It is very much in the line of behavior driven development of DevOps, of Lean Enterprise, and all of those good things. We're going to see
how screenplay helps you deliver on these promises.
- In a nutshell, what is Serenity BDD? It's an open-source test library, with a very strong focus on, not so much test recording – although, obviously it does do test recording – it's very focused on requirements reporting. What I like to call feature coverage, or release readiness. How do you know whether your application is actually ready to go into production? How do you know what features you've delivered, and how well they're tested? This is something that is not immediately obvious in a typical test report. We'll see what this means later on, and what it looks like.
- Another big issue we find is reusability. There's a huge maintenance issue in code that's hard to reuse, or is not reusable at all. In Serenity BDD, what we do is we use reusable components; not at a technical level. We have page objects, but they're not the main focus. We take reusability to the next level up: we have reusable business components. So we compose tests using business concepts, not using technical concepts. That makes a huge difference in its ability to scale, to write tests that will stand the tests of time, that will bring people on board and get them up to speed quickly, and to write tests for very large applications.
- Screenplay uses the idea of actors, tasks, and goals to express tests in business terms, rather than in terms of interactions with the system. In screenplay, we describe tests in terms of an actor who has goals
Connect with John Smart
- Blog: johnfergusonsmart
May I Ask You For a Favor?
Thanks again for listening to the show. If it has helped you in any way, shape or form, please share it using the social media buttons you see on the page.
Additionally, reviews for the podcast on iTunes are extremely helpful and greatly appreciated! They do matter in the rankings of the show and I read each and every one of them.
Test Talks is sponsored by the fantastic folks at Sauce Labs. Try it for free today!