NSM as Another Gherkin Replacement in Robot Framework

AdamPrzybyla 1 views 32 slides Sep 27, 2025
Slide 1
Slide 1 of 32
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32

About This Presentation

NSM as Another Gherkin Replacement in Robot Framework


Slide Content

NSM as Another Gherkin Replacement
in Robot Framework
Adam Przybyła <[email protected]>
(Creative Commons CC-by-nd)
Robot Framework - Open Space - Wrocław 2025

Questions?

What is a Robot Framework?
●Open Source
●Generic test automation framework
●License
●Any editor
●Python support
●Live documentation
●Ubiquous language

Why to use Robot Framework?
●High level keywords
●Logging
●Reports
●Data driven test cases
●Behavior-driven style test cases
●Tagging
●Easy to include in your continous integration system

Simple example of Robot Framework

Ubiquitous Language is the term Eric Evans uses in
Domain Driven Design for the practice of building up
a common, rigorous language between developers and
users. ... Evans makes clear that using the ubiquitous
language in conversations with domain experts is an
important part of testing it, and hence the domain
model.

About BDD
By origin, BDD aims to integrate verification and validation
to a design technic on outside-in style, or better, beginning from the
software part perceived by user up to basic units, while it reduces
the guaranty costs of software quality, while concentrating on the
direct connection of software requisites to the artifact that will
implement them: the code.
As BDD strongly bases on the automation of specification
tasks and tests, it is necessary to have a proper tooling to support
it. Tools are necessary to connect the requirements text to the code,
in order to facilitate the testing writing and so on.

Language of the tests
– let’s call it Mortal Combat
●Eveything is possible we can assign any name to any object
●Polysemy
●Homonymy
●Names have no meaning

*** test cases ***
t1
k1
k2
k3
Bad example 1

Bad example 2
*** test cases ***
T42.42.42
Secretkeyword1 ${p1} ${p2} ${p3}
Secretkeyword2 ${p1} ${p2} ${p3}
Secretkeyword3 ${p1} ${p2} ${p3}

Text, text, text ...
●Linux as text processing system
●Compilers, compilers and compilers compilers
●Python - scripts
●Robot Framework
●Humanities – languages related science
●Everybody knows computers
●Natural language can be accurate
●Natural Semantic Metalangue

Cobol – success story
●This is not a story about nostalgia.
● It is a story about survival.
●→ 43% of banking systems still run on COBOL.
● → 95% of ATM transactions rely on it.
● → COBOL powers the systems you use every single day
without ever noticing.

Grekhin and alternaitives
●Robot Framework
●Pytest-bdd
●Cocumber
●Rspec
●All test’s steps with functions with long names
● Behave/Radish
●Pyramid - PyCukes,Ludíbrio,Should-DSL
●Gauge

Feature: Guess the word
# The first example has two steps
Scenario: Maker starts a game
When the Maker starts a game
Then the Maker waits for a Breaker to join
# The second example has three steps
Scenario: Breaker joins a game
Given the Maker has started a game with the word "silky"
When the Breaker joins the Maker's game
Then the Breaker must guess a word with 5 characters
Gherkin example

Given-When-Then style
Given/When/Then/And/But - removed

Environment - Internal libraries
●Python language
●Ansible Framework – set of recipes to handle components
●Impansible library – connect nsm with ansible
●NSM library – set of keywords for own nsm scripts/tests
●Robot Framework – Python library to use all that libraries

*** Settings ***
Resource NSM.robot
Metadata Author Adam Przybyla
*** Test Cases ***
Test 1
Teraz jest tak: ja widzę webpage
Ja nie widzę słowa logged na webpage
Potem ja użyję słów credentials na webpage
Z tego powodu ja widzę słowa logged na webpage
Niedługo potem ja nie widzę webpage
Test 2
Teraz jest tak: ja widzę webpage
Ja nie widzę słowa logged na webpage
Potem ja użyję słów bad credentials na webpage
Z tego powodu ja nie widzę słowa logged na webpage
Niedługo potem ja nie widzę webpage
Test 3
Teraz jest tak: ja widzę webpage
Ja nie widzę słowa logged na webpage
Niedługo potem ja nie widzę webpage

*** Settings ***
Resource NSM.robot
Metadata Author Adam Przybyla <[email protected]>
*** Test Cases ***
Test 1
It is like this now: I see the webpage
I not see words logged on the webpage
then i use the words credentials on webpage
because of this: I see words logged on the webpage
after this i see the webpage no more
Test 2
It is like this now: I see the webpage
I not see words logged on the webpage
then i use the words bad credentials on webpage
because of this: I not see words logged on the webpage
after this i see the webpage no more
Test 3
It is like this now: I see the webpage
I not see words logged on the webpage
after this i see the webpage no more

*** Settings ***
library Impansible
library Collections
*** Test Cases ***
test 1
${x}= Setup localhost
log to console ${x}
${y}= get from dictionary ${x} ansible_facts
${h}= get from dictionary ${y} ansible_hostname
${z}= get from dictionary ${y} ansible_distribution
Should be Equal ${z} Ubuntu
Should Contain ${h} tester
test 2
${x}= apt localhost package=mtr state=present
${x}= get from dictionary ${x} invocation
${y}= get from dictionary ${x} module_args
${s}= get from dictionary ${y} state
Should be Equal ${s} present
test 3
${x}= apt localhost package=mtr state=absent
${x}= get from dictionary ${x} invocation
${y}= get from dictionary ${x} module_args
${s}= get from dictionary ${y} state
Should be Equal ${s} absent
test 4
${c}= get certificate localhost host=www.onet.pl port=443 proxy_host=10.1.1.1
${e}= get from dictionary ${c} expired
Should not be True ${e}
Impansible

*** Settings ***
Resource NSM.robot
Metadata Author Adam Przybyla
*** Test Cases ***
测试1

现在是这样的:我看到
webpage

我在
webpage
上看不到
logged 单词

然后我在
webpage
上使用
credentials 单词

因此我在
webpage
上看到
logged 单词

在此之后,我不再看到
webpage
测试2

现在是这样的:我看到
webpage

我在
webpage
上看不到
logged 单词

然后我在
webpage
上使用
bad credentials 单


因此我在
webpage
上看不到
logged 单词

在此之后,我不再看到
webpage
测试3

现在是这样的:我看到
webpage

我在
webpage
上看不到
logged 单词

在此之后,我不再看到
webpage

What a hell is this NSM???
●Global Earth Observation System of Systems (GEOSS) with
internal language to query information in different
languages based on NSM
●Language with limited set of words similar to natural
language
●Easy to translate
●Semantic Primes
●Many languages supported

An Anglo cultural script linked with "personal autonomy":
many people think like this:
when someone does something, it is good if this someone can
think like this:
"I am doing this because I want to do it"

NSM Resources
●https://nsm-approach.net/
●https://www.academia.edu/127053765/
Dialektyka_pozytywnej_i_negatywnej_heurystyki_jako_m
etoda_testowania_oprogramowania_z_wykorzystaniem_za
pisu_test%C3%B3w_w_Natural_Semantic_Metalanguage

Robot Framework Resources
●https://www.youtube.com/watch?v=njcHzGYv7nI
●https://www.itprotoday.com/hybrid-cloud/how-know-when-cloud-computing-
trend-has-come-its-end
●http://robotframework.org/
●https://docs.ansible.com/ansible/latest/modules/modules_by_category.html
●https://searchcloudcomputing.techtarget.com/tip/Beat-vendor-lock-in-with-a-
cloud-exit-strategy
●https://www.theguardian.com/commentisfree/2019/aug/24/douglas-adams-
was-right-knowledge-without-understanding-is-meaningless
●https://codeberg.org/AdamPrzybyla

Biografy
●John Ferguson Smart „BDD in Action: Behavior-driven
development for the whole software lifecycle”
●James Shore, Shane Warden „The Art of Agile Development:
Pragmatic Guide to Agile Software Development” 2008
●Anna Wierzbicka „Wierzbicka, Anna. 1996. Semantics:
primes and universals.” 2010
●Praca zbiorowa „Certyfikowany tester Sylabus poziomu
podstawowego wersja 4.0” (wersja PL 4.0.0.1) 2023
●Noam Chomsky - „Zagadnienia teorii składni” 1982

BDD Resources
●https://www.youtube.com/watch?v=5CXSEINRojM
●https://behave.readthedocs.io/en/latest/tutorial.html
●http://radish-bdd.io/
●https://behave.readthedocs.io/en/latest/
●https://github.com/behave/behave.example.git
●http://lettuce.it/
●https://automationpanda.com/2019/04/02/python-bdd-
framework-comparison/
●https://dannorth.net/introducing-bdd/
●https://cucumber.io/docs/gherkin/reference/

●Beck, K. Test-Driven Development by Example. Addison-Wesley (2003)
●Janzen, D., Saiedian, H. On the Influence of Test-Driven Development on Software Design, Proceedings of
●the 19th Conference on Software Engineering Education & Training (CSEET'06), p.141-148, April 19-21,
2006.
●North, D. Introducing Behaviour-Driven Development - http://dannorth.net/introducing-bdd (2006).
●Evans, E. Domain Driven Design. Addison-Wesley (2004).
●Mackinnon, T., Freeman, S.; Craig, P. Endo-Testing: Unit Testing with Mock Objects. In: XP and Flexible
Processes in Software Engineering, 2000.
●Lacatos - Proofs and Refutations: The Logic of Mathematical Discovery
●https://www.youtube.com/watch?v=35PCi7Ukx2E - stop using Given/when/then
●Fowler, M. Mocks Aren't Stubs. http://martinfowler.com/articles/ mocksArentStubs.html (2007).
●Meszaros, G. (2007) xUnit Patterns: Refactoring Test Code. Addison-Wesley.
●Beck, K. (2007) Implementation Patterns. Addison-Wesley.
●Semantics: Primes and Universals (St. in Classification Data Analysis) Anna Wierzbicka
●https://www.youtube.com/watch?v=spCOYV4KyPA - Dan Craig: Testing Spacecraft with Pytest
BDD Resources

Questions?